test(agent): wait for cancel ack before releasing the gated round-2 response - #5293
Open
Chessing234 wants to merge 1 commit into
Open
test(agent): wait for cancel ack before releasing the gated round-2 response#5293Chessing234 wants to merge 1 commit into
Chessing234 wants to merge 1 commit into
Conversation
…esponse cancelled_turn_with_usage_emits_notification_before_response failed 1-4 of 20 runs. h.send(session/cancel) only writes the request to stdin; it does not prove the agent processed it. Releasing the round-2 HTTP gate immediately afterward let the gated response resolve before the cancel was handled, so the prompt could return a race-driven error stopReason instead of cancelled. Drain frames until the cancel acknowledgement (collecting any usage frames that arrive first) before releasing the gate, so stopReason: cancelled is deterministic and the usage-before-response ordering still holds. Closes block#4945 Signed-off-by: Taksh <takshkothari09@gmail.com>
Chessing234
force-pushed
the
fix/cancelled-turn-usage-flaky-4945
branch
from
August 8, 2026 14:02
706a659 to
5ceab12
Compare
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.
cancelled_turn_with_usage_emits_notification_before_response failed 1-4 of 20
runs. h.send(session/cancel) only writes the request to stdin; it does not prove
the agent processed it. Releasing the round-2 HTTP gate immediately afterward
let the gated response resolve before the cancel was handled, so the prompt
could return a race-driven error stopReason instead of cancelled.
Drain frames until the cancel acknowledgement (collecting any usage frames that
arrive first) before releasing the gate, so stopReason: cancelled is
deterministic and the usage-before-response ordering still holds.
Closes #4945