Skip to content

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

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

test(agent): wait for cancel acknowledgement#5003
kiranmagic7 wants to merge 2 commits 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
@kiranmagic7

kiranmagic7 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! I tracked the real failure to a scroll race that was fixed on main after this run. I’ve brought the branch up to date, and both affected scenarios passed 20 times each locally. The full just ci suite passes too. GitHub is now waiting for fork workflow approval before it can start the fresh run.

Signed-off-by: kiranmagic7 <262980978+kiranmagic7@users.noreply.github.com>
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