Repository navigation
Claude Code workers: a late result no longer undoes a turn that was already ended - #54
Merged
Merged
Conversation
…lready ended When a required MCP server did not connect (or Claude Code opened another session), the driver ended the turn as failed. If the turn's result line was read in the same chunk, before the process was gone, it overwrote that with completed. The result now leaves a turn that is being ended as it is. The fake Claude Code can now write the session start and the first reply in one chunk (--fake-init-with-reply), which made this fail every time; it showed up before only now and then, on a busy Linux run with Node 24.
This was referenced Nov 28, 2026
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.
Found while running the local Windows and Linux checks for #52:
a required MCP server that did not connect ends the turnfailed now and then on Linux with Node 24 (2 of 6 full runs), never when run alone.The bug
When a required MCP server did not connect, or Claude Code opened a different session than requested,
ClaudeSessionDriverended the turn as failed and stopped the process. If Claude Code'sresultline was read in the same chunk, before the process was gone,receiveResultoverwrote the outcome withcompleted. Real Claude Code takes seconds before its first answer, so this was unlikely in a fleet, but possible. A worker could then report a completed turn without its board or another required server.The fix
receiveResultleaves a turn that is already being ended as it is. Token counts are still recorded.Test
The fake Claude Code can now hold its session start and write it with the first reply in one chunk (
--fake-init-with-reply). With that, the test fails every time without the fix (actual: 'completed') and passes with it.Local checks (Windows and Linux, as in
public-sdk.yml)Commit
4590594, from a cleangit -c core.autocrlf=false archivesnapshot with a cleannpm cieach time. Linux ran in disposablenode:*-bookworm-slimDocker containers as thenodeuser.All four combinations passed.