Skip to content

Commit e01f3e9

Browse files
stephentoubCopilot
andcommitted
Complete denied-permission replay snapshots
Add the optional post-denial model turns so denied edit tests can replay deterministically if the CLI asks the model to summarize the denied tool result. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 831c6de commit e01f3e9

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

test/snapshots/permissions/should_deny_permission_when_handler_returns_denied.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,29 @@ conversations:
2222
function:
2323
name: view
2424
arguments: '{"path":"${workdir}/protected.txt"}'
25+
- messages:
26+
- role: system
27+
content: ${system}
28+
- role: user
29+
content: Edit protected.txt and replace 'protected' with 'hacked'.
30+
- role: assistant
31+
content: I'll view the file first, then make the edit.
32+
tool_calls:
33+
- id: toolcall_0
34+
type: function
35+
function:
36+
name: report_intent
37+
arguments: '{"intent":"Editing protected.txt file"}'
38+
- id: toolcall_1
39+
type: function
40+
function:
41+
name: view
42+
arguments: '{"path":"${workdir}/protected.txt"}'
43+
- role: tool
44+
tool_call_id: toolcall_0
45+
content: Intent logged
46+
- role: tool
47+
tool_call_id: toolcall_1
48+
content: Permission denied and could not request permission from user
49+
- role: assistant
50+
content: I don't have permission to view or edit protected.txt, so I can't make that change.

test/snapshots/rust_multi_client/one_client_rejects_permission_and_both_see_the_result.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,30 @@ conversations:
2323
function:
2424
name: view
2525
arguments: '{"path":"${workdir}/protected.txt"}'
26+
- messages:
27+
- role: system
28+
content: ${system}
29+
- role: user
30+
content: Edit protected.txt and replace 'protected' with 'hacked'.
31+
- role: assistant
32+
content: I'll help you edit protected.txt to replace 'protected' with 'hacked'. Let me first view the file and then make
33+
the change.
34+
tool_calls:
35+
- id: toolcall_0
36+
type: function
37+
function:
38+
name: report_intent
39+
arguments: '{"intent":"Editing protected.txt file"}'
40+
- id: toolcall_1
41+
type: function
42+
function:
43+
name: view
44+
arguments: '{"path":"${workdir}/protected.txt"}'
45+
- role: tool
46+
tool_call_id: toolcall_0
47+
content: Intent logged
48+
- role: tool
49+
tool_call_id: toolcall_1
50+
content: Permission denied and could not request permission from user
51+
- role: assistant
52+
content: I don't have permission to view or edit protected.txt, so I can't make that change.

0 commit comments

Comments
 (0)