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/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/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/permission_handler_for_shell_commands.yaml b/test/snapshots/permissions/permission_handler_for_shell_commands.yaml index c9fad0e..33b3f16 100644 --- a/test/snapshots/permissions/permission_handler_for_shell_commands.yaml +++ b/test/snapshots/permissions/permission_handler_for_shell_commands.yaml @@ -13,8 +13,6 @@ conversations: function: name: report_intent arguments: '{"intent":"Running echo command"}' - - role: assistant - tool_calls: - id: toolcall_1 type: function function: @@ -46,4 +44,4 @@ conversations: hello - role: assistant - content: The output is `hello` with exit code 0 (success). + content: The output is `hello`. 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/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 ```