Repository navigation
feat(agent-status): run-identity types for keying rows by agent instead of pane - #20531
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (9)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe change adds shared agent-status contracts for execution scopes, PTY runs, provider aliases, capabilities, and subject identities. It adds strict parsers, constructors, canonical serializers, deserializers, equality checks, and bounded validation. It adds a deterministic run-alias index codec with duplicate and size checks. It extends IPC payloads with optional run-aware fields. New tests cover valid round trips and malformed inputs. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The new shared identity contracts include validation, serialization, and malformed-input coverage without an established compatibility or runtime failure. The change is ready to merge. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the purpose, design, scope, and verification results. However, it omits several required template sections and checklist items, including the mandatory Linked Issue, explicit Visual Proof response, Testing checklist, Review, Agent skill upstream boundary, Notes, and final Checklist. Resolution Add all required template sections. Provide a valid issue reference under Linked Issue, write
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: d67c025b-9d1c-4ec1-a5b3-1c376e392d5c
📒 Files selected for processing (9)
src/shared/agent-status-ipc-payload.tssrc/shared/agent-status-run-alias-index.test.tssrc/shared/agent-status-run-alias-index.tssrc/shared/agent-status-run-capability.test.tssrc/shared/agent-status-run-capability.tssrc/shared/agent-status-run.test.tssrc/shared/agent-status-run.tssrc/shared/agent-status-subject.test.tssrc/shared/agent-status-subject.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.
There was a problem hiding this comment.
ℹ️ Minor suggestions only.
Reviewed changes
- Run identity codecs (
agent-status-run.ts) —AgentStatusRunId/AgentStatusExecutionId, a provider alias, and an ordered provider-session chain with aresetBoundarymarker, all behind stricthasExactKeysparse/serialize. - Scoped subject keys (
agent-status-subject.ts) — versionedagent-status-subject-v1:keys for the canonicalpty-run, theptypane fallback, andstructured-session, overAgentSessionExecutionLocation. - Provider alias index (
agent-status-run-alias-index.ts) —Map<AliasKey, Set<RunId>>with bounded, deterministic serialization that refuses an empty run-id set. - Capability codec (
agent-status-run-capability.ts) — encode/decode foragent-status.runs.v1, deliberately not advertised inRUNTIME_CAPABILITIES. - IPC payload fields (
agent-status-ipc-payload.ts) — optionalrunId/executionId/providerAlias/revisionadded for later producers; no reader reads them yet. - Tests — four new suites (57 tests) pin round-trips, the rejection matrices, collision isolation across scope/provider/session-key-kind, and insertion-order-independent serialization.
I independently confirmed the mixed-version claim you asked reviewers to check: nothing in the tree decodes AgentStatusIpcPayload with exact keys or a strict schema — consumers either read named fields (normalizeAgentStatusObject) or spread (enrichAgentStatusIpcPayload, toAgentStatusIpcPayload), and the payload never crosses the mobile/relay wire (that carries AgentStatusEntry). The new fields are inert and safe to drop.
ℹ️ Run-scoped provider chain vs. the existing durable session chain
The new AgentStatusProviderSession[] is an ordered, provider-keyed history with reset-boundary evidence. agent-session-provider-handle.ts already owns an ordered, provider-keyed history (AgentSessionProviderHandleChain, with origin: created | adopted | resumed | forked and forkedFromKey). They plausibly serve different lifetimes — run evidence versus the durable session record — but both are being frozen now and a later PR that projects run evidence onto a durable session will have to reconcile them.
Technical details
# Run-scoped provider chain vs. durable session chain
## Affected sites
- `src/shared/agent-status-run.ts:26` — `AgentStatusProviderSession` (`resetBoundary`)
- `src/shared/agent-session-provider-handle.ts:25` — `AgentSessionProviderHandleLink` (`origin`, `forkedFromKey`)
## Open questions for the human
- Are these intentionally two representations, or should one be expressed in terms of the other?
- If a run's provider session is attached to a durable session record, which chain is authoritative for resume identity?ℹ️ Nitpicks
agent-status-subject.test.ts:60names a case "keeps the existing structured-session encoding byte-for-byte stable", but no prior encoder for this key exists in the tree — it pins a brand-new format. Reword if the intent is just forward-stability.serializeAgentStatusProviderAliasKey/ the alias index re-parse every key on write. Correct, but if these ever run on the hot status path, keep the parse-once assumption in mind.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Electron smoke evidence (PR #20531)Isolated Identity ( {"name":"Orca: brennanb2025/pr1-agent-status-types","isDev":true,"devLabel":"pr1-agent-status-types","devBranch":"brennanb2025/pr1-agent-status-types","devWorktreeName":"pr1-agent-status-types","devRepoRoot":"/Users/brennanbenson/orca/workspaces/orca/pr1-agent-status-types","dockBadgeLabel":null}Rendered state: full window launched and painted. Isolated empty profile shows the healthy first-run home: sidebar, "No workspaces found", "Add a project to get started.", right explorer "Select a workspace to browse files", status bar. Console: 0 errors, 3 pre-existing dev warnings (Radix tooltip controlled/uncontrolled, React Grab outdated). Daemon log: startup/ready, no crash. Main traces: |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the delta since the prior pullfrog review (6fdb587 → 0a475fe), a hardening pass on the run-identity codecs. Both prior review threads are addressed: the ambiguous top-level revision field was removed, and the subject module now shares isAgentStatusRunId / AgentStatusRunId with the run module.
- Canonical alias-key decoding —
deserializeAgentStatusProviderAliasKeynow round-trips the parsed alias back through the serializer and rejects any spelling that is not byte-canonical, which also closes the "split semantic duplicate" gap in the alias index. - Alias-index resource bounds — an aggregate run-reference cap (
16_384), a serialized-byte cap (4 MiB), and JSON structure limits (64Ktokens / depth3) are enforced on both serialize and deserialize, with the byte and structure checks running beforeJSON.parse. - Execution-scope canonicalization —
parseExecutionScoperequires the encoded host id to equal its canonicaltoSshExecutionHostId/toRuntimeExecutionHostIdform, and rejects a non-nullwslDistroon a non-local host. - Provider-chain consistency — a run's
providerSessionschain must now be single-provider. - Capability limit —
MAX_CAPABILITIESraised64 → 256, with a test that the run capability is found in an inventory containing it.
Verified locally: the four suites pass (73 tests, up from 57) and pnpm tc is clean. Nothing in production imports the new modules yet (only a type-only import in agent-status-ipc-payload.ts), so there is still no runtime behavior change.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The only commit since the prior pullfrog review is a merge of origin/main into the branch. The PR's own diff is byte-identical to the reviewed 0a475fe content — all nine per-file diff hashes are unchanged — so no new run-identity code was introduced. Re-ran the four suites (73 tests) and pnpm tc at the merge head; both are clean, so the merge did not disturb these modules.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Final-head Electron smoke (PR #20531) —
|
Final review statusVerdict: the PR-owned code is clean and ready within its declared types/codecs scope. The branch is at Review and fixesIterative adversarial review plus opening/final readiness audits found and fixed the meaningful issues:
The final review and final readiness audit report no P0, P1, or P2 findings. No unrelated product scope was added. Validation
Performance/resource review is clean: no polling, timers, listeners, subprocesses, render paths, or caches were added, and decode work is bounded before allocation. Compatibility review is also clean: IPC additions are optional and not yet advertised or emitted; there is no mobile-facing, persisted-state, handshake, or runtime behavior change, and the shared logic is platform/provider neutral. Current CI statusThe PR Checks run is red only because
Those files are not part of this PR delta. The dependent Merge action: no PR-owned code changes remain. The external Residual scope note: this PR intentionally defines the run-identity contracts only; pane-reuse behavior itself will change when the separate producer/store/reader migration consumes them. |



ELI5
Agent status rows are currently identified by the pane they sit in. Panes get reused — kill an agent,
start another in the same tab, and the new one can inherit the old one's row. This adds the types for
identifying a row by the agent instead: an Orca-minted run id, with the provider's own session id
kept alongside as a label.
Types only. Nothing uses them yet; no behavior changes.
Why a run id, and not Claude's/Codex's own id
Measured, with raw transcripts retained:
/clearmakes Claude discard its session id and mint a new one — same process, new name.claude --resume <same id>executions both report that id, in one transcript,on divergent branches. So a provider id does not even reliably name one live agent.
(
thread-store conflict: already has an active writer).The two providers disagree about what their own ids mean, and neither guarantee is contractual. So the
identity is ours; the provider id is a correlation used for resume.
What changed — 9 new files, additive only
pty-run(canonical),pty(fallback for rows with no run identity), andstructured-session(unchanged semantics).Map<AliasKey, Set<RunId>>— a set, not a single value. This cardinality isforced by the concurrent-resume measurement above: one provider tuple can have several live runs. A
single-valued alias would be silently wrong on exactly that case, so please don't simplify it. It is
pinned by a test named for the behavior.
agent-status-ipc-payload.tsgains optionalrunId/executionId/providerAliasfields.Explicitly out of scope
existing
AgentSubagentSnapshot/subagentObservationshapes are untouched.Verification
pnpm tc— clean (run independently by the coordinator).57 tests across the four new suites, including the collision matrix, deterministic serialization
regardless of insertion order, refusal to serialize an empty alias set, and the duplicate-tuple case.
pnpm run check:code-quality:changed— passed.oxfmt --check— clean.pnpm-lock.yamlunchanged across the branch (merge-base range form).Ablation at the final head: with the five production files reverted, all four suites fail; restored,
57 pass; all-files-reverted arm passes 55.
Honest caveat on that ablation: these are brand-new modules, so reverting them makes the suites
fail to import. That proves the tests exercise the new code, but it is the weakest form of
ablation — there is no prior behavior to ablate against in a types-only change. The real test of
these types is the PR that consumes them.
What a reviewer should look at first
agent-status-ipc-payload.ts. It is the file that actually crosses the client/host boundary, andmixed client/host versions are the normal state. The new fields are optional and old peers ignore
unknown JSON — but "optional field" is only safe while readers genuinely fall back, so that is the
claim worth checking rather than taking.
Second: whether the subject/alias key shapes are the ones you want frozen, since later PRs build on
them.