Skip to content

Commit b959952

Browse files
TestUserCopilot
andcommitted
Update SDK E2E tests for canonical exit_plan_mode action order
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
1 parent a1334be commit b959952

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

dotnet/test/E2E/ModeHandlersE2ETests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public async Task Should_Invoke_Exit_Plan_Mode_Handler_When_Model_Uses_Tool()
6060
var (request, invocation) = await handlerTask.Task.WaitAsync(TimeSpan.FromSeconds(30));
6161
Assert.Equal(session.SessionId, invocation.SessionId);
6262
Assert.Equal(summary, request.Summary);
63-
Assert.Equal(["interactive", "autopilot", "exit_only"], request.Actions);
63+
Assert.Equal(["autopilot", "interactive", "exit_only"], request.Actions);
6464
Assert.Equal("interactive", request.RecommendedAction);
6565
Assert.NotNull(request.PlanContent);
6666

go/internal/e2e/mode_handlers_e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func TestModeHandlersE2E(t *testing.T) {
101101
if request.Summary != planSummary {
102102
t.Fatalf("Expected summary %q, got %q", planSummary, request.Summary)
103103
}
104-
if len(request.Actions) != 3 || request.Actions[0] != "interactive" || request.Actions[1] != "autopilot" || request.Actions[2] != "exit_only" {
104+
if len(request.Actions) != 3 || request.Actions[0] != "autopilot" || request.Actions[1] != "interactive" || request.Actions[2] != "exit_only" {
105105
t.Fatalf("Unexpected actions: %#v", request.Actions)
106106
}
107107
if request.RecommendedAction != "interactive" {

nodejs/test/e2e/mode_handlers.e2e.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ describe("Mode handlers", async () => {
110110
expect(exitPlanModeRequests).toHaveLength(1);
111111
expect(exitPlanModeRequests[0]).toMatchObject({
112112
summary: PLAN_SUMMARY,
113-
actions: ["interactive", "autopilot", "exit_only"],
113+
actions: ["autopilot", "interactive", "exit_only"],
114114
recommendedAction: "interactive",
115115
});
116116
expect(exitPlanModeRequests[0].planContent).toBeDefined();

python/e2e/test_mode_handlers_e2e.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ async def on_exit_plan_mode_request(request, invocation):
119119
assert len(exit_plan_mode_requests) == 1
120120
request = exit_plan_mode_requests[0]
121121
assert request["summary"] == PLAN_SUMMARY
122-
assert request["actions"] == ["interactive", "autopilot", "exit_only"]
122+
assert request["actions"] == ["autopilot", "interactive", "exit_only"]
123123
assert request["recommendedAction"] == "interactive"
124124
assert request.get("planContent") is not None
125125

rust/tests/e2e/mode_handlers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ async fn should_invoke_exit_plan_mode_handler_when_model_uses_tool() {
134134
assert_eq!(request.summary, PLAN_SUMMARY);
135135
assert_eq!(
136136
request.actions,
137-
["interactive", "autopilot", "exit_only"].map(str::to_string)
137+
["autopilot", "interactive", "exit_only"].map(str::to_string)
138138
);
139139
assert_eq!(request.recommended_action, "interactive");
140140

@@ -146,8 +146,8 @@ async fn should_invoke_exit_plan_mode_handler_when_model_uses_tool() {
146146
assert_eq!(
147147
requested_data.actions,
148148
[
149-
ExitPlanModeAction::Interactive,
150149
ExitPlanModeAction::Autopilot,
150+
ExitPlanModeAction::Interactive,
151151
ExitPlanModeAction::ExitOnly,
152152
]
153153
);

0 commit comments

Comments
 (0)