From 03b0839f91adaa81f0e7b2c2e9c6ae41bb62c1da Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Mon, 19 Jan 2026 17:57:43 +0000 Subject: [PATCH 1/4] Update some snapshots; remove redundant ones --- ...nvoke_onevent_callback_for_each_event.yaml | 10 ----- ...ould_return_assistant_message_content.yaml | 10 ----- .../accept_mcp_servers_and_custom_agents.yaml | 10 ----- .../accept_custom_agent_config_on_resume.yaml | 14 ------- .../permissions/async_permission_handler.yaml | 7 ++-- ...permission_handler_for_shell_commands.yaml | 24 +++++++++--- ..._permission_handler_errors_gracefully.yaml | 4 +- ...permission_handler_for_shell_commands.yaml | 32 ---------------- ...rmission_handler_for_write_operations.yaml | 37 +++++++++++++++++++ ...esume_session_with_permission_handler.yaml | 10 ++--- ...m_events_and_return_assistant_message.yaml | 10 ----- ...e_option_for_multi_turn_conversations.yaml | 14 ------- .../tools/invokes_built_in_tools.yaml | 28 -------------- 13 files changed, 66 insertions(+), 144 deletions(-) delete mode 100644 test/snapshots/ask/should_invoke_onevent_callback_for_each_event.yaml delete mode 100644 test/snapshots/ask/should_return_assistant_message_content.yaml delete mode 100644 test/snapshots/combinedconfiguration/accept_mcp_servers_and_custom_agents.yaml delete mode 100644 test/snapshots/customagents/accept_custom_agent_config_on_resume.yaml delete mode 100644 test/snapshots/permissions/should_invoke_permission_handler_for_shell_commands.yaml delete mode 100644 test/snapshots/query/should_stream_events_and_return_assistant_message.yaml delete mode 100644 test/snapshots/query/should_support_resume_option_for_multi_turn_conversations.yaml diff --git a/test/snapshots/ask/should_invoke_onevent_callback_for_each_event.yaml b/test/snapshots/ask/should_invoke_onevent_callback_for_each_event.yaml deleted file mode 100644 index 9fe2fcd..0000000 --- a/test/snapshots/ask/should_invoke_onevent_callback_for_each_event.yaml +++ /dev/null @@ -1,10 +0,0 @@ -models: - - claude-sonnet-4.5 -conversations: - - messages: - - role: system - content: ${system} - - role: user - content: What is 2+2? - - role: assistant - content: 2 + 2 = 4 diff --git a/test/snapshots/ask/should_return_assistant_message_content.yaml b/test/snapshots/ask/should_return_assistant_message_content.yaml deleted file mode 100644 index 2504021..0000000 --- a/test/snapshots/ask/should_return_assistant_message_content.yaml +++ /dev/null @@ -1,10 +0,0 @@ -models: - - claude-sonnet-4.5 -conversations: - - messages: - - role: system - content: ${system} - - role: user - content: What is 1+1? - - role: assistant - content: 1 + 1 = 2 diff --git a/test/snapshots/combinedconfiguration/accept_mcp_servers_and_custom_agents.yaml b/test/snapshots/combinedconfiguration/accept_mcp_servers_and_custom_agents.yaml deleted file mode 100644 index 60d1ead..0000000 --- a/test/snapshots/combinedconfiguration/accept_mcp_servers_and_custom_agents.yaml +++ /dev/null @@ -1,10 +0,0 @@ -models: - - claude-sonnet-4.5 -conversations: - - messages: - - role: system - content: ${system} - - role: user - content: What is 7+7? - - role: assistant - content: 7 + 7 = 14 diff --git a/test/snapshots/customagents/accept_custom_agent_config_on_resume.yaml b/test/snapshots/customagents/accept_custom_agent_config_on_resume.yaml deleted file mode 100644 index 16db486..0000000 --- a/test/snapshots/customagents/accept_custom_agent_config_on_resume.yaml +++ /dev/null @@ -1,14 +0,0 @@ -models: - - claude-sonnet-4.5 -conversations: - - messages: - - role: system - content: ${system} - - role: user - content: What is 1+1? - - role: assistant - content: 1 + 1 = 2 - - role: user - content: What is 6+6? - - role: assistant - content: 6 + 6 = 12 diff --git a/test/snapshots/permissions/async_permission_handler.yaml b/test/snapshots/permissions/async_permission_handler.yaml index 5cc63c0..8449876 100644 --- a/test/snapshots/permissions/async_permission_handler.yaml +++ b/test/snapshots/permissions/async_permission_handler.yaml @@ -19,7 +19,7 @@ conversations: type: function function: name: ${shell} - arguments: '{"command":"echo test","description":"Run echo test command"}' + arguments: '{"command":"echo test","description":"Run echo test"}' - messages: - role: system content: ${system} @@ -36,7 +36,7 @@ conversations: type: function function: name: ${shell} - arguments: '{"command":"echo test","description":"Run echo test command"}' + arguments: '{"command":"echo test","description":"Run echo test"}' - role: tool tool_call_id: toolcall_0 content: Intent logged @@ -46,5 +46,4 @@ conversations: test - role: assistant - content: The command successfully executed and outputted "test" to the console, then exited with code 0 (indicating - success). + content: The command successfully executed and printed "test" to the console, then exited with code 0 (success). diff --git a/test/snapshots/permissions/permission_handler_for_shell_commands.yaml b/test/snapshots/permissions/permission_handler_for_shell_commands.yaml index c9fad0e..f19a502 100644 --- a/test/snapshots/permissions/permission_handler_for_shell_commands.yaml +++ b/test/snapshots/permissions/permission_handler_for_shell_commands.yaml @@ -5,7 +5,7 @@ conversations: - role: system content: ${system} - role: user - content: Run 'echo hello' and tell me the output + content: Run 'echo hello world' and tell me the output - role: assistant tool_calls: - id: toolcall_0 @@ -19,12 +19,12 @@ conversations: type: function function: name: ${shell} - arguments: '{"command":"echo hello","description":"Run echo hello"}' + arguments: '{"command":"echo hello world","description":"Run echo hello world"}' - messages: - role: system content: ${system} - role: user - content: Run 'echo hello' and tell me the output + content: Run 'echo hello world' and tell me the output - role: assistant tool_calls: - id: toolcall_0 @@ -36,7 +36,7 @@ conversations: type: function function: name: ${shell} - arguments: '{"command":"echo hello","description":"Run echo hello"}' + arguments: '{"command":"echo hello world","description":"Run echo hello world"}' - role: tool tool_call_id: toolcall_0 content: Intent logged @@ -44,6 +44,20 @@ conversations: tool_call_id: toolcall_1 content: |- hello + world - role: assistant - content: The output is `hello` with exit code 0 (success). + content: >- + The output is: + + ``` + + hello + + world + + ``` + + + Note that PowerShell's `echo` (which is an alias for `Write-Output`) outputs "hello" and "world" on separate + lines. diff --git a/test/snapshots/permissions/should_handle_permission_handler_errors_gracefully.yaml b/test/snapshots/permissions/should_handle_permission_handler_errors_gracefully.yaml index 30b556f..cee78a0 100644 --- a/test/snapshots/permissions/should_handle_permission_handler_errors_gracefully.yaml +++ b/test/snapshots/permissions/should_handle_permission_handler_errors_gracefully.yaml @@ -19,7 +19,7 @@ conversations: type: function function: name: ${shell} - arguments: '{"command":"echo test","description":"Run echo test command"}' + arguments: '{"command":"echo test","description":"Run echo test"}' - messages: - role: system content: ${system} @@ -36,7 +36,7 @@ conversations: type: function function: name: ${shell} - arguments: '{"command":"echo test","description":"Run echo test command"}' + arguments: '{"command":"echo test","description":"Run echo test"}' - role: tool tool_call_id: toolcall_0 content: Intent logged diff --git a/test/snapshots/permissions/should_invoke_permission_handler_for_shell_commands.yaml b/test/snapshots/permissions/should_invoke_permission_handler_for_shell_commands.yaml deleted file mode 100644 index 6f5bccf..0000000 --- a/test/snapshots/permissions/should_invoke_permission_handler_for_shell_commands.yaml +++ /dev/null @@ -1,32 +0,0 @@ -models: - - claude-sonnet-4.5 -conversations: - - messages: - - role: system - content: ${system} - - role: user - content: Run 'echo hello world' and tell me the output - - role: assistant - tool_calls: - - id: toolcall_0 - type: function - function: - name: report_intent - arguments: '{"intent":"Running echo command"}' - - role: assistant - tool_calls: - - id: toolcall_1 - type: function - function: - name: ${shell} - arguments: '{"command":"echo hello world","description":"Run echo hello world"}' - - role: tool - tool_call_id: toolcall_0 - content: Intent logged - - role: tool - tool_call_id: toolcall_1 - content: |- - hello world - - - role: assistant - content: "The output is: `hello world`" diff --git a/test/snapshots/permissions/should_invoke_permission_handler_for_write_operations.yaml b/test/snapshots/permissions/should_invoke_permission_handler_for_write_operations.yaml index 3ce2ee4..a085031 100644 --- a/test/snapshots/permissions/should_invoke_permission_handler_for_write_operations.yaml +++ b/test/snapshots/permissions/should_invoke_permission_handler_for_write_operations.yaml @@ -6,6 +6,8 @@ conversations: content: ${system} - role: user content: Edit test.txt and replace 'original' with 'modified' + - role: assistant + content: I'll view the file first to see its contents, then make the replacement. - role: assistant tool_calls: - id: toolcall_0 @@ -26,6 +28,40 @@ conversations: - role: user content: Edit test.txt and replace 'original' with 'modified' - role: assistant + content: I'll view the file first to see its contents, then make the replacement. + tool_calls: + - id: toolcall_0 + type: function + function: + name: report_intent + arguments: '{"intent":"Editing test.txt file"}' + - id: toolcall_1 + type: function + function: + name: view + arguments: '{"path":"${workdir}/test.txt"}' + - role: tool + tool_call_id: toolcall_0 + content: Intent logged + - role: tool + tool_call_id: toolcall_1 + content: 1. original content + - role: assistant + content: "Now I'll replace 'original' with 'modified':" + - role: assistant + tool_calls: + - id: toolcall_2 + type: function + function: + name: edit + arguments: '{"path":"${workdir}/test.txt","old_str":"original content","new_str":"modified content"}' + - messages: + - role: system + content: ${system} + - role: user + content: Edit test.txt and replace 'original' with 'modified' + - role: assistant + content: I'll view the file first to see its contents, then make the replacement. tool_calls: - id: toolcall_0 type: function @@ -44,6 +80,7 @@ conversations: tool_call_id: toolcall_1 content: 1. original content - role: assistant + content: "Now I'll replace 'original' with 'modified':" tool_calls: - id: toolcall_2 type: function diff --git a/test/snapshots/permissions/should_resume_session_with_permission_handler.yaml b/test/snapshots/permissions/should_resume_session_with_permission_handler.yaml index 69a52be..9103dc6 100644 --- a/test/snapshots/permissions/should_resume_session_with_permission_handler.yaml +++ b/test/snapshots/permissions/should_resume_session_with_permission_handler.yaml @@ -7,7 +7,7 @@ conversations: - role: user content: What is 1+1? - role: assistant - content: 1+1 = 2 + content: 1+1 equals 2. - role: user content: Run 'echo resumed' for me - role: assistant @@ -23,14 +23,14 @@ conversations: type: function function: name: ${shell} - arguments: '{"description":"Run echo resumed","command":"echo resumed"}' + arguments: '{"command":"echo resumed","description":"Run echo resumed"}' - messages: - role: system content: ${system} - role: user content: What is 1+1? - role: assistant - content: 1+1 = 2 + content: 1+1 equals 2. - role: user content: Run 'echo resumed' for me - role: assistant @@ -44,7 +44,7 @@ conversations: type: function function: name: ${shell} - arguments: '{"description":"Run echo resumed","command":"echo resumed"}' + arguments: '{"command":"echo resumed","description":"Run echo resumed"}' - role: tool tool_call_id: toolcall_0 content: Intent logged @@ -54,4 +54,4 @@ conversations: resumed - role: assistant - content: "The command executed successfully and output: **resumed**" + content: "The command completed successfully and output: `resumed`" diff --git a/test/snapshots/query/should_stream_events_and_return_assistant_message.yaml b/test/snapshots/query/should_stream_events_and_return_assistant_message.yaml deleted file mode 100644 index 2504021..0000000 --- a/test/snapshots/query/should_stream_events_and_return_assistant_message.yaml +++ /dev/null @@ -1,10 +0,0 @@ -models: - - claude-sonnet-4.5 -conversations: - - messages: - - role: system - content: ${system} - - role: user - content: What is 1+1? - - role: assistant - content: 1 + 1 = 2 diff --git a/test/snapshots/query/should_support_resume_option_for_multi_turn_conversations.yaml b/test/snapshots/query/should_support_resume_option_for_multi_turn_conversations.yaml deleted file mode 100644 index d0364ce..0000000 --- a/test/snapshots/query/should_support_resume_option_for_multi_turn_conversations.yaml +++ /dev/null @@ -1,14 +0,0 @@ -models: - - claude-sonnet-4.5 -conversations: - - messages: - - role: system - content: ${system} - - role: user - content: "Remember this number: 42" - - role: assistant - content: "I'll remember that number: 42." - - role: user - content: What number did I ask you to remember? - - role: assistant - content: "You asked me to remember the number: 42." diff --git a/test/snapshots/tools/invokes_built_in_tools.yaml b/test/snapshots/tools/invokes_built_in_tools.yaml index fc60c8b..a0b83d9 100644 --- a/test/snapshots/tools/invokes_built_in_tools.yaml +++ b/test/snapshots/tools/invokes_built_in_tools.yaml @@ -9,44 +9,16 @@ conversations: - role: assistant tool_calls: - id: toolcall_0 - type: function - function: - name: report_intent - arguments: '{"intent":"Reading README.md file"}' - - role: assistant - tool_calls: - - id: toolcall_1 - type: function - function: - name: view - arguments: '{"path":"${workdir}/README.md"}' - - messages: - - role: system - content: ${system} - - role: user - content: What's the first line of README.md in this directory? - - role: assistant - tool_calls: - - id: toolcall_0 - type: function - function: - name: report_intent - arguments: '{"intent":"Reading README.md file"}' - - id: toolcall_1 type: function function: name: view arguments: '{"path":"${workdir}/README.md"}' - role: tool tool_call_id: toolcall_0 - content: Intent logged - - role: tool - tool_call_id: toolcall_1 content: "1. # ELIZA, the only chatbot you'll ever need" - role: assistant content: |- The first line of README.md is: - ``` # ELIZA, the only chatbot you'll ever need ``` From c1c00223f0c4f3129ad9ae67d20f35dceaded79c Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Mon, 19 Jan 2026 18:08:17 +0000 Subject: [PATCH 2/4] Undo irrelevant changes --- .../permissions/async_permission_handler.yaml | 7 ++++--- ...ld_handle_permission_handler_errors_gracefully.yaml | 4 ++-- .../should_resume_session_with_permission_handler.yaml | 10 +++++----- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/test/snapshots/permissions/async_permission_handler.yaml b/test/snapshots/permissions/async_permission_handler.yaml index 8449876..5cc63c0 100644 --- a/test/snapshots/permissions/async_permission_handler.yaml +++ b/test/snapshots/permissions/async_permission_handler.yaml @@ -19,7 +19,7 @@ conversations: type: function function: name: ${shell} - arguments: '{"command":"echo test","description":"Run echo test"}' + arguments: '{"command":"echo test","description":"Run echo test command"}' - messages: - role: system content: ${system} @@ -36,7 +36,7 @@ conversations: type: function function: name: ${shell} - arguments: '{"command":"echo test","description":"Run echo test"}' + arguments: '{"command":"echo test","description":"Run echo test command"}' - role: tool tool_call_id: toolcall_0 content: Intent logged @@ -46,4 +46,5 @@ conversations: test - role: assistant - content: The command successfully executed and printed "test" to the console, then exited with code 0 (success). + content: The command successfully executed and outputted "test" to the console, then exited with code 0 (indicating + success). diff --git a/test/snapshots/permissions/should_handle_permission_handler_errors_gracefully.yaml b/test/snapshots/permissions/should_handle_permission_handler_errors_gracefully.yaml index cee78a0..30b556f 100644 --- a/test/snapshots/permissions/should_handle_permission_handler_errors_gracefully.yaml +++ b/test/snapshots/permissions/should_handle_permission_handler_errors_gracefully.yaml @@ -19,7 +19,7 @@ conversations: type: function function: name: ${shell} - arguments: '{"command":"echo test","description":"Run echo test"}' + arguments: '{"command":"echo test","description":"Run echo test command"}' - messages: - role: system content: ${system} @@ -36,7 +36,7 @@ conversations: type: function function: name: ${shell} - arguments: '{"command":"echo test","description":"Run echo test"}' + arguments: '{"command":"echo test","description":"Run echo test command"}' - role: tool tool_call_id: toolcall_0 content: Intent logged diff --git a/test/snapshots/permissions/should_resume_session_with_permission_handler.yaml b/test/snapshots/permissions/should_resume_session_with_permission_handler.yaml index 9103dc6..69a52be 100644 --- a/test/snapshots/permissions/should_resume_session_with_permission_handler.yaml +++ b/test/snapshots/permissions/should_resume_session_with_permission_handler.yaml @@ -7,7 +7,7 @@ conversations: - role: user content: What is 1+1? - role: assistant - content: 1+1 equals 2. + content: 1+1 = 2 - role: user content: Run 'echo resumed' for me - role: assistant @@ -23,14 +23,14 @@ conversations: type: function function: name: ${shell} - arguments: '{"command":"echo resumed","description":"Run echo resumed"}' + arguments: '{"description":"Run echo resumed","command":"echo resumed"}' - messages: - role: system content: ${system} - role: user content: What is 1+1? - role: assistant - content: 1+1 equals 2. + content: 1+1 = 2 - role: user content: Run 'echo resumed' for me - role: assistant @@ -44,7 +44,7 @@ conversations: type: function function: name: ${shell} - arguments: '{"command":"echo resumed","description":"Run echo resumed"}' + arguments: '{"description":"Run echo resumed","command":"echo resumed"}' - role: tool tool_call_id: toolcall_0 content: Intent logged @@ -54,4 +54,4 @@ conversations: resumed - role: assistant - content: "The command completed successfully and output: `resumed`" + content: "The command executed successfully and output: **resumed**" From b1666f9c8ecc2241070bbb4b3375e9ea73b53406 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Mon, 19 Jan 2026 19:01:57 +0000 Subject: [PATCH 3/4] Tidy --- go/e2e/permissions_test.go | 2 +- python/e2e/test_permissions.py | 2 +- ...permission_handler_for_shell_commands.yaml | 26 ++++--------------- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/go/e2e/permissions_test.go b/go/e2e/permissions_test.go index f1bb53c..4cd7f68 100644 --- a/go/e2e/permissions_test.go +++ b/go/e2e/permissions_test.go @@ -94,7 +94,7 @@ func TestPermissions(t *testing.T) { } _, err = session.SendAndWait(copilot.MessageOptions{ - Prompt: "Run 'echo hello world' and tell me the output", + Prompt: "Run 'echo hello' and tell me the output", }, 60*time.Second) if err != nil { t.Fatalf("Failed to send message: %v", err) diff --git a/python/e2e/test_permissions.py b/python/e2e/test_permissions.py index d8543d4..eedfbe9 100644 --- a/python/e2e/test_permissions.py +++ b/python/e2e/test_permissions.py @@ -57,7 +57,7 @@ def on_permission_request( session = await ctx.client.create_session({"on_permission_request": on_permission_request}) - await session.send_and_wait({"prompt": "Run 'echo hello world' and tell me the output"}) + await session.send_and_wait({"prompt": "Run 'echo hello' and tell me the output"}) # Should have received at least one shell permission request shell_requests = [req for req in permission_requests if req.get("kind") == "shell"] diff --git a/test/snapshots/permissions/permission_handler_for_shell_commands.yaml b/test/snapshots/permissions/permission_handler_for_shell_commands.yaml index f19a502..33b3f16 100644 --- a/test/snapshots/permissions/permission_handler_for_shell_commands.yaml +++ b/test/snapshots/permissions/permission_handler_for_shell_commands.yaml @@ -5,7 +5,7 @@ conversations: - role: system content: ${system} - role: user - content: Run 'echo hello world' and tell me the output + content: Run 'echo hello' and tell me the output - role: assistant tool_calls: - id: toolcall_0 @@ -13,18 +13,16 @@ conversations: function: name: report_intent arguments: '{"intent":"Running echo command"}' - - role: assistant - tool_calls: - id: toolcall_1 type: function function: name: ${shell} - arguments: '{"command":"echo hello world","description":"Run echo hello world"}' + arguments: '{"command":"echo hello","description":"Run echo hello"}' - messages: - role: system content: ${system} - role: user - content: Run 'echo hello world' and tell me the output + content: Run 'echo hello' and tell me the output - role: assistant tool_calls: - id: toolcall_0 @@ -36,7 +34,7 @@ conversations: type: function function: name: ${shell} - arguments: '{"command":"echo hello world","description":"Run echo hello world"}' + arguments: '{"command":"echo hello","description":"Run echo hello"}' - role: tool tool_call_id: toolcall_0 content: Intent logged @@ -44,20 +42,6 @@ conversations: tool_call_id: toolcall_1 content: |- hello - world - role: assistant - content: >- - The output is: - - ``` - - hello - - world - - ``` - - - Note that PowerShell's `echo` (which is an alias for `Write-Output`) outputs "hello" and "world" on separate - lines. + content: The output is `hello`. From 87bec83a9968be33292c7c47d1d9076b3fa246d8 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Mon, 19 Jan 2026 19:08:25 +0000 Subject: [PATCH 4/4] Add missing snapshot --- .../accept_mcp_servers_and_custom_agents.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/snapshots/combinedconfiguration/accept_mcp_servers_and_custom_agents.yaml diff --git a/test/snapshots/combinedconfiguration/accept_mcp_servers_and_custom_agents.yaml b/test/snapshots/combinedconfiguration/accept_mcp_servers_and_custom_agents.yaml new file mode 100644 index 0000000..60d1ead --- /dev/null +++ b/test/snapshots/combinedconfiguration/accept_mcp_servers_and_custom_agents.yaml @@ -0,0 +1,10 @@ +models: + - claude-sonnet-4.5 +conversations: + - messages: + - role: system + content: ${system} + - role: user + content: What is 7+7? + - role: assistant + content: 7 + 7 = 14