Files
orca/src/shared
cbd24b2872 fix(agent-status): drop Claude teammates stopped with TaskStop from the sidebar (#32048)
* fix(agent-status): drop Claude teammates stopped with TaskStop from the sidebar

Named background agents run as in-process teammates. TaskStop fires no
lifecycle hook, and their background_tasks entries use ids unrelated to the
lifecycle agent_id, so an idle teammate row was kept as long as any teammate
task remained listed, even after that teammate was stopped.

Remember the description of the lead's Agent call that spawned each teammate
(Claude lists the teammate's background_tasks entry under it), and at a lead
Stop with a complete inventory drop a teammate row whose description is no
longer listed. Rows without that evidence keep the previous behavior.

Fixes #31818

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(agent-status): keep a teammate's spawn description when its spawn result lands first

Hook requests are handled unordered, so the lead's Agent PostToolUse can
arrive before the teammate's SubagentStart. Create the row as idle in that
case so the description is kept; SubagentStart then revives it to working,
and an idle row never gates the pane if the teammate's stop came first.

Moves the spawn recorder into claude-teammate-spawn.ts to keep
claude-events.ts within the file length limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(agent-status): retain teammates with clipped task descriptions

Claude caps background task descriptions and appends a clipping marker. Match that visible prefix conservatively when reconciling a teammate's full spawn description, so an inventory update cannot hide a live teammate. Keep ambiguous descriptions and unknown inventories safe, with coverage through the production hook normalizer.

* fix(agent-status): escape clipping marker in daemon bundle

* fix(agent-status): retire stopped teammates only when the inventory is fully attributable

Claude registers a teammate task under the whitespace-collapsed spawn description, so
compare normalized descriptions. Infer a stop from absence only when every listed
teammate matches a recorded spawn; unknown or differently formatted entries keep rows.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Neil <neil@stably.ai>
2026-10-24 00:33:46 -07:00
..
…
…