Handle empty session fork behavior in E2E tests#1247
Conversation
Allow the empty-session fork tests to accept either the older runtime error or a successful empty fork, and apply the expectation across C#, Node, Python, and Go. Also mark the C# test project explicitly as a test project so dotnet test discovers the xUnit tests with newer SDKs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates multi-language E2E coverage to tolerate the runtime’s new “empty session fork” behavior (either the historical error or a successful empty fork), while still validating that sessions.fork is implemented and produces a sensible result when it succeeds.
Changes:
- Adjusts empty-session fork E2E tests (Python/Node/Go/.NET) to accept either an expected “no persisted events” failure or a successful empty fork.
- Adds assertions for the success case: fork session ID is non-empty/distinct, and the forked session has no conversation messages.
- Marks the .NET test project as a test project (
IsTestProject=true) to improvedotnet testdiscovery.
Show a summary per file
| File | Description |
|---|---|
| python/e2e/test_rpc_session_state_e2e.py | Accepts either error or successful empty fork; validates empty conversation on success. |
| nodejs/test/e2e/rpc_session_state.e2e.test.ts | Accepts either error or successful empty fork; resumes fork to validate empty conversation on success. |
| go/internal/e2e/rpc_session_state_e2e_test.go | Accepts either error or successful empty fork; validates non-empty new session ID and empty conversation on success. |
| dotnet/test/GitHub.Copilot.SDK.Test.csproj | Sets IsTestProject=true for improved xUnit discovery via dotnet test. |
| dotnet/test/E2E/RpcSessionStateE2ETests.cs | Accepts either error or successful empty fork; validates new session ID and empty conversation on success. |
Copilot's findings
- Files reviewed: 5/5 changed files
- Comments generated: 0
Cross-SDK Consistency Review ✅This PR updates the empty-session fork E2E test across all four SDK implementations (Node.js, Python, Go, .NET) with consistent behavior. All four SDKs equivalently:
No cross-language inconsistencies were found. Language-idiomatic differences (Go's
|
Runtime behavior changed so forking a newly-created session with no persisted conversation can either fail with the older "no persisted events" error or return a successful empty fork. The SDK E2E tests should accept both behaviors while still confirming that
sessions.forkis implemented and produces a sensible fork when it succeeds.Changes
IsTestProject=truesodotnet testdiscovers and runs the xUnit tests with the installed SDK.Validation
COPILOT_CLI_PATH=D:\repos\copilot-agent-runtime\dist-cli\index.js: targeted C#, Node, Python, and Go empty-session fork tests passed.