Update SDK E2E tests for canonical exit_plan_mode action order#2023
Conversation
The runtime now canonicalizes the exit_plan_mode action menu to [autopilot, interactive, exit_only] regardless of the order the model passes in the tool call. Update the mode_handlers E2E assertions in all five SDK suites (C#, Go, Node, Python, Rust) to expect the canonical order so the shared snapshot test passes against the current runtime. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9e36340e-3d37-46ed-ac6f-3989fea57dc7
There was a problem hiding this comment.
Pull request overview
Updates all SDK E2E suites to expect the runtime’s canonical exit_plan_mode action order.
Changes:
- Changes expected order to
[autopilot, interactive, exit_only]. - Keeps the recommended action and raw snapshot unchanged.
- Aligns Rust request and event assertions.
Show a summary per file
| File | Description |
|---|---|
dotnet/test/E2E/ModeHandlersE2ETests.cs |
Updates .NET assertion. |
go/internal/e2e/mode_handlers_e2e_test.go |
Updates Go assertion. |
nodejs/test/e2e/mode_handlers.e2e.test.ts |
Updates Node.js assertion. |
python/e2e/test_mode_handlers_e2e.py |
Updates Python assertion. |
rust/tests/e2e/mode_handlers.rs |
Updates Rust request and event assertions. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Medium
This comment has been minimized.
This comment has been minimized.
The E2E tests were updated to expect the canonical action order [autopilot, interactive, exit_only], but the replay snapshot still supplied [interactive, autopilot, exit_only] as the model's exit_plan_mode tool-call arguments, which the CLI forwards verbatim to the SDK handler. Align the snapshot with the tests so request.actions matches across all language SDKs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 446b10a1-29f6-4155-bf3a-ac1241c742f3
Cross-SDK Consistency ReviewThis PR updates E2E tests in Node.js, Go, Python, .NET, and Rust to assert the canonical 1. Test is still
|
Why
The
Copilot SDK C# testsCI leg incopilot-agent-runtime(e.g. PR #12568, which ports runtime boundaries to Rust) is failing onModeHandlersE2ETests.Should_Invoke_Exit_Plan_Mode_Handler_When_Model_Uses_Tool:The runtime's new Rust
exit_plan_modeimplementation canonicalizes the action menu to a fixed order ([autopilot, interactive, exit_only]) and no longer preserves the order the model happens to pass in its tool call. The runtime's own unit tests and snapshots already expect the canonical order, so the SDK E2E assertions were the stale outliers.What changed
Updated the
mode_handlersE2E action-order assertion to expect[autopilot, interactive, exit_only]in all five SDK suites, since they all assert against the same shared snapshot and were failing identically:dotnet/test/E2E/ModeHandlersE2ETests.csgo/internal/e2e/mode_handlers_e2e_test.gonodejs/test/e2e/mode_handlers.e2e.test.tspython/e2e/test_mode_handlers_e2e.pyrust/tests/e2e/mode_handlers.rs(both therequest.actionsandrequested_data.actionschecks)Notes
recommendedActionis still"interactive"(that value is honored by the runtime), so those assertions are unchanged.test/snapshots/mode_handlers/should_invoke_exit_plan_mode_handler_when_model_uses_tool.yamlis intentionally left as-is: it records the model's raw tool call, and the runtime no longer uses that array's order.McpOAuthE2ETests.Should_Cancel_Pending_MCP_OAuth_Request) is a runtime-side event-routing regression and is out of scope here.Generated by Copilot