Repository navigation
fix(acp): pair replay agent responses to concurrent requests in order - #42660
juliusmarminge merged 2 commits into
Conversation
the replay agent paired response frames to client requests by method name in a single slot, so a second concurrent request of the same method overwrote the first and responses mis-paired or failed to pair at all. a prompt steer is exactly that shape: a second session/prompt while the first still runs, which no replay fixture could express. responses now pair first-in-first-out per method. the regression test steers an active turn through the generic adapter and asserts the turn ends completed: mis-pairing the first response onto the steer settles it as cancelled instead, so the test fails when pairing is wrong.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EvidenceRan the actual replay-agent command on Linux, Node v26.13.1, using identical fresh synthetic transcripts. Sent prompt id 3, then steer id 4 after 500 ms; replayed cancelled, message chunk, then end_turn.
The visuals render timestamped subprocess output, not app-screen recordings. Base stops at 4/5 entries with exit 1; head completes 5/5 with exit 0. Driver, transcript, before raw capture, after raw capture, capture renderer. Evidence uploaded using the ghdrop skill. Not shown:
|


Requested in #42647 (comment) as a provider-neutral PR.
Summary
The ACP replay agent pairs response frames to pending client requests by method name, keeping one slot per method. When two requests of the same method are open at once, the second overwrites the first in that slot, so the first emitted response pairs with the wrong request and the second finds no pending request at all.
This shape is not exotic: steering a turn by prompt is a second
session/promptwhile the first still runs, which is how prompt-steering agents carry a turn over several prompts. No replay fixture could express it, so steering behavior cannot be covered through the replay harness today.Responses now pair first-in-first-out per method, matching how agents answer prompts in order. Test-infra-only change; no production code and no provider-specific behavior involved.
How it was checked
The regression test drives the generic adapter through a replay fixture: a turn is steered mid-prompt, then two
session/promptresponses arrive. In request order the first response (cancelled) settles the original, already-superseded prompt and the second (end_turn) settles the steer, ending the turn completed. If pairing is wrong thecancelledresponse lands on the steer instead and the turn dies with it, so the test observes pairing directly.Without the fix:
With the fix the test passes, along with the full
AcpAdapterV2.test.tssuite (162 tests) andvp run check:changed(format, lint, knip, typecheck, tests).Test plan
vp run check:changedclean