Make abort E2E snapshots tolerate timing variants#1808
Merged
Conversation
Add cassette alternatives for valid abort histories where an in-flight tool result is interrupted and where streaming abort retains only the original user prompt before recovery. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the replay-proxy YAML cassettes used by the .NET E2E abort tests to accept multiple valid request histories that differ based on when AbortAsync takes effect. This keeps the tests focused on the public contract (abort completes and the session remains usable) while removing timing-dependent brittleness in the recorded histories.
Changes:
- Add an alternative
should_abort_a_sessionconversation where both tool calls are recorded as interrupted (instead of “missing tool” + interrupted). - Add an alternative
should_abort_during_active_streamingconversation where the original long user prompt is retained but the aborted assistant response is dropped before the recovery prompt.
Show a summary per file
| File | Description |
|---|---|
| test/snapshots/session/should_abort_a_session.yaml | Adds an additional valid abort-timing variant where both tool calls are interrupted. |
| test/snapshots/abort/should_abort_during_active_streaming.yaml | Adds a streaming-abort variant where the initial user prompt remains in history but the aborted assistant message is absent. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Low
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.
Abort E2E tests can produce different valid request histories depending on when
AbortAsynclands. Runtime PR investigations saw C# replay mismatches where an in-flight tool result was interrupted instead of recorded as a missing tool, and where streaming abort retained the original user prompt while dropping the aborted assistant response.This updates the affected replay snapshots with those legal alternatives. No production code changes are included: the tests still cover the public contract that abort completes and the session remains usable, while the cassettes stop requiring a single timing-dependent history.
Validation:
GITHUB_ACTIONS=true dotnet test dotnet\test\GitHub.Copilot.SDK.Test.csproj --filter "FullyQualifiedName=GitHub.Copilot.Test.E2E.SessionE2ETests.Should_Abort_A_Session|FullyQualifiedName~GitHub.Copilot.Test.E2E.AbortE2ETests"git diff --check