Repository navigation
fix(agent-status): settle killed Claude background helpers - #35930
Conversation
[Medium impact] The change affects Claude status reporting on desktop and WSL guest execution hosts. The PR should not merge while an unfinished transcript record can cause a live helper to disappear. FindingsSummaryThe PR reads Claude’s transcript evidence on the execution host to settle killed background helpers through existing status updates.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
Actionable comments posted: 2

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
2a7b7479-5436-4bce-8461-2c3a34f5796e
Files selected for processing: 10-
src/main/agent-hooks/claude-helper-scheduler-coexistence.test.tssrc/main/agent-hooks/server-claude-helper-kill.test.tssrc/main/agent-hooks/server/server-status-retries.tssrc/shared/__fixtures__/claude-helper-kill-2.1.310.jsonsrc/shared/agent-hook-listener/providers/claude-helper-kill-poller.tssrc/shared/agent-hook-listener/providers/claude-helper-kill.test.tssrc/shared/agent-hook-listener/providers/claude-helper-transcript-evidence.tssrc/shared/agent-hook-listener/providers/claude-transcript-cursor.tssrc/shared/claude-owed-task-notifications.tssrc/wsl-guest/agent-hook-result-retry-scheduler.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
-
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Keep the stored env and version when the… · agent-hook-result-retry-scheduler.ts:57-59
src/wsl-guest/agent-hook-result-retry-scheduler.ts:57-59
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winKeep the stored
envandversionwhen the helper-kill poller publishes.The poller's
publishcallshost.applyEvent(event, 'claude')withoutenvorversion.applyRelayHookEventthen replaces the pane's metadata entry with{ source, env: undefined, version: undefined, claudeSettledRequests }. The expiry, transcript-poll, and assistant-message publishes passenvandversion, so this publish is the only one that clears them.After a helper kill settles, two outputs lose the values:
- the forwarded envelope built by
buildRelayHookEnvelope;- every later cached replay, because
buildCachedPaneReplayEnvelopereadsmeta.envandmeta.version.Desktop ingest passes
envelope.versionandenvelope.envtowarnOnHookEnvOrVersionMismatch. The body of that function was not inspected, so the effect of the cleared values there is not established.Pass the stored metadata through the publish. Add an optional lookup to the host type and supply it from the relay server:
Proposed fix (host lookup)
export type AgentHookResultRetryHost = { state: HookListenerState env: string isListening: () => boolean + getEnvelopeMeta?: (paneKey: string) => { env?: string; version?: string } | undefined applyEvent: ( @@ publish: (event) => { - host.applyEvent(event, 'claude') + const meta = host.getEnvelopeMeta?.(event.paneKey) + host.applyEvent(event, 'claude', meta?.env, meta?.version) },In
RelayAgentHookServer, addgetEnvelopeMeta: (paneKey) => this.lastEnvelopeMetaByPaneKey.get(paneKey)to the retry host object.

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
58855f72-c8bd-411b-9518-760d09536ace
Files selected for processing: 12-
src/main/agent-hooks/claude-helper-scheduler-coexistence.test.tssrc/main/agent-hooks/server-claude-helper-recovery.test.tssrc/main/agent-hooks/server/server-ingest-normalization.tssrc/main/agent-hooks/server/server-lifecycle.tssrc/main/agent-hooks/server/server-status-hook-lifecycle.tssrc/main/agent-hooks/server/server-status-retries.tssrc/shared/agent-hook-listener/providers/claude-helper-kill-poller.tssrc/wsl-guest/agent-hook-event-admission.tssrc/wsl-guest/agent-hook-request.tssrc/wsl-guest/agent-hook-result-retry-scheduler.tssrc/wsl-guest/agent-hook-server.tssrc/wsl-guest/agent-hook-spool-ingest.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
-
|
Review status: complete — six rounds, scoped real-provider QA and current-head CI verified. Claude can kill a background helper without sending a hook, leaving Orca showing Working. This patch derives helper settlement from Claude’s lifecycle evidence on the execution host, through the existing status store, while preserving parent results, independent shells and unrelated waits. Six behavioral rounds ended with the final three-seat DESIGN-READY / KEEP ruling and C9 repaired at production head Implementation validation passed 73 distinct tests across seven named files; independent repair review passed 16 overlapping checkpoint tests. The later test-only commit Real final-production SSH QA with Claude 2.1.314 and Codex 0.165.0 verified:
Retained Windows/WSL QA covers unchanged platform flows: genuine guest/native helper kills, root/shell preservation, follow-ups, graceful upgrade and distinct stop-all. Stop-all required a temporary Settings shortcut correction in the disposable profile, restored afterward; no default-shortcut fix is claimed. Earlier Windows runs do not independently validate the final decoder. Baseline also settled helpers, so the reported stale-helper symptom was not reproduced. Not exercised: real failed-hook R<K<S was unreachable through the tested supported route: normal quit removes supported terminal input, and the bounded real TaskStop probe emitted no SSH parent status can remain Working after a reply: pre-existing on main; tracked in STA-13015. Branch host settlement and actual killed-helper removal were verified; this does not pass the separate parent-display gap. Finite-backlog latency, fixed aggregate heap, infinite-writer completion and naturally persistent failure recovery are not claimed. QA evidence: private report For Brennan’s review Previous-build reply, carried through graceful upgrade and normal resume: Final branch: helper Working, then killed with shell and parent preserved: Independent shared-provider work and reconnect while the helper remained live: Retained native Windows kill and distinct stop-all evidence, scoped to unchanged platform flows: Retained WSL baseline and branch helper settlement (the baseline also settled): Human judgment spots: complete-record validation and acknowledgement, semantic completion, exact helper settlement and publication. QA’d production head: |










Problem and result
Claude can kill a background helper without sending a hook, leaving Orca showing Working. Orca now reads Claude’s own lifecycle evidence on the execution host and settles that helper through the existing status store. Surviving shells, parent results and unrelated waits remain intact.
Tracked in STA-10196.
Implementation
The passive observer reads transcripts asynchronously in bounded forward chunks. One semantic decoder validates complete records before applying lifecycle facts and retains validated records and prepared operation progress until acknowledgement. Genuine generation evidence protects newer work from older kill records. Missing or unreadable evidence never proves death.
Observation follows admitted runtime hooks and starts when the existing host is ready. Valid recovered hooks retain their original admission boundary; status snapshots alone do not recreate observation. Native Windows failed HTTP deliveries have no saved-hook spool, unchanged by this PR. Independent provider scheduler instances prevent another provider from evicting Claude observations. Retirement releases observation and scheduler resources.
There are no new saved or wire fields, settings, reader caches or reader precedence. Desktop integration is additive in the existing retries seam;
server-claude-status-rules.tsis unchanged. The common pattern derives provider-owned work from provider lifecycle evidence. Intended differences preserve user-typed commands and aliases, independently updated hosts and guest-only file access; updated hosts publish the existing status event shape.Verification
Full path: lifecycle, ownership, recovery, ordering and cross-host publication. Six behavioral rounds ended with a three-seat DESIGN-READY / KEEP decision and the final decoder/checkpoint repair accepted at production head
4b7d728dbf3bf853f87fe578cf47d768b213ba96. The panel explicitly settled the test-growth tripwire. Final independent source, whole-mechanism reference and performance audits found no new proven defect. Optional test consolidation and diagnostic improvements remain deferred.9ee31b446cc19805ade25a3f80a070177688b6a7repairs two CI test-code errors. Its 21 targeted tests passed, and independent verification confirmed unchanged production and test behavior. Current-head CI completed with 51 checks passed and 13 skipped. Skipped e2e and real-WSL jobs are not app evidence. Main was synced once before final QA.Not exercised: real failed-hook ordering R<K<S could not be reached through the tested supported controls. Normal quit removes the supported input route, and the bounded real TaskStop probe emitted no
agents_killedrecord; no failed-hook recovery pass is claimed. Deterministic recovery/order tests remain the evidence for that branch. Same-ID helper continuation was refused by the real provider and is separately not exercisable. Neither case used fabricated live records.SSH parent status can remain Working after a reply: pre-existing on main; tracked in STA-13015. Branch host settlement was verified; the actual killed-helper removal reached the client. No pass is claimed for that separate parent-display gap. Baseline also settled helpers, so QA did not reproduce the original stale-helper symptom.
N/10N contracts measure decoder/admission/cleanup work and retained dimensions, without claiming fixed total heap, five-second backlog catch-up, infinite-writer completion or naturally persistent failure recovery. The existing notification wakeup held final shared aggregate status for about 60 seconds before both providers settled. QA deviations and cleanup are recorded in the private evidence reports.
Visual proof
The loop’s single status comment contains baseline and branch captures for upgrade, helper settlement, shared status, reconnect and retained Windows flows. The change uses existing status UI and adds no visible control or message.
Agent skill upstream boundary