A background review worker finishes while the main coding-agent session is still running. If the monitor scans for the latest completion marker, it tells the user to return too early.
The fix starts with source classification.
Claude sidechains
Claude records may place workers in subagents files or interleave lines marked isSidechain into the main transcript. The main parser skips sidechain lines. Separate agent transcripts enter normal monitoring only when subagent alerts are enabled.
Tests cover both dangerous orders: a sidechain end_turn after the main assistant starts a tool, and trailing sidechain traffic after the main assistant really finishes.
Codex rollout sources
Codex session metadata distinguishes interactive CLI work from exec, internal activity, and structured subagents. A foreign originator is treated as automation even if another field resembles a worker.
interactive -> normal status
subagent -> opt-in alerts
automation -> no user-turn alert
Classification happens before sessions are reduced to one provider-level state. Otherwise the monitor loses the identity needed to remove a worker's false completion.
I help run Agent Island, where this filter protects local Claude Code and Codex alerts. This draft stays on publication hold pending canonical verification.
Top comments (0)