Repository navigation
Agent status C5/C10: show launched agents before the first status update - #21054
brennanb2025 wants to merge 28 commits into
Conversation
…atus-c10-launch-membership
Review and validation handoff — 2026-09-16Draft / not merge-ready. Published at the user's request before review/QA completion. Published head: What has been doneImplementation completed at e30e6b7, validated code/test tip 5b2325e, report-only final head 24b0339. Author reports node/web typechecks, 159 emitter/discovery tests (3 skipped), 26 inventory integration tests, diff checks and zero new changed-code quality findings passing. Prior review informed the corrections. The fresh independent reviewer only began preliminary reading before a provider disconnect; it did NOT finish. These are recorded worker/reviewer results from the stated revisions, not a fresh coordinator rerun, CI result, or blanket approval of today's PR head. Recovery/review workers used GPT-5.6 Sol xhigh; provider interruptions prevented some follow-up stages from finishing. What still needs to be doneComplete independent correctness/contract and environment/adversarial review, then fresh exact-head Electron QA. WSL guest joins, Windows relay ancestry, tmux/screen pane roots, detached automation membership, subject-keyed reader cutover and replica negotiation remain incomplete and are NOT accepted scope exclusions. This branch incorporates/reworks C5; reconcile that overlap and C1/C2/C6/C7 dependencies before merging. Before marking ready: address proven findings, reconcile current main and cross-batch overlap, complete independent review of the final diff, rerun relevant tests/typechecks/quality, and perform fresh manual Electron QA against that exact head. Use background/hidden CDP validation; unavailable auth/platform scenarios remain explicitly unverified. No successful final-head review or QA should be inferred from old report filenames or task completion labels. Earlier C5 foundation: #21058. This branch incorporates/reworks that work; reconcile rather than merge both independently. Related batch PRsC1: #21053 · C10: #21054 · C2: #21056 · C3: #21055 · C4: #21057 · C5: #21058 · C6: #21059 · C7: #21060 The remaining full-batch work stays open; opening this draft does not mark those requirements complete. |
…2025/agent-status-c10-launch-membership # Conflicts: # src/main/agent-hooks/server/server-listeners.ts # src/main/agent-hooks/server/server-state.ts # src/main/agent-hooks/server/server-status-retries.ts # src/main/agent-hooks/server/server-status-update.ts # src/main/orcad/orcad-entry.ts
|
Conflict-resolution update for head Resolved conflicts in Rerun on the integrated tree:
Still draft / not merge-ready: the fresh-launch correction and this conflict resolution need completed independent review. Final hidden/background Electron QA was not run, and WSL guest joins, Windows relay ancestry, tmux/screen boundaries, detached automation membership, mixed-version replica cutover, and related C1/C2/C3/C4/C6/C7 work remain open. This branch overlaps #21058; do not merge both independently. |
Resolve resume-sleeping-agent-session.ts: keep main's hoisted identity guard, tabId local and live-PTY ownership arm; the scoped arm now uses this branch's isAgentStatusTurnComplete so a launch-membership boundary row keeps claiming its provider session instead of reading as a finished turn.
These four root-level result/review notes are process artifacts pinned to stale SHAs, not product documentation; they are kept locally as untracked evidence instead of shipping in the PR.
…rated row sanitizeHydratedEntry rejected an entire persisted status row when runId, executionId or launchMembership failed to parse. These are optional additive facets and the return statement already omits them when absent, so the guards only converted a version skew into data loss: a build that persists a shape this parser predates would erase a live agent's whole row on downgrade, which is the disappearance this membership work exists to fix. The new hydrate test fails without this change (the pane's row is dropped entirely); providerAlias beside them already behaved this way.
…ntroduced main's #20912 let the changed-code gate see the focused import plugins, which surfaced eight import(no-duplicates) findings across seven of this branch's files. Same bindings, one specifier each.
…bundle on Node 18 Two bundle ratchets were failing on this branch. The relay bundle forbids the ES2023 array-copy methods, so the new ancestry walk uses an indexed reverse like the other modules that reach it. The daemon bundle must not pull node-pty into its require graph before the entry parses argv. This branch wired the execution-binding resolver from the main-process PTY owner registry as a module-level side effect of the hook-server adapter, and reached the same registry again for manual-discovery admission, so importing the adapter initialized the local PTY provider. Both now come from whichever composition root owns a registry: the resolver moves to desktop startup through the setter that already existed, and discovery admission becomes an injected dependency. The daemon never populated that main-process registry, so this drops an accidental coupling rather than behavior.
…cord Resolving the merge with main, this branch's turn-complete predicate replaced main's plain done check in the worktree-scoped arm of the resume claim. That was the wrong half to keep. A launch-membership row carries no provider session, and the equality guard above the arm returns false whenever either side is undefined, so a membership row can never reach it; the substitution had no effect on membership at all. What it did reach were the rows that do carry a provider session and a session boundary -- SessionStart, Grok and remote compact completion, all of which predate this branch. Claiming there runs clearSleepingAgentSession, so a pending auto-resume was deleted rather than deferred, with nothing left to retry from. main's live-PTY ownership arm is untouched.
Review-and-fix pass on
|
|
Closing this draft from the September 14 agent-status plan. That plan was re-examined against current main and replaced. This branch conflicts with main, and its central work duplicated contracts that had already merged (the canonical status store and the child-work contract landed on 15–16 September). The replacement work is being done as smaller root-cause PRs, each planned, challenged and reviewed first. |
This draft makes an Orca-launched terminal agent visible to agent-status readers as soon as the execution host has successfully created or adopted it, without pretending that the agent is already working, ready, or idle. It also ties later status reports to that specific execution so a delayed report or reused pane is less likely to update the wrong agent.
Before / After
Before: the status store usually learned that a terminal agent existed only after a provider hook or terminal status event arrived. A quiet newly launched CLI could therefore be missing from the sidebar, and restart recovery had no trustworthy launch record to reconnect to the live terminal owner.
After: the host assigns run and execution identity inside the existing create-or-adopt transaction, waits for the final terminal binding, and then publishes neutral launch membership into the existing status store. The row remains visible before the first provider event without counting as active work, a completed turn, unread activity, or a reason to keep the machine awake. Later provider events keep that membership only when their execution binding or verified process ancestry matches; complete host inventories can restore or retire membership after restart, while incomplete or unreachable inventories do not claim that a process exited.
The behavior is implemented and covered by focused tests and reader projections. It has not received completed independent review or final visual Electron QA, so the visible result is intended and tested at the data/projection level but is not yet accepted as release-ready across every launch path.
Issues
No issue is being auto-closed by this draft.
Implemented toward the direct membership report, but kept open pending independent review and end-to-end QA:
Partially addressed foundations, not complete fixes:
Still open because they require a different mechanism:
Why this approach
The execution host already has one transaction that decides whether an agent execution was newly created, adopted, replaced, or failed. Publishing membership from the successful result of that transaction means the status row uses the final terminal identity and the same decision that prevented duplicate execution. Desktop and headless startup now call the same publication and recovery functions.
Alternatives considered:
startingstatus would change the wire vocabulary for independently updated clients. This branch instead adds an optional membership fact and keeps the older neutraldone+ session-boundary projection for compatibility; readers use the membership fact for presence without treating it as completion.Concrete mechanism comparison supports the narrow ownership choice: the inspected implementations keep create/adopt decisions in one host-owned lifecycle and fence stale session events, but they do not establish Orca's cross-host status publication or provider-hook attribution. Direct SSH/WSL parity, replica convergence, and every reader's final cutover therefore remain explicit work rather than claimed precedent.
Scope, overlap, and remaining work
Draft / not merge-ready. These PRs were opened before final review and QA at the user's request. The earlier combined-branch reviewer was interrupted. Conflict resolution and passing focused checks do not replace independent architectural review, platform fixtures, or hidden/background Electron QA of the final head.
Checks on
74a8760d4eorigin/mainat36cdb34097a7075718abe41c29d559101841166a; resolved conflicts in hook-server listeners/state/retry/status update and headless startup, preserving both current-main store rules and this branch's execution-bound launch membership.ORCA_BACKGROUND_LAUNCH=1 pnpm tc:nodeandORCA_BACKGROUND_LAUNCH=1 pnpm tc:web: passed.pnpm run check:code-quality:changed: passed with zero new findings across all gates (698 files in its repository comparison range).git diff --checkand conflict-marker checks: passed.Remaining validation gap: no completed independent review or final Electron/mobile UI QA exists for this exact head. Native, daemon, WSL, Windows relay, direct SSH, tmux/screen, detached automation, mixed-version peers, owner-promotion races, restart/replay, and visible sidebar behavior still need final end-to-end coverage before this draft can be marked ready.