From 1ca18d4669ad9c88a7a647c499788f2aa71db3f0 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Thu, 11 Jun 2026 22:16:22 -0400 Subject: [PATCH] Make exit_plan_mode E2E snapshot tolerant of reworded CLI tool result The runtime reworded the exit_plan_mode post-approval tool result for interactive mode. The copilot-agent-runtime `C# SDK tests'' leg builds the CLI from source (new wording) and started failing because the recorded snapshot only contained the old wording, so the replay proxy could not match the request. Published @github/copilot 1.0.61 (pinned by this repo's own E2E harness and all language legs) still emits the old wording, so the snapshot must satisfy both. Add a second conversation variant covering the new wording; the replay proxy matches a request as a strict prefix of any stored conversation, so old and new CLI versions both resolve. The SDK never asserts on this CLI-internal text. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- ...lan_mode_handler_when_model_uses_tool.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/snapshots/mode_handlers/should_invoke_exit_plan_mode_handler_when_model_uses_tool.yaml b/test/snapshots/mode_handlers/should_invoke_exit_plan_mode_handler_when_model_uses_tool.yaml index 69987f17a..94233b05e 100644 --- a/test/snapshots/mode_handlers/should_invoke_exit_plan_mode_handler_when_model_uses_tool.yaml +++ b/test/snapshots/mode_handlers/should_invoke_exit_plan_mode_handler_when_model_uses_tool.yaml @@ -1,5 +1,15 @@ models: - claude-sonnet-4.5 +# Two stored conversations cover the two CLI versions of the exit_plan_mode +# post-approval tool result. The CLI injects this text and feeds it back to the +# model; the SDK never asserts on its exact wording. The interactive-mode message +# was reworded in copilot-agent-runtime: +# conv0: CLI 1.0.61 and earlier -> "...interactive mode (edits require manual +# approval). Proceed with implementing the plan." +# conv1: newer runtime builds -> "...interactive mode. Start implementing the +# plan now, in this same response. ..." +# The replay proxy matches a request as a strict prefix of a stored conversation +# and returns the next assistant message, so both versions resolve correctly. conversations: - messages: - role: system @@ -21,3 +31,23 @@ conversations: You are now in interactive mode (edits require manual approval). Proceed with implementing the plan. - role: assistant content: Plan approved; I will wait for the next instruction before making changes. + - messages: + - role: system + content: ${system} + - role: user + content: Create a brief implementation plan for adding a greeting.txt file, then request approval with exit_plan_mode. + - role: assistant + tool_calls: + - id: toolcall_0 + type: function + function: + name: exit_plan_mode + arguments: '{"summary":"Greeting file implementation plan","actions":["interactive","autopilot","exit_only"],"recommendedAction":"interactive"}' + - role: tool + tool_call_id: toolcall_0 + content: |- + Plan approved! Exited plan mode. + + You are now in interactive mode. Start implementing the plan now, in this same response. Approving the plan is your go-signal, so do not stop to ask whether to proceed or wait for another message. + - role: assistant + content: Plan approved; I will wait for the next instruction before making changes.