Repository navigation
fix(test): ACP replay agent writes its status before answering - #100
Closed
Laurin-Notemann wants to merge 2 commits into
Closed
Laurin-Notemann wants to merge 2 commits into
Laurin-Notemann wants to merge 2 commits into
Conversation
The replay agent sent each answer and then rewrote status.json. A test that stops the session as soon as it gets the last answer could read the file while it was still empty, failing with "Unexpected end of JSON input" (AcpRegistryAdapterV2 > switches a mode config option, seen on PR #99). Port upstream's ordering: build the frames, write the status once, then send. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Laurin-Notemann
enabled auto-merge (squash)
October 20, 2026 10:47
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Closing: upstream already has this fix and the next upstream sync brings it in. Listing the replay agent as a seam would take up the last slot in the upstream-seams list, which must stay under 40 files. Until the sync, re-run CI if AcpRegistryAdapterV2's mode-pick test flakes. |
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.
Problem
AcpRegistryAdapterV2 > the agent's own mode picker > switches a mode config option under its own idfailed on PR #99 withFailed to decode ACP replay status for stored-mode-pick/SyntaxError: Unexpected end of JSON input.apps/server/scripts/acp-replay-agent.tssent each inbound frame and then rewrotestatus.jsonwithwriteFileSync, which empties the file and then writes it. The mode-pick tests close the session right after the last answer and read the status file straight away, so the read could land in that gap.Fix
Port upstream's ordering (pingdotgg/t3code main):
flushInboundbuilds the pending frames, writes the status once, then sends them. By the time the client sees the last answer, the status file is complete. Apart from comments, the file now matches upstream's except for one unrelated line.Seam
The replay agent is upstream-owned, so
scripts/otterware/upstream-seams.txtnow lists it. This is a port of upstream's own fix, so the next sync resolves it to upstream's version.Validation
vp run check:changedpasses.AcpRegistryAdapterV2.test.tspasses, and its two mode-pick tests passed 10 runs in a row.OrchestratorReplayFixtures.integration.test.ts > claude_result_is_errorfails locally both with and without this change, because the dev machine setsCLAUDE_CONFIG_DIRand that adds a clause to the expected message. CI passes it.Claude Opus 5.5 via Claude Code (T3 Code)
🤖 Generated with Claude Code