Commit Graph
2 Commits
Author SHA1 Message Date
Brennan Benson a7b5c0a8f2 Run supported Mac chats and background agents under Orca Agents (#41917)
* Name terminal agent hosts separately from Orca

* Account for one startup process naming write

* Use the Node runtime for the Linux naming contract

* Run supported local agents under the independent host

* Preserve retirement type narrowing and valid test plans

* Align restart warnings and satisfy changed-file lint rules

* Declare the current daemon protocol in build compatibility metadata

* Keep hosted agent output complete through process exit

* Keep the output regression focused on catalog failure and cleanup

* Keep output regression fixtures compatible with quality checks

* Publish Claude exits after hosted process absence is proven

* Pass session fences in the hosted Claude regression

* Fall back to direct chat launch when the host image is unavailable

* Keep the hosted Claude recovery fixture independent of OS signing

* Settle refused agent launches and preserve exit observation wakes

* Keep provider population fixture defaults independent of array indexes

* Document direct launch when agent host connection checks fail

* Retain native provider no-start outcomes before refusal

* Keep chats working when the agent host cannot read their folder

* Preserve native missing-folder coverage after the access preflight

* Keep desktop permission notices at the desktop launch boundary

* Bound hosted launch setup and keep hosted chats out of host process growth

A host still starting no longer holds a chat past its bootstrap deadline, the host's
code signature is read once per host process, and the native owners the host starts
for the app do not count as its terminal work. The hosted launch test runs under Node,
whose destroy closes only the host's own socket copy.

* Keep hosted owner pipes blocking, recheck the host before dispatch, and keep launch-folder errors

The native owner clears O_NONBLOCK that a host's sockets carry, so its gate read and the
CLI's stdio behave as on a direct launch. A reconnect to another host before dispatch
launches here instead of on an unprobed host, and a host spawn error keeps its code and
path so a deleted folder is still reported as missing.

* Skip hosted owner subtrees in the growth walk and expire the host image read

The growth sample now stops at hosted owners instead of walking their subtrees again,
so it never does more work than before. A host's code-signature read is reused only
for 10 s, so a bundle removed while the host runs is noticed on a later launch.

* Satisfy changed-code quality for the hosted launch wait and its test

* List provider requests in the daemon router's exhaustive switch

* Launch a chat here when the host's start fails before attach

The native owner runs its CLI only after this app opens its gate, which
attaching does. A host spawn error, a lost reply or pipes that never arrive
therefore leave no CLI running and no input sent, so the chat now launches
here instead of failing. Once attached, a failure still ends the launch.

Tests cover a host that can't read or can't start in the chat's folder, a
host that never answers the folder probe, a lost spawn reply, and the
folder-access notice verdicts.

* Keep fallback time inside the owner's startup deadline

A hosted start could spend 10 s on the spawn reply and 10 s on its pipes,
past the owner's 15 s bootstrap deadline, so a late failure ended the
chat instead of launching it here. The hosted attempt now has one 8 s
budget from the start of the launch.

A folder denial whose app-side recheck finished after a newer readable
verdict restored a cleared notice; the newest verdict for the same helper
and folder class now wins.

* Fit the hosted start inside the owner's bootstrap and proof budget

The hosted attempt's budget is now the bootstrap deadline minus the
ownership proof window, so a hosted owner or a direct fallback still has
time to prove ownership. A timer bounds the spawn request too, so a
stalled event loop can't let the bootstrap deadline fire first.

Only a newer readable verdict from the same helper supersedes a pending
folder denial, so a later denial in another folder no longer hides a real
notice, and the record holds one entry per folder class.

* Track folder re-allows per helper so a replaced helper can't erase a notice

Keying the re-allow marker by folder class alone forgot an old helper's
re-allow once a new helper read that class, so the old helper's late
denial overwrote the new helper's notice. Marks are per helper and class
again, capped to the most recent pairs.

* Supersede pending folder denials directly instead of keeping re-allow marks

Capped marks could evict a re-allow while its denial was still being
read, reviving the stale denial. A readable verdict now flags the same
helper's pending denials for that folder class, and only denials still
being read are kept.

* Keep folder verdicts off blocking reads and bound the whole hosted start

Native-chat folder verdicts now reach the shared verdict telemetry, so its
spawner-path check and pid-file read are now asynchronous instead of
blocking the main process. The extracted backlog code only builds the
sampler, so the server keeps calling the existing probe directly. Lowered
the blocking-helper baseline rows that shrank.

Connecting to the host and checking its signature and the folder now share
the hosted start budget, so a slow host still leaves a direct launch time
to prove ownership.

* Lower the sync-fs baseline row the async telemetry checks emptied

* Drop folder verdicts from host checks that outlived the start budget

A host check still running when the direct fallback took over could report
a late denial and bring back a notice a newer readable verdict had
cleared. Checks past the budget now count as abandoned and report nothing.

The integration test now ends the CLI's input only after it starts, since
its owner allows only a short grace once input closes.
2026-11-18 00:55:34 -08:00
Brennan Benson 980352d897 Reduce native chat memory by replacing per-chat Electron supervisors (#42760)
* Launch provider CLIs without a per-chat runtime supervisor

* Initialize process-owner fixtures with an isolated app environment

* Retire provider output transports and failed ownership drafts

* Finish provider stops when the session group empties

* Complete native cleanup from verified watcher exit and cancel held launches

* Let native watcher finish one-shot provider exits

* Retire late ownership records after canceled provider launches settle

* Reap each provider subtree in an isolated native parent

* Preserve provider outcomes and compatibility with native parents

* Publish actual provider identities and retire native parent observers

* Retire numeric writer PIDs when their group is proven absent

* Retire provider transports and accept proven group absence

* Fence retired process identities across asynchronous cleanup

* Use native timer types and readonly process fixtures

* Reuse bounded timeout for compatibility output drain

* Release launch scopes held by late transport error handlers

* Keep processless launch failures out of watcher waits

* Align lifecycle validation with final ownership contracts

* Remove duplicate helper preparation from the dev launcher

* Keep legacy fallback in place and simplify native ownership handoff

* Defer background provider maintenance until the first window

* Release startup hook maintenance for terminal launches

* Use relocated artifact module in native prebuild scripts

* Preserve agent failure outcomes and clean tools before ownership is lost

* Budget ownership capture for its bounded identity reads

* Keep lifecycle regressions at their behavior-owning seam

* Explain the fake-clock process-read fixture

* Capture tool ownership before restart recovery removes the CLI

* Skip descendant inventories for absent provider roots

* Make final output drain regression test deterministic

* Keep output drain fixture assertions type-safe with IPC

* Use existing provider fixtures across Node and Bun

* Prepare native provider helper for Codex contract CI

* Verify provider ownership using its recorded start precision

* Preserve exact provider ownership through reader failures

* Retire exhausted recovery records without blocking watcher cleanup

* Distinguish exited descendants from unreaped zombies

* Preserve group retirement without trusting an exited root

* Keep CLI input owned through native parent loss

* Keep watcher cleanup proof through lost-parent retirement

* Guard retirement against late watcher cleanup proof

* Contain provider launches that fail before stdio setup

* fix(claude): preserve startup diagnostics after input pipe failures

* fix(provider): capture lost outcomes before native completion cleanup

* fix(provider): retire speculative captures after a valid outcome

* fix(provider): share spawn absence classification through its existing boundary
2026-11-16 01:01:24 -08:00