Skip to content

Commit 523dcce

Browse files
Update snapshots for new runtime Anthropic client behavior (coalesces tool calls)
1 parent bfbc4bd commit 523dcce

7 files changed

+119
-13
lines changed

test/snapshots/permissions/should_handle_async_permission_handler.yaml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ conversations:
66
content: ${system}
77
- role: user
88
content: Run 'echo test' and tell me what happens
9-
- role: assistant
10-
content: I'll run the echo command for you.
119
- role: assistant
1210
tool_calls:
1311
- id: toolcall_0
@@ -22,6 +20,23 @@ conversations:
2220
function:
2321
name: ${shell}
2422
arguments: '{"command":"echo test","description":"Run echo test"}'
23+
- messages:
24+
- role: system
25+
content: ${system}
26+
- role: user
27+
content: Run 'echo test' and tell me what happens
28+
- role: assistant
29+
tool_calls:
30+
- id: toolcall_0
31+
type: function
32+
function:
33+
name: report_intent
34+
arguments: '{"intent":"Running echo command"}'
35+
- id: toolcall_1
36+
type: function
37+
function:
38+
name: ${shell}
39+
arguments: '{"command":"echo test","description":"Run echo test"}'
2540
- role: tool
2641
tool_call_id: toolcall_0
2742
content: Intent logged
@@ -31,5 +46,4 @@ conversations:
3146
test
3247
<exited with exit code 0>
3348
- role: assistant
34-
content: The command executed successfully and printed "test" to the output, then exited with code 0 (indicating
35-
success).
49+
content: The command executed successfully and printed "test" to the console, then exited with code 0 (success).

test/snapshots/permissions/should_handle_permission_handler_errors_gracefully.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,23 @@ conversations:
2020
function:
2121
name: ${shell}
2222
arguments: '{"command":"echo test","description":"Run echo test command"}'
23+
- messages:
24+
- role: system
25+
content: ${system}
26+
- role: user
27+
content: Run 'echo test'. If you can't, say 'failed'.
28+
- role: assistant
29+
tool_calls:
30+
- id: toolcall_0
31+
type: function
32+
function:
33+
name: report_intent
34+
arguments: '{"intent":"Running echo command"}'
35+
- id: toolcall_1
36+
type: function
37+
function:
38+
name: ${shell}
39+
arguments: '{"command":"echo test","description":"Run echo test command"}'
2340
- role: tool
2441
tool_call_id: toolcall_0
2542
content: Intent logged

test/snapshots/permissions/should_invoke_permission_handler_for_write_operations.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,23 @@ conversations:
2020
function:
2121
name: view
2222
arguments: '{"path":"${workdir}/test.txt"}'
23+
- messages:
24+
- role: system
25+
content: ${system}
26+
- role: user
27+
content: Edit test.txt and replace 'original' with 'modified'
28+
- role: assistant
29+
tool_calls:
30+
- id: toolcall_0
31+
type: function
32+
function:
33+
name: report_intent
34+
arguments: '{"intent":"Editing test.txt file"}'
35+
- id: toolcall_1
36+
type: function
37+
function:
38+
name: view
39+
arguments: '{"path":"${workdir}/test.txt"}'
2340
- role: tool
2441
tool_call_id: toolcall_0
2542
content: Intent logged
@@ -37,4 +54,4 @@ conversations:
3754
tool_call_id: toolcall_2
3855
content: File ${workdir}/test.txt updated with changes.
3956
- role: assistant
40-
content: Done! Replaced 'original' with 'modified' in test.txt.
57+
content: Done! I've replaced 'original' with 'modified' in test.txt.

