From 05a40db4e3bf4f043e5666277828f92b48067439 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Fri, 26 Jun 2026 12:16:01 -0400 Subject: [PATCH] Make abort E2E snapshots tolerate timing variants 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> --- .../should_abort_during_active_streaming.yaml | 10 +++++++ .../session/should_abort_a_session.yaml | 28 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/test/snapshots/abort/should_abort_during_active_streaming.yaml b/test/snapshots/abort/should_abort_during_active_streaming.yaml index ea70c0d536..70981ee597 100644 --- a/test/snapshots/abort/should_abort_during_active_streaming.yaml +++ b/test/snapshots/abort/should_abort_during_active_streaming.yaml @@ -35,3 +35,13 @@ conversations: content: Say 'abort_recovery_ok'. - role: assistant content: abort_recovery_ok + - messages: + - role: system + content: ${system} + - role: user + content: Write a very long essay about the history of computing, covering every decade from the 1940s to the 2020s in + great detail. + - role: user + content: Say 'abort_recovery_ok'. + - role: assistant + content: abort_recovery_ok diff --git a/test/snapshots/session/should_abort_a_session.yaml b/test/snapshots/session/should_abort_a_session.yaml index dbbbd32aa7..f1217f7f62 100644 --- a/test/snapshots/session/should_abort_a_session.yaml +++ b/test/snapshots/session/should_abort_a_session.yaml @@ -50,3 +50,31 @@ conversations: content: What is 2+2? - role: assistant content: 2 + 2 = 4 + - messages: + - role: system + content: ${system} + - role: user + content: run the shell command 'sleep 100' (note this works on both bash and PowerShell) + - role: assistant + content: I'll run the sleep command for 100 seconds. + tool_calls: + - id: toolcall_0 + type: function + function: + name: report_intent + arguments: '{"intent":"Running sleep command"}' + - id: toolcall_1 + type: function + function: + name: ${shell} + arguments: '{"command":"sleep 100","description":"Run sleep 100 command","mode":"sync","initial_wait":105}' + - role: tool + tool_call_id: toolcall_0 + content: The execution of this tool, or a previous tool was interrupted. + - role: tool + tool_call_id: toolcall_1 + content: The execution of this tool, or a previous tool was interrupted. + - role: user + content: What is 2+2? + - role: assistant + content: 2 + 2 = 4