Repository navigation
[FD-6444] fix(agents): Claude Code's reply keeps every answer across background-task wakes - #846
Draft
earakely-scale wants to merge 2 commits into
Draft
earakely-scale wants to merge 2 commits into
earakely-scale wants to merge 2 commits into
Conversation
…-task wakes The CLI wakes the model again when a background task it started finishes, and ends each wake with a `result`, so one turn can emit several: an answer then a remark on the finished task, or a holding note then the answer. The bridge replied with the last one, which dropped the answer in the first case. The reply now joins each successful result's text in order, leaving out error results and a text repeating the one before; a turn with no other text replies with its last result's, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ackground command Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Why
Claude Code wakes the model again when a background task it started finishes, and ends each wake with a
result. One turn can therefore emit severalresultevents:The bridge replied with the last
result. In the first case the answer was lost, so verifiers graded the remark (FD-6444).What changes
The reply joins the text of every successful
resultin order, separated by a blank line.result's text, as before (a failed turn's error).Evidence so far
claude-code-cliturns. 2.6% emit more than oneresult. In about 17 of those 39 the answer is the lastresult, and in about 13 it's the first. So neither "first" nor "last" is right.tst/util/fake_anthropic: tworesultevents, the second markedorigin.kind == "task-notification".test_claude_bridge_reply.py. 4 of its 9 tests fail onmain; the other 5 pin unchanged behaviour.E2E and chaos with real models are in progress.
🤖 Generated with Claude Code