test/snapshots/permissions/should_receive_toolcallid_in_permission_requests.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,23 @@ conversations:
2020
function:
2121
name: ${shell}
2222
arguments: '{"command":"echo test","description":"Run echo test"}'
23+
- messages:
24+
- role: system
25+
content: ${system}
26+
- role: user
27+
content: Run 'echo test'
28+
- role: assistant
29+
tool_calls:
30+
- id: toolcall_0
31+
type: function
32+
function:
33+
name: report_intent
34+
arguments: '{"intent":"Running echo command"}'
35+
- id: toolcall_1
36+
type: function
37+
function:
38+
name: ${shell}
39+
arguments: '{"command":"echo test","description":"Run echo test"}'
2340
- role: tool
2441
tool_call_id: toolcall_0
2542
content: Intent logged
@@ -29,4 +46,4 @@ conversations:
2946
test
3047
<exited with exit code 0>
3148
- role: assistant
32-
content: "The command executed successfully and output: **test**"
49+
content: The command executed successfully and output "test".

test/snapshots/permissions/should_resume_session_with_permission_handler.yaml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ conversations:
77
- role: user
88
content: What is 1+1?
99
- role: assistant
10-
content: 1 + 1 = 2
10+
content: 1+1 equals 2.
1111
- role: user
1212
content: Run 'echo resumed' for me
1313
- role: assistant
@@ -24,6 +24,27 @@ conversations:
2424
function:
2525
name: ${shell}
2626
arguments: '{"command":"echo resumed","description":"Run echo resumed"}'
27+
- messages:
28+
- role: system
29+
content: ${system}
30+
- role: user
31+
content: What is 1+1?
32+
- role: assistant
33+
content: 1+1 equals 2.
34+
- role: user
35+
content: Run 'echo resumed' for me
36+
- role: assistant
37+
tool_calls:
38+
- id: toolcall_0
39+
type: function
40+
function:
41+
name: report_intent
42+
arguments: '{"intent":"Running echo command"}'
43+
- id: toolcall_1
44+
type: function
45+
function:
46+
name: ${shell}
47+
arguments: '{"command":"echo resumed","description":"Run echo resumed"}'
2748
- role: tool
2849
tool_call_id: toolcall_0
2950
content: Intent logged
@@ -33,4 +54,4 @@ conversations:
3354
resumed
3455
<exited with exit code 0>
3556
- role: assistant
36-
content: The command completed successfully and output "resumed".
57+
content: "The command executed successfully and output: **resumed**"

test/snapshots/session/should_create_session_with_custom_tool.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ conversations:
66
content: ${system}
77
- role: user
88
content: What is the secret number for key ALPHA?
9-
- role: assistant
10-
content: I'll get the secret number for key ALPHA.
119
- role: assistant
1210
tool_calls:
1311
- id: toolcall_0

test/snapshots/tools/invokes_built_in_tools.yaml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,41 @@ conversations:
1212
type: function
1313
function:
1414
name: report_intent
15-
arguments: '{"intent":"Reading README file"}'
15+
arguments: '{"intent":"Reading README.md file"}'
1616
- role: assistant
1717
tool_calls:
1818
- id: toolcall_1
1919
type: function
2020
function:
2121
name: view
22-
arguments: '{"path":"${workdir}/README.md","view_range":[1,1]}'
22+
arguments: '{"path":"${workdir}/README.md"}'
23+
- messages:
24+
- role: system
25+
content: ${system}
26+
- role: user
27+
content: What's the first line of README.md in this directory?
28+
- role: assistant
29+
tool_calls:
30+
- id: toolcall_0
31+
type: function
32+
function:
33+
name: report_intent
34+
arguments: '{"intent":"Reading README.md file"}'
35+
- id: toolcall_1
36+
type: function
37+
function:
38+
name: view
39+
arguments: '{"path":"${workdir}/README.md"}'
2340
- role: tool
2441
tool_call_id: toolcall_0
2542
content: Intent logged
2643
- role: tool
2744
tool_call_id: toolcall_1
2845
content: "1. # ELIZA, the only chatbot you'll ever need"
2946
- role: assistant
30-
content: "The first line of README.md is: `# ELIZA, the only chatbot you'll ever need`"
47+
content: |-
48+
The first line of README.md is:
49+
50+
```
51+
# ELIZA, the only chatbot you'll ever need
52+
```

0 commit comments

Comments
 (0)