Repository navigation
refactor(agent): a watch asks the API what became of its input (DEP-8992) - #715
robstolarz wants to merge 6 commits into
Conversation
…992) watch --after-input, create --watch and send --watch read the outcome of the awaited input from GetSessionInput and take the reply from the message that read names, instead of working both out from the messages in the session view. The turn state machine now only serves --until-idle. - The reply comes from the frame when the frame holds it whole, and is read by id otherwise; a failed read falls back to the frame's text. - A message that is not the assistant's, or that calls a tool, is not reported as the reply. - A session at rest while the input still reads as placed is read again, up to three times a grace period apart. - A refused read is reported under the RPC that was refused. Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RQk3K7GpvQg7ySXyCrirEe
…EP-8992) - A reply read by id is printed after its role is checked, and the status line is repeated after a reply printed late. - A session at rest whose input still reads as placed after every look ends the watch as a run without a reply. Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RQk3K7GpvQg7ySXyCrirEe
…n as ended (DEP-8992) Each extra look at an input a resting session still holds first reads the session again. A session back at work, or a view that shows work under way, is left to its later frames. Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RQk3K7GpvQg7ySXyCrirEe
There was a problem hiding this comment.
Stale comment
[!NOTE]
🤖 Cursor Grok 4.6 responding on behalf of Jacob GillespieRisk: medium. Not approved; Cursor Bugbot reported one unresolved potential issue that needs human review. Human review is needed and no reviewers were assigned.
Sent by Cursor Approval Agent: Pull Request Router and Approver
Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RQk3K7GpvQg7ySXyCrirEe
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a15bb37. Configure here.
… failed (DEP-8992) Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RQk3K7GpvQg7ySXyCrirEe
There was a problem hiding this comment.
Stale comment
[!NOTE]
🤖 Cursor Grok 4.6 responding on behalf of Jacob GillespieRisk: medium. Not approved; Cursor Bugbot reported one unresolved potential issue that needs human review. Human review is needed and no reviewers were assigned.
Sent by Cursor Approval Agent: Pull Request Router and Approver
…992) Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RQk3K7GpvQg7ySXyCrirEe



A sketch, built to test a theory. Not to be merged or released until the API side is live. Replaces #714: the same change as one commit, plus review fixes.
depot agent watch --after-input,create --watchandsend --watchworked out whether an input had its reply from the messages in the session view: a state machine with grace timers that followed the turn by position. They now ask the API, which answers from the session's stored record of the input (GetSessionInput):unansweredthere, and the watch exits 1 with the reason. The watch also checks the role and tool calls itself.Change for scripts: cases that exited 1 with "the session moved past the input before its reply was seen" now keep waiting, and exit 2 if
--timeoutruns out.--until-idlealone keeps what is left of the state machine. Hand-written source: +227 / −223; tests: +180 / −331. This makes #700 (DEP-8781) unnecessary; it can be closed with a pointer here when this lands.Post-deploy test plan
Once the API serves
GetSessionInput, with a binary built from this branch:depot agent create "..." --watch: exit 0 with the reply.depot agent send <session> "<ask for a reply of several thousand words>" --watch -o json: exit 0, andreplyholds the whole text, not the view's cut of it.depot agent stop <session>: exit 1, "the turn was stopped before the agent replied".Notes
watch --until-idle(which does not use the new read) exits 0 with the reply.🤖 Generated with Claude Code
https://claude.ai/code/session_01RQk3K7GpvQg7ySXyCrirEe
Note
High Risk
Changes core watch/create/send behavior, exit codes, and API coupling for automation; depends on server
GetSessionInputbeing deployed before release.Overview
depot agent watch --after-input,create --watch, andsend --watchno longer infer whether an input finished from the bounded session view. They call the newGetSessionInputRPC and treat its stored outcome as source of truth: keep waiting on pending/placed, exit 0 with the named answer message on answered (via frame text orGetSessionMessagewhen truncated), and exit 1 with structured messages on unanswered / withdrawn or when the answer is not a real assistant reply.The large view-position turn state machine (base seq, pickup polling, “input lost from cut view”) is removed along with pre-watch
GetSessionnewestSeq/basewiring.--until-idlestill ends from view heuristics only. Renderer gainsReplyandSaidso replies still print when the input scrolled out of the view. Proto and Connect stubs addGetSessionInput; tests are rewritten around mocked input outcomes.Script-visible change: failures like “the session moved past the input before its reply was seen” become continued waiting until
--timeout(exit 2). Requires a live API that implementsGetSessionInput.Reviewed by Cursor Bugbot for commit cef3b90. Bugbot is set up for automated code reviews on this repo. Configure here.