Skip to content

Commit 1f3e1d7

Browse files
stephentoubCopilot
andauthored
Make abort E2E snapshots tolerate timing variants (#1808)
Add cassette alternatives for valid abort histories where an in-flight tool result is interrupted and where streaming abort retains only the original user prompt before recovery. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c638a5e commit 1f3e1d7

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

test/snapshots/abort/should_abort_during_active_streaming.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,13 @@ conversations:
3535
content: Say 'abort_recovery_ok'.
3636
- role: assistant
3737
content: abort_recovery_ok
38+
- messages:
39+
- role: system
40+
content: ${system}
41+
- role: user
42+
content: Write a very long essay about the history of computing, covering every decade from the 1940s to the 2020s in
43+
great detail.
44+
- role: user
45+
content: Say 'abort_recovery_ok'.
46+
- role: assistant
47+
content: abort_recovery_ok

test/snapshots/session/should_abort_a_session.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,31 @@ conversations:
5050
content: What is 2+2?
5151
- role: assistant
5252
content: 2 + 2 = 4
53+
- messages:
54+
- role: system
55+
content: ${system}
56+
- role: user
57+
content: run the shell command 'sleep 100' (note this works on both bash and PowerShell)
58+
- role: assistant
59+
content: I'll run the sleep command for 100 seconds.
60+
tool_calls:
61+
- id: toolcall_0
62+
type: function
63+
function:
64+
name: report_intent
65+
arguments: '{"intent":"Running sleep command"}'
66+
- id: toolcall_1
67+
type: function
68+
function:
69+
name: ${shell}
70+
arguments: '{"command":"sleep 100","description":"Run sleep 100 command","mode":"sync","initial_wait":105}'
71+
- role: tool
72+
tool_call_id: toolcall_0
73+
content: The execution of this tool, or a previous tool was interrupted.
74+
- role: tool
75+
tool_call_id: toolcall_1
76+
content: The execution of this tool, or a previous tool was interrupted.
77+
- role: user
78+
content: What is 2+2?
79+
- role: assistant
80+
content: 2 + 2 = 4

0 commit comments

Comments
 (0)