Repository navigation
fix(agent-runs): ignore user turns that ended without output - #826
Merged
Merged
Conversation
A reply the run refused at admission (for example a macro pinned to another provider) ends failed before any output. The supervisor counted that turn as a user reply, started a continue-after-user turn and wrote the stage prompt into the transcript again. Turns whose terminal receipt says failed with no output are now skipped when the run reads the lead task's turns, so they neither continue the stage, resume a wait nor count as a reply. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
astyfx
requested review from
heath-s and
schang124
and removed request for
a team
October 25, 2026 12:33
astyfx
enabled auto-merge (squash)
October 25, 2026 12:34
Merged
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.
Summary
A reply the Agent run refused before it ran (for example a macro pinned to Codex sent into a Claude run) no longer makes the run continue its stage and write the original stage prompt into the transcript a second time.
Changes
Fixes
continue-after-userturn, resume an expired wait, or count as a user reply. The check reads the turn's terminal receipt, which is written in the same transaction ascompleted_at, so it holds across a restart. Turns the run itself linked keep their existing retry and nudge handling.Test Evidence
tests/agent-run-runtime.test.ts: a Claude run blocks its stage, a Codex reply is refused with "keeps the provider it started on" and ends failed with no output. The run starts no new turn, records nouser-turnand stays blocked, also after a restart. A user turn that ran with output still continues the stage. Without the fix the test fails with two run turns instead of one, which is the reported incident.bun test tests/agent-run-runtime.test.ts tests/agent-run-policy.test.ts tests/agent-run-event-wait.test.ts tests/delegated-agent-run.test.ts tests/agent-run-briefing.test.ts tests/agent-run-renderer-stores.test.ts: 262 pass, 0 failbun run typecheck: passoxlint --report-unused-disable-directives src electron server scripts: pass (existing warnings only)bun run build:pages: passNotes
🤖 Generated with Claude Code