Expand description
Did this subagent actually finish, or was it cut off?
SubAgentStatus::Abandoned is — as its own doc comment says — “always an
inference, never an observation”. Until this module existed, the inference
was “the subagent transcript has no terminal Result line, therefore it was
interrupted” (scan.rs::reconcile_stale_subagents). That premise does not
hold: no AgentMux transcript contains a "type":"result" line at all —
not the subagent sidechain files, not the parent session file. The line type
the old check waited for is absent from the format this deployment writes
(entrypoint: sdk-cli), so SubAgentStatus::Completed was unreachable and
every Agent-tool dispatch ended up displayed as “interrupted”, including the
ones that returned full results the parent went on to use.
Evidence and the full chain:
docs/reports/REPORT_SUBAGENT_COMPLETION_NEVER_DETECTED_2026_09_05.md.
The replacement uses the strongest evidence available, and it is an
observation rather than an inference: the parent’s own tool_result for
the dispatch’s tool_use_id. If the parent recorded a result, the subagent
demonstrably returned — whatever its transcript does or doesn’t end with.
The correlation key is already on disk: Claude Code writes an
agent-<id>.meta.json sidecar next to each subagent transcript carrying the
parent-side toolUseId.
Deliberately kept free of watcher state so the decision is unit-testable on
its own — the same reasoning that split parse.rs out.