Skip to content

eval: fix flaky deploy tests - #3071

Merged
JasonYeMSFT (JasonYeMSFT) merged 3 commits into
microsoft:mainfrom
JasonYeMSFT:chuye/fix-flaky-deploy-tests
Aug 14, 2026
Merged

eval: fix flaky deploy tests#3071
JasonYeMSFT (JasonYeMSFT) merged 3 commits into
microsoft:mainfrom
JasonYeMSFT:chuye/fix-flaky-deploy-tests

Conversation

@JasonYeMSFT

@JasonYeMSFT JasonYeMSFT (JasonYeMSFT) commented Aug 14, 2026

Copy link
Copy Markdown
Member

Description

This PR addressses two issues revealed by the integration tests.

  1. Some test runs exceed the 80 max turn without entering loop. I bumped all the max turns to 100 to see if they can consistently finish.
  2. There is an inconsistency in how we handle agent response events. See explanation below.

Copilot CLI emits 3 kinds of events for assistant responses meant for the user: assistant.message_start, assistant.message_delta, assistant.message. assistant.message_start indicates the beginning of one response. assistant.message_delta events contain partial pieces of the message associated with the same messageId. assistant.message event contains the full message concatenating all the pieces from the assistant.message_delta events indicating the response is completed. The early terminate code terminates the agent session when the received assistant.message_delta events show that a certain pattern is matched before receiving the actual assistant.message event. However, the code that reconstructs the agent output for vally grader only look at assistant.message events. This causes some graders to fail because it doesn't see the agent response that caused the runner to terminate the session.

Although Copilot SDK had defined the event type assistant.message_delta for quite a while, our test runs never actually saw those events in the past. They had been getting only assistant.message events with full responses. After the upgrade on Aug 13th, Copilot SDK starts emitting assistant.message_delta events and triggers the bug.

Checklist

  • Tests pass locally (cd tests && npm test)
  • Title has one of the prefixes: fix:, feat:, feature:, chore:, misc:, test:, eval:
  • If modifying skill descriptions: verified routing correctness with integration tests (In tests/, npm run test:integration -- <skill> or npm run test:vally -- --skill <skill>)

Related Issues

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to reduce flakiness in Azure deploy eval/integration runs by increasing allowed conversation turns and adjusting how assistant output is reconstructed from emitted events.

Changes:

  • Increased max_turns from 80 → 100 across azure-deploy deployment eval stimuli.
  • Removed assistant.message_delta handling from assistant-message reconstruction helpers.
  • Removed assistant.message_delta handling from markdown report generation in the agent runner.
Show a summary per file
File Description
tests/utils/evaluate.ts Updates assistant message aggregation used by graders/conditions.
tests/utils/agent-runner.ts Updates markdown reporting and keyword checks over assistant output.
evals/azure-skills/azure-deploy/deploy-eval.yaml Bumps max-turn constraints for deploy eval stimuli to reduce timeouts.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Suppressed comments (1)

tests/utils/agent-runner.ts:1274

  • This function claims to "merge all messages and message deltas", but it now only considers assistant.message. If the session ends after matching an early-termination pattern (before the final assistant.message event), keyword checks can miss the assistant output entirely. Re-introduce delta accumulation (while ignoring deltas after the final message arrives) so keyword checks are consistent with streaming behavior.
  const allMessages: Record<string, string> = {};

  agentMetadata.events.forEach(event => {
    if (event.type === "assistant.message" && event.data.messageId && event.data.content) {
      allMessages[event.data.messageId] = event.data.content;
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread tests/utils/agent-runner.ts
Comment thread tests/utils/evaluate.ts
@JasonYeMSFT
JasonYeMSFT (JasonYeMSFT) merged commit a3d0496 into microsoft:main Aug 14, 2026
12 checks passed
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.

3 participants