fix: extend the watchdog for transcript-observed subagents - #395
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third of the agent-state detection faults found on ub1. The first two shipped in #389.
Problem
A Claude pane whose subagents are only visible in the transcript (no hook
authority, no closing report) fell back to the 20-minute parent budget
AGENT_BUSY_STALE_SILENCE. So the parent flipped tosupervisor_stalewhileits subagent was still writing to
agent-*.jsonl, and the sidebar dropped itback to
done.Change
agent_status_watchdog_deadline_with_activity()now grants the longDEFAULT_SUBAGENT_STALE_SILENCEbudget when the pane holds live subagents andthe transcript witness is
Fresh, independent of hook authority. The clockanchors on the later of the witness time and pane activity, so fresh evidence
extends the budget but never rewinds it.
StaleandUnknowntranscripts keep the ordinary budget unchanged.Verification
cargo nextest run -E 'test(/detect::manifest|terminal::state/)'— 275 passedon the merged head. Three new tests cover the fresh, stale, and
never-rewind cases; no existing expectation was modified.
refs #389
https://claude.ai/code/session_01VWN7qDGntr6KuwPKn8Fi5g