Skip to content

Agent status C7: mirror host status across desktop, phone, and CLI - #21060

Closed
brennanb2025 wants to merge 10 commits into
mainfrom
brennanb2025/agent-status-c7-host-replicas
Closed

brennanb2025 wants to merge 10 commits into
mainfrom
brennanb2025/agent-status-c7-host-replicas

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​879 $\color{#cf222e}{\Huge{\mathbf{−}}}$​7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​872
Prod 41 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1855 $\color{#cf222e}{\Huge{\mathbf{−}}}$​144 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1711

Orca can show different agent status on the desktop, phone, and command line because each side can build its own answer from different events and clocks. This draft adds an ordered host-to-client status stream so a machine running agents can send a full inventory followed by updates, and clients can mirror those rows across desktop, headless, SSH, and session-tab paths.

The direction is useful, but the current implementation failed architecture review and is not merge-ready. It does not yet provide one trustworthy status owner on every execution host, and several known paths can still lose, erase, or resurrect rows.

Before / after

Before Implemented in this draft Not yet fixed
Direct SSH status arrived through a legacy event path with no ordered full inventory. A capable relay can publish a host-scoped snapshot followed by ordered updates; the client maintains a host mirror and asks for another snapshot after a detected gap. Some capable negotiation failures disable the legacy path before the new path is usable, creating a status black hole.
A missed delete while disconnected could leave a row forever. A complete snapshot can replace membership for one host, while an incomplete snapshot cannot certify that an omitted row is gone. The relay source is capped at 256 recent panes but can still label that incomplete cache as complete, so a live row can be deleted incorrectly.
Client and host timestamps could compete to decide which row wins. Host identity, owner restart identity, stream position, and local receipt time travel with the mirror; session tabs prefer host rows only after capability negotiation. An older complete snapshot from a previous owner can still roll the mirror back, and evidence-only/contact changes do not reach every reader.
Connection loss could be confused with process exit. The mirror has a separate unverifiable contact state and the main teardown path retains rows. Other negotiation/reconnect paths can still abandon the host mirror, and remote dismissal is not routed to the remote owner, so a later update can resurrect a dismissed row.

The implemented transport mechanics are covered by focused tests. They do not establish user-ready correctness because the failed review found that the stream is built around legacy bounded caches rather than the same production status engine on desktop, headless, and SSH hosts.

Issue status

No issue is closed by this draft.

Partially addressed and still open:

  • STA-3455: the branch removes some cross-machine timestamp arbitration and adds host-scoped delivery, but the failed review found that parallel status owners remain. The requested ownership refactor is therefore incomplete.

Original C7 roster items that remain open and are not fixed by this PR:

  • STA-3928 / GitHub #13852: relay-version upgrades can still strand existing remote terminals; this status stream does not change relay endpoint ownership or reattachment.
  • STA-3838 / GitHub #13629 and STA-6693 / GitHub #18663: transcript delivery is separate from status-row delivery.
  • STA-3859 / GitHub #13716: duplicate Resume prevention depends on committed launch membership, not this mirror.
  • STA-3259: the desktop interactive-card pause rule is unchanged.
  • STA-6222: this branch can carry status but does not create the provider-backed Claude lifecycle evidence the issue requires.
  • STA-4003 / GitHub #14033: the OSC status contract remains undocumented.
  • STA-7274: no persistent goal state or UI is added.
  • STA-1869: push preference/default visibility is unchanged.

At verification time, STA-1869 was In Review; the other nine Linear records were Todo. All five linked GitHub issues were open.

Why this mechanism, and why this draft is blocked

The execution host is the right place to own status because it is the machine that receives provider events and can observe the processes. A full host inventory followed by ordered updates can recover a delete that a disconnected client missed. Keeping connection health separate means “cannot reach the host” does not become “the agent exited.”

The main alternatives do not remove the failure: comparing timestamps from two machines has no reliable ordering; merging snapshots without complete membership cannot remove missed rows; and letting every reader choose its preferred source recreates the desktop/phone/CLI disagreement.

However, this branch implements the delivery layer before completing the ownership layer. The relay publishes from a 256-row legacy cache, while local and SSH paths still apply different lifecycle and identity checks. The capable-SSH cutover can also suppress the old writer before the new writer is valid. The required replacement is one production host status engine for local, headless, and SSH inputs, with the legacy format kept only as a negotiated compatibility projection. Adding another fallback or reader rule would preserve the underlying split and is not recommended.

Scope, dependencies, overlap, and blockers

  • C5/C10 must provide committed run membership; C1/C2/C3 must provide turn, completion, and readiness facts; C6 (#21059) must provide exact execution evidence without turning process presence into Working. This branch does not contain those later implementation commits.
  • The C6 branch consumes and overlaps parts of the C7 status contracts. Choose an integration order before merging either draft.
  • The earlier C5 foundation #21058 overlaps the combined C5/C10 branch #21054; do not merge those independently.
  • Known blockers: capable-SSH negotiation can black-hole status; parallel host status owners remain; a 256-row cache can be mislabeled complete; an old owner snapshot can roll state backward; evidence-only and contact changes are not delivered to every reader; remote dismissal can be undone by the next host update.

Review and validation status

Draft / not ready for merge. The current-head architecture review failed at f024f0586130803b2691d40814d9ef2bf262285e; merging current main and resolving the RPC registration conflict did not address those findings. Fresh independent architecture review is required after the ownership design is replaced.

At head 112af4120fc2a7156aff88fc3592b3b0c761ccda, merged on upstream 36cdb34097a7075718abe41c29d559101841166a:

  • 7 focused replication, RPC, SSH, relay, and session-tab files: 53 tests passed; 1 owner-restart rollback test remains explicitly expected to fail.
  • Relay cache-cap test: 1 passed, 21 skipped; the passing test proves the current 256-pane eviction behavior, not that the resulting inventory is safe.
  • Headless lifecycle test: 6 tests passed.
  • Node, web, CLI, and mobile typechecks passed.
  • Changed-file quality passed with zero new findings across 46 files.
  • Diff whitespace and conflict-marker checks passed.

Earlier hidden Electron QA was performed on older revisions only. One older real-SSH run reproduced row loss during contact loss; later source review did not use that older reproduction as proof of every current path, but the current code findings remain blocking. No Electron/mobile app, real provider-over-SSH, released old/new peer, two-host, Windows/WSL/macOS remote, or full desktop/mobile/CLI/dashboard/folder-workspace journey was run at this head.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review and validation handoff — 2026-09-16

Draft / not merge-ready. Published at the user's request before review/QA completion. Published head: f024f0586130803b2691d40814d9ef2bf262285e.

What has been done

Initial review-and-fix and focused replication/SSH checks passed; earlier hidden Electron QA at 94c3053 observed real provider transitions but left remote/mobile gaps. A later independent architecture review of current f024f05 FAILED, identifying the concrete blockers below. The earlier QA does not certify this head.

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 done

KNOWN BLOCKERS: capable-SSH negotiation blackhole; no production canonical host reducer; relay cache inventories marked complete without authoritative membership; epoch rollback; missing evidence/contact delivery to readers. Replace parallel legacy semantics with one host-owned engine, fix negotiation/reconnect/epoch behavior, then independently re-review and repeat exact-head Electron plus remote/mixed-version QA.

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.

Related batch PRs

C1: #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.

@brennanb2025 brennanb2025 changed the title Agent status C7: host status replication and reader cutover Agent status C7: mirror host status across desktop, phone, and CLI Sep 16, 2026
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Integrated current origin/main into this draft and rewrote the description around the failed architecture review.

  • New head: 112af4120fc2a7156aff88fc3592b3b0c761ccda
  • Upstream baseline: 36cdb34097a7075718abe41c29d559101841166a
  • Conflict: src/main/runtime/rpc/methods/index.ts now keeps both this branch's agent-status store RPC registration and main's newer agent-launch/browser-identity registrations.
  • Supporting merge refactor: src/main/orcad/orcad-entry.ts registers the hook-store and host-mirror cleanup functions separately, preserving the previous cleanup order while satisfying the current file-length gate. This does not address the failed C7 ownership design.
  • Rerun checks: 7 focused replication/RPC/SSH/relay/session-tab files (53 passed, 1 owner-restart rollback case still expected to fail); relay cache-cap case (1 passed, 21 skipped, and it still proves unsafe 256-pane eviction); headless lifecycle (6 passed); node/web/CLI/mobile typechecks; changed-file quality (0 findings across 46 files); whitespace and conflict-marker checks.
  • Remaining blockers: capable-SSH negotiation black hole, parallel host status owners, false-complete relay inventory, old-owner rollback, missing evidence/contact delivery, remote-dismissal resurrection, and no current-head independent review or app/remote/mixed-version QA.

GitHub currently reports the draft as mergeable, with checks unstable/pending. The pre-existing uncommitted lockfile change and private reports remain outside the commit.

…ound frame size

A mirrored row ran through normalizeAgentStatusPayload only as a boolean
predicate, and the raw wire object was what got stored and handed to readers.
The normalizer coerces rather than validates -- it truncates prompt, agentType,
model, toolName, toolInput, interactivePrompt and lastAssistantMessage, strips
embedded newlines, and clears interrupted/sessionBoundary off a non-done state --
so every one of those caps was computed and discarded on the replicated path.
An execution host could therefore place an arbitrarily large or newline-injected
field into a row that reached the renderer and the mobile projection, while the
same field arriving over the local path stayed capped.

Store the normalizer's output instead, and give frame validation the entry
ceiling it was missing: only ownerEpoch length was bounded, leaving rows and
changes unbounded. The ceiling sits above every producer's own pane cap, so a
legitimate host cannot reach it.

Tests pin both halves and fail without the change.
… is enforced

The ceiling was a literal justified by two producer caps. One of them does not
exist: MAX_AGENT_HOOK_STATUS_CACHE_PANES is only read by
upsertBoundedAgentHookStatus, which has no production caller, so it bounds
nothing. The bound that is actually enforced on the desktop publisher's snapshot
is AGENT_STATUS_STORE_LIMITS.parents, and at 2048 it was above the ceiling --
so a large legitimate host would be rejected by the validator the moment
anything applied it to that path.

Derive the ceiling from that limit instead, and say what it is for: the main
hook server's pane map is uncapped, so no constant here can bound a real census.
It only has to sit clear of the enforced bound so that reaching it means the
frame is malformed or hostile.
@brennanb2025

Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant