Repository navigation
Agent status C5: tie status reports to the launched agent - #21058
brennanb2025 wants to merge 8 commits into
Conversation
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 doneIndependent review-and-fix added binding propagation, claim validation and regression coverage; focused suites, node typecheck and changed-code quality were reported passing. That report explicitly left ancestry, reset/alias and production admission work incomplete. 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 doneThis is the earlier C5 foundation, not the latest full identity solution. Later recovery is included in the C10 combined C5/C10 PR: do not merge overlapping implementations independently. Nested emitter proof, verified manual/discovered subjects, alias/reset lifecycle and consumer integration require review against that combined candidate. Fresh exact-head Electron QA is outstanding. 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. Later combined candidate: #21054. This PR preserves the earlier foundation for review; do not 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. |
…atus-c5-run-identity # Conflicts: # src/main/agent-hooks/server/server-listeners.ts # src/main/agent-hooks/server/server-state.ts # src/main/agent-hooks/server/server-status-update.ts
|
Conflict-resolution update
Remaining blockers are unchanged: this is a draft foundation with no standalone visible fix, it overlaps #21054 and should not be merged independently from it, and it still needs independent final review plus exact-head host-path QA. Nested emitter proof, provider alias/reset history, manual/tmux discovery, public plugin identity, reader cutover, and the linked user-visible tickets remain open. |
…atus-c5-run-identity
Splits the execution-binding contract out of `agent-status-run.ts` into `agent-status-execution-binding.ts`. The ownership layer only needs run and attachment identity; the provider-alias half of a run record needs the hook wire envelope, which imports `node:crypto`. Binding `statusBinding` onto `AgentSessionOwnerBinding` therefore pulled that dependency into the renderer graph and broke the renderer node-builtin boundary. The two modules also had a type-level import cycle, which the split removes. Renames the new hook-server claim resolver to `resolveReportedExecutionBinding`. `resolveAgentStatusBinding` already names the single pane-key-to-terminal-identity lookup that the snapshot pull and fleet paths share, and the agent-status producer census pins that name; a second export under the same name both collided with that invariant and tripped the census. Drops the two batch report files from the repo root, which the root-directory guard rejects, and re-pins the OpenCode plugin byte digests for the two identity fields now added to the plugin's POST body.
The claimed execution owner binding crosses the daemon, SSH and relay boundaries, and the two protocol constants that gate it live in `agent-session-host-authority` and `daemon-protocol-version`. Neither path was in the cross-version lane's prefix list, so a change that adds a required field to the owner binding and raises both protocol versions classified as `cross-version-wire=false` and skipped the lane entirely. Verified with the classifier directly: this branch's changed paths now report `cross-version-wire=true`, an unrelated renderer file still reports `false`. The lane's existing journeys cover structured agent sessions rather than the PTY owner binding, so this restores the trigger, not coverage of the owner binding itself.
…ion gate An owner from a host that predates run identity is still a valid owner. Requiring `statusBinding` on `AgentSessionOwnerBinding` made `isAgentSessionOwnerBinding` reject those owners, and `validatedAgentSessionOwners` throws on any owner that fails it. That call is unconditional in `listProcesses`/`listSessions`, and the daemon router fails closed across every adapter including preserved legacy ones, so a single surviving older daemon holding one claimed owner would have rejected the whole process inventory for every terminal on the machine — the inventory destructive teardown consults. The field is now optional and absence reads as "identity unknown", which is the second-class tier this design always required for agents Orca did not launch and agents behind a multiplexer. A fresh create keeps this host's binding, because this host minted it and stamped it into the spawn env before the lower host ran; an adopted owner reports whatever the lower host actually holds, including nothing. That removes the reason for the version gate, so the daemon protocol and execution owner protocol constants go back to 36 and 2. Also in this commit, from review: - An unresolvable emitter claim now costs the claim, not the status transition. The owner registry is empty for every pane this process did not launch — after a restart, once the PTY exits, and for every spooled event replayed from a window when Orca was down — so suppressing the report latched the row on whatever it last said, with nothing re-deriving it. Identity fails closed; the state machine does not. - Run identity is no longer persisted or hydrated. It is issued by the owner registry, so a hydrated copy read as host-verified with nothing left to verify it against. This matches the same writer's existing treatment of terminal handles. - The owner authority gate now tests what the lower host returned. It compared the locally built owner against the request, which compares a literal with itself, so it could not throw and left the daemon create path unchecked. Promotion moves to its own module so the reservation bookkeeping and the authority decision read separately. - The claim resolver no longer requires the POST route to agree. The route is the weakest evidence on the event and is exactly what a replayed vendor hook forges; conditioning on it rejected the correct owner precisely when the route lied. - The SSH ingest allowlist now forwards the emitter's claim, parsed at that trust boundary. It was dropped there, so every SSH-hosted agent published rows with no identity while the relay was already putting the claim on the wire. - `continuityOf` is re-read after the awaited liveness probe so a concurrent replacement continues the lineage instead of forking it.
…one list Three boundary defects found in review. `ingestRemote` took `reportedExecutionBinding` straight off the envelope while re-validating every sibling field, and the WSL relay reaches that function with a raw wire cast. A malformed value could not mint identity, but it was truthy and non-matching, which is enough to affect how the report is treated. It is parsed now, at the boundary that already exists for this purpose. The daemon kept its own copy of the pane-identity scrub list and did not gain the two new variables, so a pane that did not request them could inherit them from the daemon's environment while the local provider correctly scrubbed them. Both spawn paths now read one shared list, which is what stops the next key from being added to one and not the other. Also merges a duplicate import in the new promotion module that the focused code-quality gate rejects.
|
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 gives an Orca-launched terminal agent a stable identity tied to the actual process Orca committed or adopted. That identity now travels with status reports across local terminals, WSL, SSH, the daemon, and the relay, and the receiving host checks it against the live execution owner before using it. This is foundation work: it does not change the visible sidebar or tab behavior on its own.
Before / After
Before: a status report mainly identified a pane and workspace. A delayed report, a reused pane, or an inherited environment could be mistaken for the current agent, and later code had to guess from a title, working directory, or pane location.
After: each committed or adopted execution gets one run ID and one exact execution ID from the existing terminal-owner transaction. Managed status integrations carry those IDs, and the host accepts them as identity only when they match the current live owner. Replacement executions get new IDs; adoption keeps the existing IDs; older integrations that omit the IDs can continue updating a row without claiming a new identity.
There is no standalone UI change in this PR. The later combined C5/C10 draft, #21054, builds on this identity to publish that an agent has started before its first status event. Reader migration and the remaining visible fixes still require follow-up work.
Issues
No issue is fully resolved by this foundation.
Partially addressed:
agent.status.changedplugin event still does not expose the requested session identifier. The ticket remains open.Still open and not fixed by this PR:
Why this approach
Orca already has one transaction that decides whether a terminal execution was newly created or adopted. Extending that transaction keeps identity tied to the process that actually owns the work and preserves the same decision across native, daemon, WSL, SSH, and relay paths.
The alternatives considered were:
The chosen mechanism reuses the existing atomic owner decision and treats message IDs as claims to verify, not as proof by themselves. It does not yet prove nested-process ancestry, accumulate provider-reset aliases, discover manually launched/tmux agents, or move every reader away from title/path guesses.
Scope, dependencies, and readiness
Draft / not merge-ready. This PR was opened before final review and QA at the user's request. Earlier implementation and review reports are revision-specific; the combined C5/C10 reviewer was interrupted, and conflict resolution is not a substitute for independent review. No fresh Electron or mobile UI QA was run because this PR has no standalone UI behavior to exercise.
Checks on
38ad6da2d6origin/mainat383c543e0f6651a6c2d99ecca5ab43fbedd1bee8; resolved conflicts in the hook-server listener, state, and status-update layers.ORCA_BACKGROUND_LAUNCH=1 pnpm testfor the execution-binding, terminal-ingest, structured-status, canonical-store, and legacy-adapter suites: 5 files, 46 tests passed.ORCA_BACKGROUND_LAUNCH=1 pnpm tc:node: passed.ffc331212c38comparison baseline scanned 1,521 intervening upstream files and reported 17 unrelated findings; none were in this PR's diff.git diff --checkand conflict-marker checks: passed.Remaining validation gap: final independent architecture review and exact-head Electron/host-path QA have not been completed. Native, daemon, WSL, direct SSH, relay, owner-promotion races, nested agents, and stale replay after pane reuse still need final end-to-end coverage before this draft can be marked ready.