Skip to content

test(agent): wait for cancel acknowledgement - #5003

Open
kiranmagic7 wants to merge 1 commit into
block:mainfrom
kiranmagic7:fix/cancel-ack-test-race
Open

test(agent): wait for cancel acknowledgement#5003
kiranmagic7 wants to merge 1 commit into
block:mainfrom
kiranmagic7:fix/cancel-ack-test-race

Conversation

@kiranmagic7

Copy link
Copy Markdown
Contributor

Summary

Wait for the session/cancel acknowledgement before releasing the gated round-two LLM response, then include frames received before that acknowledgement in the existing ordering assertions.

Writing the cancel request to stdin did not prove the agent had processed it. The test could therefore release the deliberate error response first and observe a null stopReason instead of cancelled.

Related issue

Fixes #4945. No duplicate issue or PR was found in the current open or historical searches.

Testing

  • Unmodified main: the affected test failed in 16 of 100 full fake_llm suite runs.
  • Patched: the affected test failed in 0 of 100 full-suite runs. The entire suite passed in 82 runs; the other 18 failed only in unrelated pre-existing steering tests.
  • bin/cargo test -p buzz-agent --test fake_llm cancelled_turn_with_usage_emits_notification_before_response -- --exact
  • bin/cargo test -p buzz-agent
  • bin/just ci
  • Screenshots: N/A (test-only change).

Signed-off-by: kiranmagic7 <262980978+kiranmagic7@users.noreply.github.com>
@kiranmagic7
kiranmagic7 requested a review from a team as a code owner August 6, 2026 03:34

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for this!

@wesbillman
wesbillman enabled auto-merge (squash) August 6, 2026 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Intermittent test panic in cancelled_turn_with_usage_emits_notification_before_response

2 participants