diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index b72fc762..13ee0b20 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -493,6 +493,11 @@ classification and reshapes those raw calls accordingly: synthetic `function_call` events named `tool_search` are projected into that same public lifecycle after validation. +Shell functions are restored to `shell_call` for client execution by default. +When an application explicitly registers a shell executor, the translator instead +suppresses those internal function frames using the registry's resolved ownership; +the existing gateway event plan emits the shell call's added/done lifecycle. + It also buffers function-call events that arrive before the call's name is known (bounded at 256 KiB) and replays them once the name resolves. @@ -740,13 +745,23 @@ the behavioral layer — routing, handler traits, normalization, and execution. reused across requests, specifically for gateway tools that need **lazy, per-request connection setup**: MCP servers (connects and caches `McpClient`s keyed by server URL, falling back to connecting a fresh request-declared server) and the shared - `WebSearchHandler`. As of today it only has slots for `ToolType::Mcp` and - `ToolType::WebSearch`; `GatewayExecutorRegistration` has typed variants for those - supported slots. Client-owned + `WebSearchHandler`. It also has an optional, application-provided `ShellExecutor` + slot. `GatewayExecutorRegistration::Shell` is an explicit execution grant; an + unregistered shell declaration remains client-executed. `ShellExecutor` accepts + a typed call with bounded action limits and cancellation and returns typed command + outputs. The adapter binds into the existing gateway scheduler, not a second tool loop. + Client-owned tools (`function`, `custom`, `namespace`) never touch this file; their registry entries are inserted with `ToolOwnership::Client` and no `GatewayExecutors` involvement. +Shell item history is preserved publicly in storage. At the inference boundary, +`ShellHandler::model_input` lowers shell calls and outputs into matching function +history, just as declarations and explicit shell selectors are normalized. For an +opt-in gateway executor, storage additionally retains the canonical internal function +call/output pair; rehydration omits that pair's public shell-call projection to avoid +replaying the invocation twice. Client-executed shell history is not omitted. + **To add a new tool type:** 1. Implement `ToolHandler`, including its typed `ToolParams`, for it. If it's client-executed, stop there — see `function.rs`/`custom.rs` for the pattern. diff --git a/Cargo.lock b/Cargo.lock index a8ad0af8..bb037842 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -91,6 +91,7 @@ dependencies = [ "sse-stream", "thiserror", "tokio", + "tokio-util", "tracing", "url", "utoipa", @@ -3627,6 +3628,7 @@ dependencies = [ "bytes", "futures-core", "futures-sink", + "futures-util", "libc", "pin-project-lite", "tokio", diff --git a/crates/agentic-server-core/Cargo.toml b/crates/agentic-server-core/Cargo.toml index b00d6e5a..543eb24f 100644 --- a/crates/agentic-server-core/Cargo.toml +++ b/crates/agentic-server-core/Cargo.toml @@ -42,6 +42,7 @@ serde_json.workspace = true sse-stream.workspace = true thiserror.workspace = true tokio = { workspace = true, features = ["time"] } +tokio-util = { workspace = true, features = ["rt"] } tracing.workspace = true url.workspace = true diff --git a/crates/agentic-server-core/src/events/normalize.rs b/crates/agentic-server-core/src/events/normalize.rs index 86f365e2..5de51ada 100644 --- a/crates/agentic-server-core/src/events/normalize.rs +++ b/crates/agentic-server-core/src/events/normalize.rs @@ -1,6 +1,7 @@ use serde_json::Value; -use super::types::{EventFrame, EventPayload, SSEEventType, SSEItemType, WireEvent}; +use super::types::{EventFrame, EventPayload, SSEEventType, SSEItemType, ShellCommandUpdate, WireEvent}; +use crate::types::io::OutputItem; use crate::utils::common::{deserialize_from_str_opt, deserialize_from_value_opt}; /// Normalize a raw SSE data line into a typed [`EventFrame`]. @@ -64,6 +65,9 @@ fn extract_payload(event_type: SSEEventType, json: &Value) -> EventPayload { SSEEventType::FunctionCallArgumentsDone => extract_fn_call_args_done(json), SSEEventType::CustomToolCallInputDelta => extract_custom_tool_call_input_delta(json), SSEEventType::CustomToolCallInputDone => extract_custom_tool_call_input_done(json), + SSEEventType::ShellCallCommandAdded => extract_shell_call_command_added(json), + SSEEventType::ShellCallCommandDelta => extract_shell_call_command_delta(json), + SSEEventType::ShellCallCommandDone => extract_shell_call_command_done(json), SSEEventType::ReasoningTextDelta => extract_reasoning_text_delta(json), SSEEventType::ReasoningTextDone => extract_reasoning_text_done(json), @@ -133,6 +137,14 @@ fn extract_output_item_added(json: &Value) -> EventPayload { name: json_str_opt(item, "name"), namespace: json_str_opt(item, "namespace"), call_id: json_str_opt(item, "call_id"), + shell_call: if item["type"] == "shell_call" { + match deserialize_from_value_opt::(item.clone()) { + Some(OutputItem::ShellCall(call)) => Some(Box::new(call)), + _ => None, + } + } else { + None + }, } } @@ -169,6 +181,27 @@ fn extract_text_done(json: &Value) -> EventPayload { } } +fn extract_shell_call_command_added(json: &Value) -> EventPayload { + extract_shell_command(json, ShellCommandUpdate::Added(json_str(json, "command"))) +} + +fn extract_shell_call_command_delta(json: &Value) -> EventPayload { + extract_shell_command(json, ShellCommandUpdate::Delta(json_str(json, "delta"))) +} + +fn extract_shell_call_command_done(json: &Value) -> EventPayload { + extract_shell_command(json, ShellCommandUpdate::Done(json_str(json, "command"))) +} + +fn extract_shell_command(json: &Value, update: ShellCommandUpdate) -> EventPayload { + EventPayload::ShellCallCommand { + item_id: json_str(json, "item_id"), + output_index: json_u32(json, "output_index"), + command_index: json_u32(json, "command_index"), + update, + } +} + fn extract_fn_call_args_delta(json: &Value) -> EventPayload { EventPayload::FunctionCallArgsDelta { delta: json_str(json, "delta"), diff --git a/crates/agentic-server-core/src/events/types.rs b/crates/agentic-server-core/src/events/types.rs index 425a1ae9..2e5901c7 100644 --- a/crates/agentic-server-core/src/events/types.rs +++ b/crates/agentic-server-core/src/events/types.rs @@ -1,7 +1,7 @@ use serde::{Deserialize, Serialize}; use serde_json::{Map, Value}; -use crate::types::io::{OutputItem, ResponseUsage}; +use crate::types::io::{OutputItem, ResponseUsage, ShellCall}; /// The type of an output item received during streaming. #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -13,6 +13,7 @@ pub enum SSEItemType { WebSearchCall, McpCall, McpListTools, + ShellCall, Compaction, Message, } @@ -28,6 +29,7 @@ impl SSEItemType { Self::WebSearchCall => "web_search_call", Self::McpCall => "mcp_call", Self::McpListTools => "mcp_list_tools", + Self::ShellCall => "shell_call", Self::Compaction => "compaction", Self::Message => "message", } @@ -52,6 +54,7 @@ impl std::str::FromStr for SSEItemType { "web_search_call" => Ok(Self::WebSearchCall), "mcp_call" => Ok(Self::McpCall), "mcp_list_tools" => Ok(Self::McpListTools), + "shell_call" => Ok(Self::ShellCall), "compaction" => Ok(Self::Compaction), "message" => Ok(Self::Message), _ => Err(()), @@ -71,6 +74,7 @@ impl TryFrom<&OutputItem> for SSEItemType { OutputItem::WebSearchCall(_) => Ok(Self::WebSearchCall), OutputItem::McpCall(_) => Ok(Self::McpCall), OutputItem::McpListTools(_) => Ok(Self::McpListTools), + OutputItem::ShellCall(_) => Ok(Self::ShellCall), OutputItem::Reasoning(_) => Ok(Self::Reasoning), OutputItem::Compaction(_) => Ok(Self::Compaction), OutputItem::Unknown => Err(()), @@ -125,6 +129,9 @@ pub enum SSEEventType { FunctionCallArgumentsDone, CustomToolCallInputDelta, CustomToolCallInputDone, + ShellCallCommandAdded, + ShellCallCommandDelta, + ShellCallCommandDone, // Reasoning ReasoningTextDelta, @@ -171,6 +178,9 @@ impl From<&str> for SSEEventType { "response.function_call_arguments.done" => Self::FunctionCallArgumentsDone, "response.custom_tool_call_input.delta" => Self::CustomToolCallInputDelta, "response.custom_tool_call_input.done" => Self::CustomToolCallInputDone, + "response.shell_call_command.added" => Self::ShellCallCommandAdded, + "response.shell_call_command.delta" => Self::ShellCallCommandDelta, + "response.shell_call_command.done" => Self::ShellCallCommandDone, "response.reasoning_text.delta" => Self::ReasoningTextDelta, "response.reasoning_text.done" => Self::ReasoningTextDone, "response.reasoning_part.added" => Self::ReasoningPartAdded, @@ -215,6 +225,9 @@ impl TryFrom for &'static str { SSEEventType::FunctionCallArgumentsDone => Ok("response.function_call_arguments.done"), SSEEventType::CustomToolCallInputDelta => Ok("response.custom_tool_call_input.delta"), SSEEventType::CustomToolCallInputDone => Ok("response.custom_tool_call_input.done"), + SSEEventType::ShellCallCommandAdded => Ok("response.shell_call_command.added"), + SSEEventType::ShellCallCommandDelta => Ok("response.shell_call_command.delta"), + SSEEventType::ShellCallCommandDone => Ok("response.shell_call_command.done"), SSEEventType::ReasoningTextDelta => Ok("response.reasoning_text.delta"), SSEEventType::ReasoningTextDone => Ok("response.reasoning_text.done"), SSEEventType::ReasoningPartAdded => Ok("response.reasoning_part.added"), @@ -276,6 +289,14 @@ impl WireEvent { } } +/// One command's incremental lifecycle within a shell output item. +#[derive(Debug, Clone)] +pub enum ShellCommandUpdate { + Added(String), + Delta(String), + Done(String), +} + /// Typed payload extracted from an SSE event's JSON data. #[derive(Debug, Clone)] #[non_exhaustive] @@ -296,6 +317,8 @@ pub enum EventPayload { name: Option, namespace: Option, call_id: Option, + /// Preserve the typed initial shell item before command events arrive. + shell_call: Option>, }, /// `response.output_item.done` @@ -339,6 +362,12 @@ pub enum EventPayload { }, /// `response.custom_tool_call_input.delta` + ShellCallCommand { + item_id: String, + output_index: u32, + command_index: u32, + update: ShellCommandUpdate, + }, CustomToolCallInputDelta { delta: String, item_id: String, @@ -468,6 +497,9 @@ mod tests { SSEEventType::FunctionCallArgumentsDone, SSEEventType::CustomToolCallInputDelta, SSEEventType::CustomToolCallInputDone, + SSEEventType::ShellCallCommandAdded, + SSEEventType::ShellCallCommandDelta, + SSEEventType::ShellCallCommandDone, SSEEventType::ReasoningTextDelta, SSEEventType::ReasoningTextDone, SSEEventType::ReasoningPartAdded, diff --git a/crates/agentic-server-core/src/events/validate.rs b/crates/agentic-server-core/src/events/validate.rs index d6fbfca6..b4a40262 100644 --- a/crates/agentic-server-core/src/events/validate.rs +++ b/crates/agentic-server-core/src/events/validate.rs @@ -49,7 +49,7 @@ pub(crate) fn validate_frame(frame: &EventFrame) -> Result, E SSEEventType::Other => Ok(ValidatedFrame { item: None }), event_type => { let output_index = required_output_index(frame, event_name)?; - let item_id = required_str(&frame.wire.rest, "item_id", event_name)?; + let item_id = validate_event_item_id(frame, event_name)?; validate_event_fields(&frame.wire.rest, event_type, event_name)?; let item_type = expected_item_type(event_type).ok_or_else(|| { invalid(format!( @@ -80,6 +80,9 @@ fn expected_item_type(event_type: SSEEventType) -> Option { SSEEventType::CustomToolCallInputDelta | SSEEventType::CustomToolCallInputDone => { Some(SSEItemType::CustomToolCall) } + SSEEventType::ShellCallCommandAdded + | SSEEventType::ShellCallCommandDelta + | SSEEventType::ShellCallCommandDone => Some(SSEItemType::ShellCall), SSEEventType::ReasoningTextDelta | SSEEventType::ReasoningTextDone | SSEEventType::ReasoningPartAdded @@ -192,12 +195,30 @@ fn validate_output_item<'a>( }) } +fn validate_event_item_id<'a>(frame: &'a EventFrame, event_name: &str) -> Result<&'a str, EventError> { + if matches!( + frame.event_type, + SSEEventType::ShellCallCommandAdded | SSEEventType::ShellCallCommandDelta | SSEEventType::ShellCallCommandDone + ) && !frame.wire.rest.contains_key("item_id") + { + // Only native shell command events may omit the ID and resolve by output_index. + return Ok(""); + } + let item_id = required_str(&frame.wire.rest, "item_id", event_name)?; + Ok(item_id) +} + fn validate_event_fields( event: &Map, event_type: SSEEventType, event_name: &str, ) -> Result<(), EventError> { match event_type { + SSEEventType::ShellCallCommandAdded + | SSEEventType::ShellCallCommandDelta + | SSEEventType::ShellCallCommandDone => { + required_u32(event, "command_index", event_name)?; + } SSEEventType::OutputTextDelta | SSEEventType::OutputTextDone | SSEEventType::ContentPartAdded @@ -218,6 +239,7 @@ fn validate_event_fields( SSEEventType::OutputTextDelta | SSEEventType::FunctionCallArgumentsDelta | SSEEventType::CustomToolCallInputDelta + | SSEEventType::ShellCallCommandDelta | SSEEventType::ReasoningTextDelta | SSEEventType::ReasoningSummaryTextDelta | SSEEventType::McpCallArgumentsDelta => Some("delta"), @@ -226,6 +248,7 @@ fn validate_event_fields( } SSEEventType::FunctionCallArgumentsDone | SSEEventType::McpCallArgumentsDone => Some("arguments"), SSEEventType::CustomToolCallInputDone => Some("input"), + SSEEventType::ShellCallCommandAdded | SSEEventType::ShellCallCommandDone => Some("command"), SSEEventType::ContentPartAdded | SSEEventType::ContentPartDone | SSEEventType::ReasoningPartAdded @@ -308,3 +331,48 @@ fn missing_field(owner: &str, field: &str) -> EventError { fn invalid(message: impl Into) -> EventError { EventError(message.into()) } + +#[cfg(test)] +mod tests { + use serde_json::json; + + use super::validate_frame; + use crate::events::normalize_sse_line; + + #[test] + fn only_native_shell_command_events_allow_omitted_item_id() { + for (event_type, allows_omitted_id) in [ + ("response.shell_call_command.added", true), + ("response.shell_call_command.delta", true), + ("response.shell_call_command.done", true), + ("response.function_call_arguments.delta", false), + ("response.function_call_arguments.done", false), + ("response.custom_tool_call_input.delta", false), + ("response.custom_tool_call_input.done", false), + ("response.mcp_call_arguments.delta", false), + ] { + let event = json!({ + "type": event_type, + "output_index": 0, + "command_index": 0, + "command": "pwd", + "delta": "", + "arguments": "{}", + "input": "pwd" + }); + let frame = normalize_sse_line(&format!("data: {event}")).unwrap(); + assert_eq!(validate_frame(&frame).is_ok(), allows_omitted_id, "{event_type}"); + + for item_id in [json!(""), json!(null), json!(42), json!("sh_1")] { + let mut event = event.clone(); + event["item_id"] = item_id.clone(); + let frame = normalize_sse_line(&format!("data: {event}")).unwrap(); + assert_eq!( + validate_frame(&frame).is_ok(), + item_id == json!("sh_1"), + "{event_type} with item_id={item_id}" + ); + } + } + } +} diff --git a/crates/agentic-server-core/src/executor/accumulator.rs b/crates/agentic-server-core/src/executor/accumulator.rs index ea8495a4..ec4005bd 100644 --- a/crates/agentic-server-core/src/executor/accumulator.rs +++ b/crates/agentic-server-core/src/executor/accumulator.rs @@ -16,6 +16,7 @@ use indexmap::IndexMap; use futures::{Stream, StreamExt}; +use crate::events::types::ShellCommandUpdate; use crate::events::{ EventFrame, EventPayload, SSEEventType, SSEItemType, ValidatedFrame, is_data_frame, normalize_sse_line, output_item_identity, validate_frame, @@ -26,7 +27,7 @@ use crate::types::event::{MessageStatus, ResponseStatus}; use crate::types::io::output::McpListTools; use crate::types::io::{ ApplyDone, CompactionItem, CustomToolCall, FunctionToolCall, OutputItem, OutputMessage, OutputTextContent, - ReasoningOutput, ResponseUsage, ToolSearchCall, + ReasoningOutput, ResponseUsage, ShellCall, ToolSearchCall, }; use crate::types::io::{McpCall, WebSearchCall}; use crate::types::request_response::{IncompleteDetails, ResponsePayload}; @@ -37,15 +38,41 @@ use crate::utils::uuid7_str; /// accumulated text/arguments buffer. #[derive(Clone)] enum InFlight { - Message { item: OutputMessage, text: String }, - Reasoning { item: ReasoningOutput }, - FunctionCall { item: FunctionToolCall, arguments: String }, - ToolSearchCall { item: ToolSearchCall }, - CustomToolCall { item: CustomToolCall, input: String }, - WebSearchCall { item: Option }, - McpCall { item: McpCall }, - McpListTools { item: McpListTools }, - Compaction { item: CompactionItem }, + Message { + item: OutputMessage, + text: String, + }, + Reasoning { + item: ReasoningOutput, + }, + FunctionCall { + item: FunctionToolCall, + arguments: String, + }, + ToolSearchCall { + item: ToolSearchCall, + }, + CustomToolCall { + item: CustomToolCall, + input: String, + }, + ShellCall { + item: ShellCall, + command_stream: Option>, + command: String, + }, + WebSearchCall { + item: Option, + }, + McpCall { + item: McpCall, + }, + McpListTools { + item: McpListTools, + }, + Compaction { + item: CompactionItem, + }, } impl std::fmt::Debug for InFlight { @@ -56,6 +83,7 @@ impl std::fmt::Debug for InFlight { Self::FunctionCall { .. } => write!(f, "InFlight::FunctionCall {{ .. }}"), Self::ToolSearchCall { .. } => write!(f, "InFlight::ToolSearchCall {{ .. }}"), Self::CustomToolCall { .. } => write!(f, "InFlight::CustomToolCall {{ .. }}"), + Self::ShellCall { .. } => write!(f, "InFlight::ShellCall {{ .. }}"), Self::WebSearchCall { .. } => write!(f, "InFlight::WebSearchCall {{ .. }}"), Self::McpCall { .. } => write!(f, "InFlight::McpCall {{ .. }}"), Self::McpListTools { .. } => write!(f, "InFlight::McpListTools {{ .. }}"), @@ -91,6 +119,7 @@ impl InFlight { Some(OutputItem::CustomToolCall(item)) } Self::WebSearchCall { item } => item.map(OutputItem::WebSearchCall), + Self::ShellCall { item, .. } => Some(OutputItem::ShellCall(item)), Self::McpCall { item } => Some(OutputItem::McpCall(item)), Self::McpListTools { item } => Some(OutputItem::McpListTools(item)), Self::Compaction { item } => Some(OutputItem::Compaction(item)), @@ -716,6 +745,9 @@ impl ResponseAccumulator { (SSEEventType::FunctionCallArgumentsDelta | SSEEventType::FunctionCallArgumentsDone, _) => { self.process_function_event(&frame.payload, event_name, output_index_is_explicit, strict)?; } + (_, payload @ EventPayload::ShellCallCommand { .. }) => { + self.process_shell_command(payload, event_name, output_index_is_explicit, resolve_policy)?; + } (SSEEventType::CustomToolCallInputDelta | SSEEventType::CustomToolCallInputDone, payload) => { self.process_custom_tool_event(payload, event_name, output_index_is_explicit, resolve_policy)?; } @@ -792,6 +824,71 @@ impl ResponseAccumulator { Ok(()) } + fn process_shell_command( + &mut self, + payload: &EventPayload, + event_name: &str, + output_index_is_explicit: bool, + resolve_policy: ResolvePolicy, + ) -> ExecutorResult<()> { + let EventPayload::ShellCallCommand { + item_id, + output_index, + command_index, + update, + } = payload + else { + return Ok(()); + }; + let Some(entry) = self.resolve_active( + *output_index, + item_id, + SSEItemType::ShellCall, + event_name, + output_index_is_explicit, + resolve_policy, + )? + else { + return Ok(()); + }; + let InFlight::ShellCall { + item, + command_stream, + command: buffer, + } = &mut entry.item + else { + return Ok(()); + }; + let done = command_stream.get_or_insert_with(Vec::new); + let index = *command_index as usize; + match update { + ShellCommandUpdate::Added(command) => { + if index != done.len() || item.action.commands.len() != done.len() || done.last() == Some(&false) { + return Err(invalid_stream("shell command added out of order")); + } + item.action.commands.push(String::new()); + buffer.clone_from(command); + done.push(false); + } + ShellCommandUpdate::Delta(delta) => { + if done.get(index) != Some(&false) { + return Err(invalid_stream("shell command delta has no active command")); + } + buffer.push_str(delta); + } + ShellCommandUpdate::Done(command) => { + if done.get(index) != Some(&false) || *buffer != *command { + return Err(invalid_stream( + "shell command done is repeated or contradicts streamed command", + )); + } + item.apply_done(payload, buffer); + done[index] = true; + } + } + Ok(()) + } + fn process_custom_tool_event( &mut self, payload: &EventPayload, @@ -946,6 +1043,11 @@ impl ResponseAccumulator { .ok() .map(|item| InFlight::Compaction { item }), SSEItemType::WebSearchCall => None, + SSEItemType::ShellCall => ShellCall::try_from(payload).ok().map(|item| InFlight::ShellCall { + item, + command_stream: None, + command: String::new(), + }), SSEItemType::McpCall => McpCall::try_from(payload).ok().map(|item| InFlight::McpCall { item }), SSEItemType::McpListTools => McpListTools::try_from(payload) .ok() @@ -1027,6 +1129,21 @@ impl ResponseAccumulator { output_index_is_explicit, resolve_policy, )? { + if let InFlight::ShellCall { + item, + command_stream: Some(done), + .. + } = &entry.item + { + if done.iter().any(|complete| !complete) + || !matches!(&parsed_done_item, Some(OutputItem::ShellCall(final_item)) + if final_item.action.commands == item.action.commands) + { + return Err(invalid_stream( + "shell item done has unfinished or contradictory commands", + )); + } + } let mut candidate = entry.item.clone(); apply_output_item_done(&mut candidate, payload, parsed_done_item.as_ref(), &entry.item_id); let candidate_done = candidate.clone().finalize(); @@ -1063,6 +1180,7 @@ impl ResponseAccumulator { | OutputItem::FunctionCall(_) | OutputItem::ToolSearchCall(_) | OutputItem::CustomToolCall(_) + | OutputItem::ShellCall(_) | OutputItem::WebSearchCall(_) | OutputItem::McpCall(_) | OutputItem::McpListTools(_) @@ -1119,6 +1237,8 @@ impl ResponseAccumulator { } } +// Keep each output-item completion in the same transition dispatcher. +#[allow(clippy::too_many_lines)] fn apply_output_item_done( in_flight: &mut InFlight, payload: &EventPayload, @@ -1206,6 +1326,7 @@ fn apply_output_item_done( } *item = Some(done); } + (InFlight::ShellCall { item, .. }, Some(OutputItem::ShellCall(done))) => item.clone_from(done), (InFlight::McpCall { item }, Some(OutputItem::McpCall(done))) => item.clone_from(done), (InFlight::McpListTools { item }, Some(OutputItem::McpListTools(done))) => item.clone_from(done), (InFlight::Compaction { item }, Some(OutputItem::Compaction(done))) => { @@ -1216,6 +1337,7 @@ fn apply_output_item_done( *item = done; } (InFlight::Reasoning { item }, None) => item.apply_done(payload, &mut String::new()), + (InFlight::ShellCall { item, command, .. }, None) => item.apply_done(payload, command), (InFlight::FunctionCall { item, arguments }, None) => item.apply_done(payload, arguments), (InFlight::ToolSearchCall { item }, None) => item.apply_done(payload, &mut String::new()), (InFlight::CustomToolCall { item, input }, None) => item.apply_done(payload, input), @@ -1231,6 +1353,7 @@ fn output_item_call_id(item: &OutputItem) -> Option<&str> { OutputItem::FunctionCall(call) => Some(&call.call_id), OutputItem::ToolSearchCall(call) => Some(&call.call_id), OutputItem::CustomToolCall(call) => Some(&call.call_id), + OutputItem::ShellCall(call) => Some(&call.call_id), _ => None, } } @@ -1423,6 +1546,7 @@ mod tests { acc.process_event(&EventFrame { event_type: SSEEventType::OutputItemAdded, payload: EventPayload::OutputItemAdded { + shell_call: None, item_id: "msg_1".into(), item_type: "message".into(), output_index: 0, @@ -2276,6 +2400,7 @@ mod tests { acc.process_event(&EventFrame { event_type: SSEEventType::OutputItemAdded, payload: EventPayload::OutputItemAdded { + shell_call: None, item_id: "fc_1".into(), item_type: "function_call".into(), output_index: 0, @@ -2351,6 +2476,7 @@ mod tests { acc.process_event(&EventFrame { event_type: SSEEventType::OutputItemAdded, payload: EventPayload::OutputItemAdded { + shell_call: None, item_id: "fc_1".into(), item_type: "function_call".into(), output_index: 0, @@ -2400,6 +2526,7 @@ mod tests { acc.process_event(&EventFrame { event_type: SSEEventType::OutputItemAdded, payload: EventPayload::OutputItemAdded { + shell_call: None, item_id: "fc_1".into(), item_type: "function_call".into(), output_index: 0, @@ -2424,6 +2551,7 @@ mod tests { acc.process_event(&EventFrame { event_type: SSEEventType::OutputItemAdded, payload: EventPayload::OutputItemAdded { + shell_call: None, item_id: "fc_2".into(), item_type: "function_call".into(), output_index: 1, @@ -2467,6 +2595,7 @@ mod tests { acc.process_event(&EventFrame { event_type: SSEEventType::OutputItemAdded, payload: EventPayload::OutputItemAdded { + shell_call: None, item_id: "msg_1".into(), item_type: "message".into(), output_index: 0, @@ -2490,6 +2619,7 @@ mod tests { acc.process_event(&EventFrame { event_type: SSEEventType::OutputItemAdded, payload: EventPayload::OutputItemAdded { + shell_call: None, item_id: "fc_1".into(), item_type: "function_call".into(), output_index: 1, @@ -2533,6 +2663,7 @@ mod tests { acc.process_event(&EventFrame { event_type: SSEEventType::OutputItemAdded, payload: EventPayload::OutputItemAdded { + shell_call: None, item_id: "fc_1".into(), item_type: "function_call".into(), output_index: 0, @@ -2628,6 +2759,7 @@ mod tests { acc.process_event(&EventFrame { event_type: SSEEventType::OutputItemAdded, payload: EventPayload::OutputItemAdded { + shell_call: None, item_id: String::new(), item_type: "function_call".into(), output_index: 0, @@ -2685,6 +2817,7 @@ mod tests { acc.process_event(&EventFrame { event_type: SSEEventType::OutputItemAdded, payload: EventPayload::OutputItemAdded { + shell_call: None, item_id: "fc_1".into(), item_type: "function_call".into(), output_index: 0, diff --git a/crates/agentic-server-core/src/executor/compaction.rs b/crates/agentic-server-core/src/executor/compaction.rs index 9825a5b0..bd0a781c 100644 --- a/crates/agentic-server-core/src/executor/compaction.rs +++ b/crates/agentic-server-core/src/executor/compaction.rs @@ -157,6 +157,8 @@ fn item_has_meaningful_context(item: &InputItem) -> bool { InputItem::ToolSearchOutput(output) => !output.call_id.trim().is_empty() || !output.tools.is_empty(), InputItem::CustomToolCall(call) => !call.name.trim().is_empty() || !call.input.trim().is_empty(), InputItem::CustomToolCallOutput(output) => output.output.has_content(), + InputItem::ShellCall(call) => !call.action.commands.is_empty(), + InputItem::ShellCallOutput(output) => !output.output.is_empty(), InputItem::Reasoning(reasoning) => { reasoning.content.iter().any(|content| !content.text.trim().is_empty()) || reasoning.summary.iter().any(value_has_content) @@ -293,6 +295,13 @@ fn add_input_item(estimate: &mut InputTokenEstimate, item: &InputItem) { estimate.add_optional_text(output.name.as_deref()); add_tool_call_output(estimate, &output.output); } + InputItem::ShellCall(_) | InputItem::ShellCallOutput(_) => { + // Shell items carry textual commands and outputs, without image payloads. + match serialize_to_value(item) { + Ok(value) => estimate.add_json_value(&value), + Err(_) => estimate.add_tokens(u64::MAX), + } + } InputItem::Reasoning(reasoning) => { estimate.add_text(&reasoning.id); estimate.add_optional_text(reasoning.status.as_deref()); @@ -925,6 +934,27 @@ mod tests { ]); } + #[test] + fn shell_commands_and_outputs_increase_token_estimates() { + let long_text = "shell context ".repeat(256); + assert_text_growth([ + ( + "shell commands", + serde_json::json!([{"type": "shell_call", "call_id": "c1", "action": {"commands": ["x"]}}]), + serde_json::json!([{"type": "shell_call", "call_id": "c1", "action": {"commands": [long_text]}}]), + ), + ( + "shell output", + serde_json::json!([{"type": "shell_call_output", "call_id": "c1", "output": [ + {"stdout": "x", "stderr": "", "outcome": {"type": "exit", "exit_code": 0}} + ]}]), + serde_json::json!([{"type": "shell_call_output", "call_id": "c1", "output": [ + {"stdout": long_text, "stderr": long_text, "outcome": {"type": "exit", "exit_code": 0}} + ]}]), + ), + ]); + } + #[test] fn reasoning_textual_fields_increase_estimates() { let long_text = "substantial reasoning context ".repeat(256); diff --git a/crates/agentic-server-core/src/executor/engine.rs b/crates/agentic-server-core/src/executor/engine.rs index b6a717a8..008257b9 100644 --- a/crates/agentic-server-core/src/executor/engine.rs +++ b/crates/agentic-server-core/src/executor/engine.rs @@ -267,7 +267,7 @@ async fn run_gateway_tool_loop( .map(|(accumulator, sender)| (&mut **accumulator, *sender)), ) .await?; - let public_output = public_output_items(¤t_output, ®istry, &gateway_results); + let public_output = public_output_items(¤t_output, ®istry, &gateway_results)?; combined_output.extend(public_output); // A terminal incomplete response may still contain completed gateway @@ -527,7 +527,7 @@ fn finalize_loop( payload.output = combined_output; payload.usage = combined_usage; ctx.inject_ids(payload); - if let Some(tools) = registry.tool_search_response_tools() { + if let Some(tools) = registry.response_tools(ctx.enriched_request.tools.as_deref()) { payload.tools = Some(tools); payload.tool_choice = Some(ctx.enriched_request.tool_choice.clone().unwrap_or_default()); } diff --git a/crates/agentic-server-core/src/executor/function_sse.rs b/crates/agentic-server-core/src/executor/function_sse.rs index 731950f7..4a4f7249 100644 --- a/crates/agentic-server-core/src/executor/function_sse.rs +++ b/crates/agentic-server-core/src/executor/function_sse.rs @@ -6,8 +6,8 @@ use crate::events::{EventFrame, EventPayload, SSEEventType, SSEItemType}; use crate::executor::accumulator::AccumulatedFunctionCall; use crate::executor::error::{ExecutorError, ExecutorResult}; use crate::executor::gateway_accumulator::synthetic_event; -use crate::tool::{ToolRegistry, ToolType, tool_search}; -use crate::types::io::OutputItem; +use crate::tool::{ShellHandler, ToolRegistry, ToolType, custom, shell, tool_search}; +use crate::types::io::{OutputItem, ShellCallAction, ShellCallStatus}; use crate::utils::common::{serialize_to_string, serialize_to_value}; const MAX_PENDING_FUNCTION_BYTES: usize = 256 * 1024; @@ -17,6 +17,7 @@ enum FunctionCallShape { PublicFunction, GatewayOwned, Custom(CustomCallState), + Shell(ShellCallState), ToolSearch { internal_item_id: String }, } @@ -50,6 +51,23 @@ struct CustomCallState { input_done: bool, } +#[derive(Debug)] +struct ShellCallState { + added: bool, + output_index: u32, + commands: Vec, + cursor: Option, + command_open: bool, + completion: ShellCommandsCompletion, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +enum ShellCommandsCompletion { + Streaming, + ArrayDone, + ArgumentsDone, +} + #[derive(Debug, Default)] struct PendingFunctionCall { output_index: u32, @@ -184,8 +202,8 @@ impl<'a> FunctionSseTranslator<'a> { match tool_type { ToolType::Custom => { let public_item_id = call.as_ref().map_or_else( - || crate::tool::custom::public_item_id(item_id), - |call| crate::tool::custom::public_item_id(&call.item.id), + || custom::public_item_id(item_id), + |call| custom::public_item_id(&call.item.id), ); self.active.insert( output_index, @@ -207,7 +225,32 @@ impl<'a> FunctionSseTranslator<'a> { defer_from_output_index: None, }) } - ToolType::Mcp | ToolType::WebSearch | ToolType::FileSearch | ToolType::CodeInterpreter => { + ToolType::Shell if !self.registry.is_gateway_owned_name(name) => { + self.active.insert( + output_index, + FunctionCallShape::Shell(ShellCallState { + added: call.is_some(), + output_index, + commands: Vec::new(), + cursor: None, + command_open: false, + completion: ShellCommandsCompletion::Streaming, + }), + ); + Ok(FunctionSseTranslation { + frames: call + .map(|call| shell_added_frame(&call)) + .transpose()? + .into_iter() + .collect(), + defer_from_output_index: None, + }) + } + ToolType::Shell + | ToolType::Mcp + | ToolType::WebSearch + | ToolType::FileSearch + | ToolType::CodeInterpreter => { if self.first_gateway_output_index.is_none_or(|first| output_index < first) { self.first_gateway_output_index = Some(output_index); } @@ -252,6 +295,13 @@ impl<'a> FunctionSseTranslator<'a> { defer_from_output_index: None, }), Some(FunctionCallShape::GatewayOwned) => Ok(FunctionSseTranslation::default()), + Some(FunctionCallShape::Shell(state)) => Ok(FunctionSseTranslation { + frames: match call { + Some(call) => incremental_shell_commands(state, call.arguments())?, + None => Vec::new(), + }, + defer_from_output_index: None, + }), Some(FunctionCallShape::Custom(state)) => { let frame = match call { Some(call) => incremental_custom_delta(state, call.arguments())?, @@ -284,6 +334,17 @@ impl<'a> FunctionSseTranslator<'a> { match self.active.get_mut(&output_index) { Some(FunctionCallShape::PublicFunction) | None => translated.frames.push(original), Some(FunctionCallShape::GatewayOwned) => {} + Some(FunctionCallShape::Shell(state)) => { + if let Some(call) = call { + if !state.added { + translated.frames.push(shell_added_frame(&call)?); + state.added = true; + } + translated + .frames + .extend(finish_shell_commands(state, call.arguments())?); + } + } Some(FunctionCallShape::Custom(state)) => { if let Some(call) = call { translated.frames.extend(finish_custom_input(state, call.arguments())?); @@ -310,6 +371,17 @@ impl<'a> FunctionSseTranslator<'a> { match self.active.remove(&output_index) { Some(FunctionCallShape::PublicFunction) | None => translated.frames.push(original), Some(FunctionCallShape::GatewayOwned) => {} + Some(FunctionCallShape::Shell(mut state)) => { + if let Some(call) = call { + if !state.added { + translated.frames.push(shell_added_frame(&call)?); + } + translated + .frames + .extend(finish_shell_commands(&mut state, call.arguments())?); + translated.frames.push(shell_done_frame(&call)?); + } + } Some(FunctionCallShape::Custom(mut state)) => { if let Some(call) = call { translated @@ -532,7 +604,10 @@ impl<'a> FunctionSseTranslator<'a> { fn unfinished_tool_search_item_ids(&self) -> HashSet { let active = self.active.values().filter_map(|shape| match shape { FunctionCallShape::ToolSearch { internal_item_id } => Some(internal_item_id.clone()), - FunctionCallShape::PublicFunction | FunctionCallShape::GatewayOwned | FunctionCallShape::Custom(_) => None, + FunctionCallShape::PublicFunction + | FunctionCallShape::GatewayOwned + | FunctionCallShape::Custom(_) + | FunctionCallShape::Shell(_) => None, }); let pending = self .registry @@ -654,7 +729,7 @@ fn custom_added_frame(call: &AccumulatedFunctionCall<'_>) -> ExecutorResult) -> ExecutorResult) -> ExecutorResult { + custom_frame( + SSEEventType::OutputItemAdded, + call.output_index, + [( + "item".to_owned(), + serde_json::json!({ + "type": "shell_call", + "id": shell::public_item_id(&call.item.id), + "call_id": call.item.call_id, + "status": "in_progress", + "action": {"commands": [], "timeout_ms": null, "max_output_length": null} + }), + )], + ) +} + +fn shell_done_frame(call: &AccumulatedFunctionCall<'_>) -> ExecutorResult { + shell_frame( + SSEEventType::OutputItemDone, + call.output_index, + call.item.status.into(), + call, + ) +} + +fn shell_frame( + event_type: SSEEventType, + output_index: u32, + status: ShellCallStatus, + call: &AccumulatedFunctionCall<'_>, +) -> ExecutorResult { + let item = ShellHandler::output_item_with_status(call.item, status).ok_or_else(|| { + ExecutorError::StreamError("shell function call contains invalid action arguments".to_owned()) + })?; + let item = serde_json::to_value(item).map_err(ExecutorError::JsonError)?; + let mut frame = synthetic_event(event_type, [("item".to_owned(), item)])?; + frame.wire.output_index = Some(u64::from(output_index)); + Ok(frame) +} + +fn shell_command_frame( + event_type: SSEEventType, + output_index: u32, + command_index: usize, + value: &str, +) -> ExecutorResult { + let field = if event_type == SSEEventType::ShellCallCommandDelta { + "delta" + } else { + "command" + }; + custom_frame( + event_type, + output_index, + [ + ("command_index".to_owned(), Value::from(command_index)), + (field.to_owned(), Value::String(value.to_owned())), + ], + ) +} + +/// Find a top-level array field, skipping complete preceding values with serde. +/// The command strings themselves use the same incremental JSON string decoder +/// as custom tool input, including split escapes and Unicode surrogate pairs. +fn shell_commands_start(arguments: &str) -> Option { + let mut rest = arguments.trim_start().strip_prefix('{')?.trim_start(); + loop { + let mut key = serde_json::Deserializer::from_str(rest).into_iter::(); + let name = key.next()?.ok()?; + rest = rest[key.byte_offset()..].trim_start().strip_prefix(':')?.trim_start(); + if name == "commands" { + let array = rest.strip_prefix('[')?; + return Some(arguments.len() - array.len()); + } + let mut value = serde_json::Deserializer::from_str(rest).into_iter::(); + value.next()?.ok()?; + rest = rest[value.byte_offset()..].trim_start().strip_prefix(',')?.trim_start(); + } +} + +fn incremental_shell_commands(state: &mut ShellCallState, arguments: &str) -> ExecutorResult> { + ensure_function_call_size(arguments)?; + if state.completion != ShellCommandsCompletion::Streaming { + return Ok(Vec::new()); + } + let Some(mut cursor) = state.cursor.or_else(|| shell_commands_start(arguments)) else { + return Ok(Vec::new()); + }; + let mut frames = Vec::new(); + loop { + if !state.command_open { + while arguments.as_bytes().get(cursor).is_some_and(u8::is_ascii_whitespace) { + cursor += 1; + } + if !state.commands.is_empty() { + match arguments.as_bytes().get(cursor) { + Some(b',') => { + // Do not consume the separator until the next string is available. + let rest = arguments[cursor + 1..].trim_start(); + if rest.is_empty() { + break; + } + cursor = arguments.len() - rest.len(); + } + Some(b']') => { + state.completion = ShellCommandsCompletion::ArrayDone; + break; + } + None => break, + _ => { + return Err(ExecutorError::StreamError( + "invalid shell commands array separator".to_owned(), + )); + } + } + } else if arguments.as_bytes().get(cursor) == Some(&b']') { + state.completion = ShellCommandsCompletion::ArrayDone; + break; + } + match arguments.as_bytes().get(cursor) { + Some(b'"') => { + frames.push(shell_command_frame( + SSEEventType::ShellCallCommandAdded, + state.output_index, + state.commands.len(), + "", + )?); + state.commands.push(String::new()); + state.command_open = true; + cursor += 1; + } + None => break, + _ => { + return Err(ExecutorError::StreamError( + "shell command must be a JSON string".to_owned(), + )); + } + } + } + let encoded = arguments + .get(cursor..) + .ok_or_else(|| ExecutorError::StreamError("shell arguments changed while streaming".to_owned()))?; + let length = complete_json_string_prefix(encoded); + if length != 0 { + let delta: String = serde_json::from_str(&format!("\"{}\"", &encoded[..length])) + .map_err(|error| ExecutorError::StreamError(format!("invalid shell command string: {error}")))?; + let index = state.commands.len() - 1; + state.commands[index].push_str(&delta); + frames.push(shell_command_frame( + SSEEventType::ShellCallCommandDelta, + state.output_index, + index, + &delta, + )?); + cursor += length; + } + if arguments.as_bytes().get(cursor) != Some(&b'"') { + break; + } + let index = state.commands.len() - 1; + frames.push(shell_command_frame( + SSEEventType::ShellCallCommandDone, + state.output_index, + index, + &state.commands[index], + )?); + state.command_open = false; + cursor += 1; + } + state.cursor = Some(cursor); + Ok(frames) +} + +fn finish_shell_commands(state: &mut ShellCallState, arguments: &str) -> ExecutorResult> { + ensure_function_call_size(arguments)?; + let action: ShellCallAction = serde_json::from_str(arguments).map_err(|error| { + ExecutorError::StreamError(format!( + "shell function call contains invalid action arguments: {error}" + )) + })?; + if state.commands.len() > action.commands.len() + || (state.completion == ShellCommandsCompletion::ArgumentsDone && state.commands != action.commands) + { + return Err(ExecutorError::StreamError( + "authoritative shell action contradicts streamed commands".to_owned(), + )); + } + let mut frames = Vec::new(); + for (index, command) in action.commands.iter().enumerate() { + if let Some(emitted) = state.commands.get(index) { + let open = state.command_open && index + 1 == state.commands.len(); + if !command.starts_with(emitted) || (!open && command != emitted) { + return Err(ExecutorError::StreamError( + "authoritative shell action contradicts streamed commands".to_owned(), + )); + } + if !open { + continue; + } + } else { + frames.push(shell_command_frame( + SSEEventType::ShellCallCommandAdded, + state.output_index, + index, + "", + )?); + state.commands.push(String::new()); + } + let remaining = &command[state.commands[index].len()..]; + if !remaining.is_empty() { + frames.push(shell_command_frame( + SSEEventType::ShellCallCommandDelta, + state.output_index, + index, + remaining, + )?); + } + frames.push(shell_command_frame( + SSEEventType::ShellCallCommandDone, + state.output_index, + index, + command, + )?); + state.commands[index].clone_from(command); + state.command_open = false; + } + state.completion = ShellCommandsCompletion::ArgumentsDone; + Ok(frames) +} + fn incremental_custom_delta(state: &mut CustomCallState, arguments: &str) -> ExecutorResult> { ensure_function_call_size(arguments)?; let Some(delta) = partial_custom_input(state, arguments)? else { @@ -687,7 +993,7 @@ fn finish_custom_input(state: &mut CustomCallState, arguments: &str) -> Executor return Ok(Vec::new()); } ensure_function_call_size(arguments)?; - let input = crate::tool::custom::input_from_arguments(arguments); + let input = custom::input_from_arguments(arguments); let Some(remaining) = input.strip_prefix(&state.emitted_input) else { return Err(ExecutorError::StreamError( "authoritative custom tool input contradicts streamed custom tool input".to_owned(), @@ -1136,6 +1442,154 @@ mod tests { assert_eq!(translated.defer_from_output_index, None); } + #[test] + fn shell_function_arguments_restore_openai_shell_lifecycle() { + let mut accumulator = ResponseAccumulator::new("resp_1".to_owned(), None); + let registry = test_registry(HashMap::from([("shell".to_owned(), ToolType::Shell)])); + let mut translator = FunctionSseTranslator::new(®istry); + let events = [ + serde_json::json!({ + "type": "response.output_item.added", "output_index": 0, + "item": {"id": "fc_shell", "type": "function_call", "call_id": "call_shell", + "name": "shell", "arguments": "", "status": "in_progress"} + }), + serde_json::json!({ + "type": "response.function_call_arguments.delta", "output_index": 0, + "item_id": "fc_shell", "call_id": "call_shell", + "delta": "{\"commands\":[\"pwd\"],\"timeout_ms\":1000}" + }), + serde_json::json!({ + "type": "response.function_call_arguments.done", "output_index": 0, + "item_id": "fc_shell", "call_id": "call_shell", "name": "shell", + "arguments": "{\"commands\":[\"pwd\"],\"timeout_ms\":1000}" + }), + serde_json::json!({ + "type": "response.output_item.done", "output_index": 0, + "item": {"id": "fc_shell", "type": "function_call", "call_id": "call_shell", + "name": "shell", "arguments": "{\"commands\":[\"pwd\"],\"timeout_ms\":1000}", + "status": "completed"} + }), + ]; + + let frames = events + .iter() + .flat_map(|event| translate(&mut accumulator, &mut translator, event).frames) + .collect::>(); + + assert_eq!( + frames.iter().map(|frame| frame.event_type).collect::>(), + [ + SSEEventType::OutputItemAdded, + SSEEventType::ShellCallCommandAdded, + SSEEventType::ShellCallCommandDelta, + SSEEventType::ShellCallCommandDone, + SSEEventType::OutputItemDone + ] + ); + assert_eq!(frames[0].wire.rest["item"]["type"], "shell_call"); + assert_eq!(frames[0].wire.rest["item"]["id"], "sh_shell"); + assert_eq!(frames[0].wire.rest["item"]["status"], "in_progress"); + assert_eq!(frames[0].wire.rest["item"]["action"]["commands"], serde_json::json!([])); + assert_eq!(frames[3].wire.rest["command"], "pwd"); + assert_eq!(frames[4].wire.rest["item"]["status"], "completed"); + } + + #[test] + fn shell_commands_stream_before_arguments_done_with_split_escapes_and_reordered_fields() { + let mut accumulator = ResponseAccumulator::new("resp_1".to_owned(), None); + let registry = test_registry(HashMap::from([("shell".to_owned(), ToolType::Shell)])); + let mut translator = FunctionSseTranslator::new(®istry); + translate( + &mut accumulator, + &mut translator, + &serde_json::json!({ + "type": "response.output_item.added", "output_index": 2, + "item": {"id": "fc_shell", "type": "function_call", "call_id": "call_shell", + "name": "shell", "arguments": "", "status": "in_progress"} + }), + ); + let arguments = r#"{"timeout_ms":1000,"metadata":{"commands":["ignored"]},"commands":["echo \"hi\"\n\uD83D\uDE00","","pwd"],"max_output_length":4096}"#; + let mut frames = Vec::new(); + for ch in arguments.chars() { + frames.extend( + translate( + &mut accumulator, + &mut translator, + &serde_json::json!({ + "type": "response.function_call_arguments.delta", "output_index": 2, + "item_id": "fc_shell", "call_id": "call_shell", "delta": ch.to_string() + }), + ) + .frames, + ); + } + let commands = frames + .iter() + .filter(|frame| frame.event_type == SSEEventType::ShellCallCommandDone) + .map(|frame| frame.wire.rest["command"].as_str().unwrap()) + .collect::>(); + assert_eq!(commands, ["echo \"hi\"\nšŸ˜€", "", "pwd"]); + assert!(frames.iter().all(|frame| frame.wire.output_index == Some(2))); + assert_eq!( + frames + .iter() + .filter(|frame| frame.event_type == SSEEventType::ShellCallCommandAdded) + .count(), + 3 + ); + let done = translate( + &mut accumulator, + &mut translator, + &serde_json::json!({ + "type": "response.function_call_arguments.done", "output_index": 2, + "item_id": "fc_shell", "call_id": "call_shell", "name": "shell", "arguments": arguments + }), + ); + assert!(done.frames.is_empty(), "don't repeat completed command events"); + } + + #[test] + fn shell_authoritative_arguments_complete_partial_commands_and_reject_changes() { + let mut state = ShellCallState { + added: true, + output_index: 0, + commands: Vec::new(), + cursor: None, + command_open: false, + completion: ShellCommandsCompletion::Streaming, + }; + incremental_shell_commands(&mut state, r#"{"commands":["ec"#).unwrap(); + let frames = finish_shell_commands(&mut state, r#"{"commands":["echo","pwd"]}"#).unwrap(); + assert_eq!(frames[0].wire.rest["delta"], "ho"); + assert_eq!(state.commands, ["echo", "pwd"]); + assert!(finish_shell_commands(&mut state, r#"{"commands":["changed"]}"#).is_err()); + assert!(finish_shell_commands(&mut state, r#"{"commands":["echo","pwd","extra"]}"#).is_err()); + assert!(incremental_shell_commands(&mut state, &"x".repeat(MAX_PENDING_FUNCTION_BYTES + 1)).is_err()); + } + + #[test] + fn malformed_shell_arguments_fail_closed() { + let mut accumulator = ResponseAccumulator::new("resp_1".to_owned(), None); + let registry = test_registry(HashMap::from([("shell".to_owned(), ToolType::Shell)])); + let mut translator = FunctionSseTranslator::new(®istry); + let added = serde_json::json!({ + "type": "response.output_item.added", "output_index": 0, + "item": {"id": "fc_shell", "type": "function_call", "call_id": "call_shell", + "name": "shell", "arguments": "", "status": "in_progress"} + }); + translate(&mut accumulator, &mut translator, &added); + let done = serde_json::json!({ + "type": "response.function_call_arguments.done", "output_index": 0, + "item_id": "fc_shell", "call_id": "call_shell", "name": "shell", + "arguments": "not-json" + }); + + let error = accumulator + .process_sse_line_with_translator(&sse(&done), &mut translator) + .expect_err("invalid shell action must fail"); + assert!(error.to_string().contains("invalid action arguments")); + } + #[test] fn unnamed_function_frames_are_recovered_by_output_index_when_done_changes_id() { let mut accumulator = ResponseAccumulator::new("resp_1".to_owned(), None); diff --git a/crates/agentic-server-core/src/executor/gateway.rs b/crates/agentic-server-core/src/executor/gateway.rs index fd33406e..488240ca 100644 --- a/crates/agentic-server-core/src/executor/gateway.rs +++ b/crates/agentic-server-core/src/executor/gateway.rs @@ -363,20 +363,27 @@ pub(super) fn public_output_items( output_items: &[OutputItem], registry: &ToolRegistry, gateway_results: &[GatewayCallResult], -) -> Vec { +) -> ExecutorResult> { output_items .iter() .enumerate() - .map(|(item_index, item)| match item { - OutputItem::FunctionCall(call) if registry.is_client_custom_name(&call.name) => { - crate::tool::CustomHandler::output_item(call) - } - OutputItem::FunctionCall(call) if registry.is_gateway_owned_name(&call.name) => gateway_results - .iter() - .find(|result| result.item_index == item_index) - .and_then(|result| result.public_output.clone()) - .unwrap_or_else(|| OutputItem::FunctionCall(call.clone())), - other => other.clone(), + .map(|(item_index, item)| { + Ok(match item { + OutputItem::FunctionCall(call) if registry.is_client_custom_name(&call.name) => { + crate::tool::CustomHandler::output_item(call) + } + OutputItem::FunctionCall(call) if registry.is_client_shell_name(&call.name) => { + crate::tool::ShellHandler::output_item(call).ok_or_else(|| { + ExecutorError::ParseError("shell function call contains invalid action arguments".to_owned()) + })? + } + OutputItem::FunctionCall(call) if registry.is_gateway_owned_name(&call.name) => gateway_results + .iter() + .find(|result| result.item_index == item_index) + .and_then(|result| result.public_output.clone()) + .unwrap_or_else(|| OutputItem::FunctionCall(call.clone())), + other => other.clone(), + }) }) .collect() } @@ -527,6 +534,7 @@ pub(super) async fn emit_gateway_start_events<'a>( | OutputItem::FunctionCall(_) | OutputItem::ToolSearchCall(_) | OutputItem::CustomToolCall(_) + | OutputItem::ShellCall(_) | OutputItem::Reasoning(_) | OutputItem::Compaction(_) | OutputItem::Unknown => {} @@ -570,7 +578,7 @@ pub(super) async fn emit_gateway_completed_events<'a, T: GatewayPublicOutputSour }, list_tools.id.as_str(), )), - OutputItem::Compaction(_) => None, + OutputItem::Compaction(_) | OutputItem::ShellCall(_) => None, OutputItem::Message(_) | OutputItem::FunctionCall(_) | OutputItem::ToolSearchCall(_) @@ -1584,7 +1592,8 @@ mod tests { )], ); let discovered_output = crate::tool::mcp::handler::list_tools_output_item(&list_tools); - let public_output = super::public_output_items(&[discovered_output], &ToolRegistry::default(), &[]); + let public_output = + super::public_output_items(&[discovered_output], &ToolRegistry::default(), &[]).expect("public output"); let plans = super::mcp_list_tools_event_plans(&public_output, 0); let (sender, mut receiver) = mpsc::channel(32); let mut stream_accumulator = crate::executor::gateway_accumulator::GatewayStreamAccumulator::new(); diff --git a/crates/agentic-server-core/src/executor/pending_calls.rs b/crates/agentic-server-core/src/executor/pending_calls.rs index 19d5dd37..ce33873a 100644 --- a/crates/agentic-server-core/src/executor/pending_calls.rs +++ b/crates/agentic-server-core/src/executor/pending_calls.rs @@ -16,6 +16,7 @@ use crate::types::io::InputItem; enum CallKind { Function, Custom, + Shell, } impl CallKind { @@ -23,6 +24,7 @@ impl CallKind { match self { Self::Function => "function_call", Self::Custom => "custom_tool_call", + Self::Shell => "shell_call", } } @@ -30,6 +32,7 @@ impl CallKind { match self { Self::Function => "function_call_output", Self::Custom => "custom_tool_call_output", + Self::Shell => "shell_call_output", } } } @@ -62,6 +65,12 @@ pub(super) fn pending_calls(items: &[InputItem]) -> ExecutorResult { resolve_call(&output.call_id, CallKind::Custom, &mut pending)?; } + InputItem::ShellCall(call) => { + add_call(&call.call_id, CallKind::Shell, &mut seen_call_ids, &mut pending)?; + } + InputItem::ShellCallOutput(output) => { + resolve_call(&output.call_id, CallKind::Shell, &mut pending)?; + } InputItem::Message(_) | InputItem::Reasoning(_) | InputItem::ToolSearchCall(_) @@ -124,7 +133,8 @@ fn resolve_call(call_id: &str, output_kind: CallKind, pending: &mut IndexMap InputItem { @@ -163,6 +173,32 @@ mod tests { }) } + fn shell_call(call_id: &str) -> InputItem { + InputItem::ShellCall(ShellCall { + id: None, + call_id: call_id.to_owned(), + action: ShellCallAction { + commands: vec!["pwd".to_owned()], + timeout_ms: None, + max_output_length: None, + extra: std::collections::HashMap::new(), + }, + status: None, + extra: std::collections::HashMap::new(), + }) + } + + fn shell_call_output(call_id: &str) -> InputItem { + InputItem::ShellCallOutput(ShellCallOutputMessage { + id: None, + call_id: call_id.to_owned(), + max_output_length: None, + output: Vec::new(), + status: None, + extra: std::collections::HashMap::new(), + }) + } + #[test] fn resolved_calls_are_not_pending() { let items = vec![function_call("call_1"), function_call_output("call_1")]; @@ -195,6 +231,12 @@ mod tests { assert!(pending_calls(&items).expect("valid custom call/output pair").is_empty()); } + #[test] + fn shell_call_output_resolves_shell_call() { + let items = vec![shell_call("call_1"), shell_call_output("call_1")]; + assert!(pending_calls(&items).expect("valid shell call/output pair").is_empty()); + } + #[test] fn empty_items_have_no_pending_calls() { assert!(pending_calls(&[]).expect("empty history is valid").is_empty()); @@ -209,6 +251,7 @@ mod tests { fn empty_and_duplicate_call_ids_are_rejected() { assert_invalid(&[function_call("")], "function_call call_id must not be empty"); assert_invalid(&[custom_tool_call("")], "custom_tool_call call_id must not be empty"); + assert_invalid(&[shell_call("")], "shell_call call_id must not be empty"); assert_invalid( &[ function_call("call_1"), @@ -246,5 +289,9 @@ mod tests { &[function_call("call_1"), custom_tool_call_output("call_1")], "cannot resolve function_call call_id 'call_1'", ); + assert_invalid( + &[shell_call("call_1"), function_call_output("call_1")], + "cannot resolve shell_call call_id 'call_1'", + ); } } diff --git a/crates/agentic-server-core/src/executor/persist.rs b/crates/agentic-server-core/src/executor/persist.rs index a2a45c20..f6b91405 100644 --- a/crates/agentic-server-core/src/executor/persist.rs +++ b/crates/agentic-server-core/src/executor/persist.rs @@ -186,6 +186,7 @@ async fn validate_output_call_ids( OutputItem::FunctionCall(call) => ("function_call", call.call_id.as_str()), OutputItem::ToolSearchCall(call) => ("tool_search_call", call.call_id.as_str()), OutputItem::CustomToolCall(call) => ("custom_tool_call", call.call_id.as_str()), + OutputItem::ShellCall(call) => ("shell_call", call.call_id.as_str()), _ => continue, }; if call_id.is_empty() { @@ -226,6 +227,7 @@ fn stored_call_id(item: &InOutItem) -> Option<&str> { InOutItem::Output(OutputItem::FunctionCall(call)) => Some(&call.call_id), InOutItem::Output(OutputItem::ToolSearchCall(call)) => Some(&call.call_id), InOutItem::Output(OutputItem::CustomToolCall(call)) => Some(&call.call_id), + InOutItem::Output(OutputItem::ShellCall(call)) => Some(&call.call_id), InOutItem::Output(_) => None, } } @@ -235,6 +237,7 @@ fn input_call_id(item: &InputItem) -> Option<&str> { InputItem::FunctionCall(call) => Some(&call.call_id), InputItem::ToolSearchCall(call) => Some(&call.call_id), InputItem::CustomToolCall(call) => Some(&call.call_id), + InputItem::ShellCall(call) => Some(&call.call_id), _ => None, } } diff --git a/crates/agentic-server-core/src/executor/rehydrate.rs b/crates/agentic-server-core/src/executor/rehydrate.rs index 9212480c..77556334 100644 --- a/crates/agentic-server-core/src/executor/rehydrate.rs +++ b/crates/agentic-server-core/src/executor/rehydrate.rs @@ -126,7 +126,12 @@ pub async fn rehydrate_conversation( // Fail before storage work for new files; check again once history is resolved. validate_message_files(&request.input)?; let response_id = uuid7_str("resp_"); - let new_input_items: Vec = Vec::from(&request.input); + // Persistence keeps the public items. Tool lowering belongs to the enriched + // inference copy, including when a later turn loads these items from storage. + let new_input_items = match &request.input { + ResponsesInput::Items(items) => items.iter().filter(|item| !item.is_unknown()).cloned().collect(), + ResponsesInput::Text(_) => Vec::from(&request.input), + }; // One clone for the unmodified original; `request` is moved as enriched_request. let original_request = request.clone(); @@ -150,7 +155,7 @@ pub async fn rehydrate_conversation( } else if ctx.original_request.previous_response_id.is_some() { from_response(&mut ctx, exec_ctx).await?; } else { - ctx.enriched_request.input = ResponsesInput::Items(ctx.new_input_items.clone()); + ctx.enriched_request.input = ResponsesInput::Items(Vec::from(&ctx.original_request.input)); } validate_message_files(&ctx.enriched_request.input)?; @@ -168,7 +173,7 @@ async fn from_response(ctx: &mut RequestContext, exec_ctx: &ExecutionContext) -> let mut items = InOutItem::into_input_items(history); items.reserve(ctx.new_input_items.len()); - items.extend(ctx.new_input_items.iter().cloned()); + items.extend(Vec::from(&ctx.original_request.input)); if let Some(pending) = pending_calls(&items)?.into_iter().next() { return Err(ExecutorError::Tool(ToolError::MissingOutput { call_id: pending.call_id, @@ -200,7 +205,7 @@ async fn from_conversation(ctx: &mut RequestContext, exec_ctx: &ExecutionContext let mut items = InOutItem::into_input_items(snapshot.items); items.reserve(ctx.new_input_items.len()); - items.extend(ctx.new_input_items.iter().cloned()); + items.extend(Vec::from(&ctx.original_request.input)); if let Some(pending) = pending_calls(&items)?.into_iter().next() { return Err(ExecutorError::Tool(ToolError::MissingOutput { call_id: pending.call_id, diff --git a/crates/agentic-server-core/src/executor/upstream.rs b/crates/agentic-server-core/src/executor/upstream.rs index 2036dc4c..7e4eafe1 100644 --- a/crates/agentic-server-core/src/executor/upstream.rs +++ b/crates/agentic-server-core/src/executor/upstream.rs @@ -335,7 +335,9 @@ fn should_defer_stream_event(frame: &EventFrame, defer_from_output_index: Option async fn emit_stream_frame(frame: &mut EventFrame, emit_ctx: &mut StreamEmitContext<'_>) -> ExecutorResult { apply_context_response_ids(&mut frame.wire, emit_ctx.request); - emit_ctx.registry.restore_tool_search_response_tools(&mut frame.wire)?; + emit_ctx + .registry + .restore_response_tools(&mut frame.wire, &emit_ctx.request.enriched_request)?; emit_ctx.registry.restore_stream_event_wire(&mut frame.wire); let emitted = emit_ctx.accumulator.process_event(frame, emit_ctx.output_offset); if emitted { @@ -399,7 +401,7 @@ async fn emit_mcp_discovery_lifecycle( .mcp_list_tool_items() .map(crate::tool::mcp::handler::list_tools_output_item) .collect::>(); - let public_output = public_output_items(&discovered_output, registry, &[]); + let public_output = public_output_items(&discovered_output, registry, &[])?; let event_plans = mcp_list_tools_event_plans(&public_output, 0); emit_gateway_start_events(&event_plans, stream_accumulator, stream_sender).await?; diff --git a/crates/agentic-server-core/src/lib.rs b/crates/agentic-server-core/src/lib.rs index b9811064..47ff440b 100644 --- a/crates/agentic-server-core/src/lib.rs +++ b/crates/agentic-server-core/src/lib.rs @@ -24,11 +24,13 @@ pub use types::{ CustomToolParam, EmptyToolNameError, FileSearchToolParam, FunctionTool, FunctionToolCall, FunctionToolParam, FunctionToolResultMessage, GatewayCallStatus, IncompleteDetails, InputContent, InputFileContent, InputFunctionToolCall, InputImageContent, InputItem, InputMessage, InputMessageContent, InputTextContent, - InputTokenDetails, McpCall, McpCallStatus, McpToolParam, NonEmptyToolName, OutputItem, OutputMessage, - OutputTextContent, OutputTokenDetails, ReasoningConfig, ReasoningOutput, ReasoningTextContent, RequestPayload, - ResponsePayload, ResponseTextConfig, ResponseTextFormat, ResponseUsage, ResponsesInput, ResponsesTool, - ToolCallOutput, ToolChoice, ToolOutputContent, UpstreamRequest, UpstreamTool, WebSearchAction, - WebSearchActionFindInPage, WebSearchActionOpenPage, WebSearchActionSearch, WebSearchCall, WebSearchCallStatus, - WebSearchContextSize, WebSearchFilters, WebSearchSource, WebSearchToolParam, WebSearchUserLocation, + InputTokenDetails, LocalShellEnvironment, McpCall, McpCallStatus, McpToolParam, NonEmptyToolName, OutputItem, + OutputMessage, OutputTextContent, OutputTokenDetails, ReasoningConfig, ReasoningOutput, ReasoningTextContent, + RequestPayload, ResponsePayload, ResponseTextConfig, ResponseTextFormat, ResponseUsage, ResponsesInput, + ResponsesTool, ShellCall, ShellCallAction, ShellCallOutcome, ShellCallOutputContent, ShellCallOutputMessage, + ShellCallStatus, ShellEnvironment, ShellToolParam, ToolCallOutput, ToolChoice, ToolOutputContent, UpstreamRequest, + UpstreamTool, WebSearchAction, WebSearchActionFindInPage, WebSearchActionOpenPage, WebSearchActionSearch, + WebSearchCall, WebSearchCallStatus, WebSearchContextSize, WebSearchFilters, WebSearchSource, WebSearchToolParam, + WebSearchUserLocation, }; pub use utils::{utcnow_str, uuid7_str}; diff --git a/crates/agentic-server-core/src/storage/models/item.rs b/crates/agentic-server-core/src/storage/models/item.rs index 821d1813..edcfdbd7 100644 --- a/crates/agentic-server-core/src/storage/models/item.rs +++ b/crates/agentic-server-core/src/storage/models/item.rs @@ -38,16 +38,24 @@ pub struct Item { } impl Item { + fn data_without_storage_marker(&self) -> Option { + let mut value = deserialize_from_str_opt::(&self.data)?; + if let Some(object) = value.as_object_mut() { + object.remove(STORED_ITEM_KIND_KEY); + } + Some(value) + } + /// Deserialize data column as `InputItem`. #[must_use] pub fn as_input(&self) -> Option { - deserialize_from_str_opt(&self.data) + serde_json::from_value(self.data_without_storage_marker()?).ok() } /// Deserialize data column as `OutputItem`. #[must_use] pub fn as_output(&self) -> Option { - deserialize_from_str_opt(&self.data) + serde_json::from_value(self.data_without_storage_marker()?).ok() } /// Deserialize data column as either `InputItem` or `OutputItem`. @@ -450,6 +458,40 @@ mod tests { println!("storage marker stripped: _agentic_item_kind absent"); } + #[test] + fn shell_call_round_trips_through_storage_and_rehydration() { + let output: OutputItem = serde_json::from_value(serde_json::json!({ + "type": "shell_call", + "id": "sh_1", + "call_id": "call_shell", + "action": { + "commands": ["pwd"], + "timeout_ms": 1_000, + "max_output_length": 4_096 + }, + "status": "completed" + })) + .expect("shell output item"); + let stored = InOutItem::Output(output); + let item = Item { + id: "item_shell_call".to_owned(), + data: String::try_from(&stored).expect("serialization failed"), + created_at: 1_704_067_200, + conversation_id: None, + seq: None, + }; + + let inputs = InOutItem::into_input_items(vec![item.as_inout().expect("stored shell item")]); + let value = serde_json::to_value(&inputs[0]).expect("rehydrated shell input"); + + assert_eq!(value["type"], "function_call"); + assert_eq!(value["name"], "shell"); + assert_eq!(value["call_id"], "call_shell"); + let action: serde_json::Value = serde_json::from_str(value["arguments"].as_str().unwrap()).unwrap(); + assert_eq!(action["commands"][0], "pwd"); + assert!(value.get(STORED_ITEM_KIND_KEY).is_none()); + } + #[test] fn test_multiple_namespaced_function_calls_rehydrate_without_storage_marker() { let stored_items = [ diff --git a/crates/agentic-server-core/src/storage/types/item.rs b/crates/agentic-server-core/src/storage/types/item.rs index f839d2c2..4fa25da2 100644 --- a/crates/agentic-server-core/src/storage/types/item.rs +++ b/crates/agentic-server-core/src/storage/types/item.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; use crate::storage::StorageError; -use crate::types::io::{InputItem, OutputItem}; +use crate::types::io::{InputItem, OutputItem, ResponsesInput}; use crate::utils::common::serialize_to_value; pub(crate) const STORED_ITEM_KIND_KEY: &str = "_agentic_item_kind"; @@ -106,14 +106,17 @@ impl InOutItem { /// Internal items are removed later by `ResponsesInput::model_input`. #[must_use] pub fn into_input_items(history: Vec) -> Vec { - history + let items = history .into_iter() .filter_map(|item| match item { InOutItem::Input(item) if item.is_unknown() => None, InOutItem::Input(item) => Some(item), InOutItem::Output(output) => output.to_input_item(), }) - .collect() + .collect(); + // Stored inputs retain their public tool types; lower only the history + // copy used for continuation, using the same conversion as new inputs. + Vec::from(ResponsesInput::Items(items)) } } @@ -124,7 +127,7 @@ mod tests { use crate::types::io::output::McpListTools; use crate::types::io::{ FunctionToolCall, InputContent, InputMessage, InputMessageContent, OutputMessage, OutputTextContent, - ReasoningOutput, ReasoningTextContent, ResponsesInput, + ReasoningOutput, ReasoningTextContent, ResponsesInput, ShellCall, ShellCallAction, ShellCallStatus, }; #[test] @@ -245,6 +248,27 @@ mod tests { } } + #[test] + fn test_into_input_items_preserves_shell_calls() { + let call = ShellCall { + id: Some("sh_1".to_owned()), + call_id: "call_shell".to_owned(), + action: ShellCallAction { + commands: vec!["pwd".to_owned()], + timeout_ms: Some(1_000), + max_output_length: Some(4_096), + extra: std::collections::HashMap::new(), + }, + status: Some(ShellCallStatus::Completed), + extra: std::collections::HashMap::new(), + }; + + let inputs = InOutItem::into_input_items(vec![InOutItem::Output(OutputItem::ShellCall(call))]); + assert!( + matches!(inputs.as_slice(), [InputItem::FunctionCall(call)] if call.call_id == "call_shell" && call.name == "shell") + ); + } + #[test] fn input_items_preserve_mcp_list_tools_until_model_input() { let history = vec![InOutItem::Output(OutputItem::McpListTools(McpListTools::new( diff --git a/crates/agentic-server-core/src/tool/codex.rs b/crates/agentic-server-core/src/tool/codex.rs index c83fb166..4e2322c0 100644 --- a/crates/agentic-server-core/src/tool/codex.rs +++ b/crates/agentic-server-core/src/tool/codex.rs @@ -451,6 +451,7 @@ fn typed_top_level_registry_keys(tools: &[ResponsesTool]) -> HashMap "code_interpreter".to_owned(), ResponsesTool::ToolSearch(_) | ResponsesTool::Mcp(_) + | ResponsesTool::Shell(_) | ResponsesTool::Namespace(_) | ResponsesTool::Custom(_) | ResponsesTool::Unknown => return None, diff --git a/crates/agentic-server-core/src/tool/mod.rs b/crates/agentic-server-core/src/tool/mod.rs index 252db5ae..57caef1f 100644 --- a/crates/agentic-server-core/src/tool/mod.rs +++ b/crates/agentic-server-core/src/tool/mod.rs @@ -12,6 +12,7 @@ pub mod mcp; pub mod normalize; pub mod ownership; pub mod registry; +pub mod shell; pub mod tool_search; pub mod web_search; @@ -23,6 +24,7 @@ pub use handler::{GatewayExecutor, GatewayToolEventPlan, ToolError, ToolHandler, pub use mcp::{McpClient, McpClientPool, McpDiscoveredHandler, McpError, McpHandler, McpOperation, McpServerEntry}; pub use ownership::{GatewayBinding, ToolOwnership}; pub use registry::{GatewayDispatchResult, ToolEntry, ToolRegistry, ToolType}; +pub use shell::ShellHandler; pub(crate) use tool_search::ToolSearchMetadata; pub use tool_search::{ToolSearchHandler, ToolSearchState}; pub use web_search::WebSearchHandler; diff --git a/crates/agentic-server-core/src/tool/normalize.rs b/crates/agentic-server-core/src/tool/normalize.rs index 5ca519ea..d7d016bd 100644 --- a/crates/agentic-server-core/src/tool/normalize.rs +++ b/crates/agentic-server-core/src/tool/normalize.rs @@ -8,6 +8,7 @@ use super::function::FunctionHandler; use super::handler::{ToolError, ToolHandler, ToolOutput}; use super::mcp::McpHandler; use super::registry::ToolType; +use super::shell::ShellHandler; use super::tool_search::ToolSearchHandler; use super::web_search::web_search_function_tool; @@ -24,6 +25,7 @@ impl ResponsesTool { Self::Mcp(param) => McpHandler::spec_from_param(param).validate(param), Self::ToolSearch(param) => ToolSearchHandler.validate(param), Self::WebSearch(_) | Self::FileSearch(_) | Self::CodeInterpreter(_) | Self::Unknown => Ok(()), + Self::Shell(param) => ShellHandler.validate(param), Self::Namespace(param) => CodexNamespaceHandler.validate(param), Self::Custom(param) => CustomHandler.validate(param), } @@ -41,6 +43,7 @@ impl ResponsesTool { Self::CodeInterpreter(_) => Some(ToolType::CodeInterpreter), Self::Namespace(_) => Some(ToolType::CodexNamespace), Self::Custom(_) => Some(ToolType::Custom), + Self::Shell(_) => Some(ToolType::Shell), Self::Unknown => None, } } @@ -83,6 +86,7 @@ impl ResponsesTool { tracing::debug!("code_interpreter tool skipped in normalize - handler not yet registered"); vec![] } + Self::Shell(param) => ShellHandler.normalize(param), Self::Namespace(param) => CodexNamespaceHandler.normalize(param), Self::Custom(param) => CustomHandler.normalize(param), Self::Unknown => { diff --git a/crates/agentic-server-core/src/tool/registry.rs b/crates/agentic-server-core/src/tool/registry.rs index 73ab5e30..3e627829 100644 --- a/crates/agentic-server-core/src/tool/registry.rs +++ b/crates/agentic-server-core/src/tool/registry.rs @@ -12,6 +12,7 @@ use super::executors::GatewayExecutors; use super::function::insert_function_entry; use super::mcp::registry::insert_discovered_mcp_entry; use super::ownership::{GatewayBinding, ToolOwnership}; +use super::shell::insert_shell_entry; use super::tool_search::{ TOOL_SEARCH_NAME, ensure_request_prepared, insert_tool_search_entry, validate_blocking_response, }; @@ -22,7 +23,7 @@ use super::{ use crate::events::WireEvent; use crate::types::io::output::{FunctionToolCall, McpListTools}; -use crate::types::io::{InputItem, OutputItem, ResponsesInput}; +use crate::types::io::{InputItem, OutputItem, ResponsesInput, ToolChoice}; use crate::types::request_response::RequestPayload; use crate::types::tools::{CodeInterpreterToolParam, FileSearchToolParam, ResponsesTool}; use crate::utils::common::serialize_to_value; @@ -37,6 +38,7 @@ pub enum ToolType { Function, ToolSearch, Custom, + Shell, CodexNamespace, Mcp, /// Internal routing discriminant. Serializes as `"web_search"`. @@ -54,6 +56,7 @@ impl ToolType { Self::Function => "function tool", Self::ToolSearch => "tool search", Self::Custom => "custom tool", + Self::Shell => "shell tool", Self::CodexNamespace => "Codex namespace tool", Self::Mcp => "MCP tool", Self::WebSearch => "web search tool", @@ -70,7 +73,7 @@ impl ToolType { pub const fn is_gateway_owned(self) -> bool { !matches!( self, - Self::Function | Self::ToolSearch | Self::Custom | Self::CodexNamespace + Self::Function | Self::ToolSearch | Self::Custom | Self::Shell | Self::CodexNamespace ) } } @@ -95,9 +98,7 @@ impl std::fmt::Debug for ToolEntry { } impl ToolEntry { - /// Builds a client-owned entry. `tool_type.is_gateway_owned()` is the - /// single source of truth for the ownership discriminant; this asserts - /// the caller picked the constructor matching its own tool type. + /// Builds a client-owned entry using the declaration-level ownership default. pub(crate) fn client(tool_type: ToolType, server_label: Option) -> Self { debug_assert!(!tool_type.is_gateway_owned()); Self { @@ -320,6 +321,11 @@ impl ToolRegistry { insert_code_interpreter_entry(resolved, p); })?; } + ResponsesTool::Shell(_) => { + insert_unique_tool_entries(&mut entries, |resolved| { + insert_shell_entry(resolved); + })?; + } ResponsesTool::Namespace(p) => { insert_unique_tool_entries(&mut entries, |resolved| insert_namespace_entries(resolved, p))?; } @@ -353,11 +359,17 @@ impl ToolRegistry { } /// Public declarations to expose in response metadata. `Some([])` is - /// intentionally distinct from an inactive request. + /// intentionally distinct from an inactive request. Shell declarations are + /// also restored because their upstream function shape is private. #[must_use] - pub(crate) fn tool_search_response_tools(&self) -> Option> { - let state = self.tool_search.as_deref().filter(|state| state.is_active())?; - let mut tools = state.public_response_tools(); + pub(crate) fn response_tools(&self, request_tools: Option<&[ResponsesTool]>) -> Option> { + let mut tools = if let Some(state) = self.tool_search.as_deref().filter(|state| state.is_active()) { + state.public_response_tools() + } else { + request_tools + .filter(|tools| tools.iter().any(|tool| matches!(tool, ResponsesTool::Shell(_))))? + .to_vec() + }; for tool in &mut tools { tool.sanitize_for_persistence(); } @@ -387,20 +399,26 @@ impl ToolRegistry { ensure_request_prepared(request, self.tool_search.is_some()) } - pub(crate) fn restore_tool_search_response_tools(&self, wire: &mut WireEvent) -> Result<(), ToolError> { + pub(crate) fn restore_response_tools( + &self, + wire: &mut WireEvent, + request: &RequestPayload, + ) -> Result<(), serde_json::Error> { let Some(response) = wire.rest.get_mut("response").and_then(Value::as_object_mut) else { return Ok(()); }; - if !response.contains_key("tools") { - return Ok(()); - } - let Some(tools) = self.tool_search_response_tools() else { + let Some(tools) = self.response_tools(request.tools.as_deref()) else { return Ok(()); }; - response.insert( - "tools".to_owned(), - serialize_to_value(&tools).map_err(|_| super::tool_search::invalid_upstream_search_call())?, - ); + if response.contains_key("tools") { + response.insert("tools".to_owned(), serialize_to_value(&tools)?); + } + if response.contains_key("tool_choice") { + response.insert( + "tool_choice".to_owned(), + serialize_to_value(request.tool_choice.as_ref().unwrap_or(&ToolChoice::Auto))?, + ); + } Ok(()) } @@ -556,6 +574,13 @@ impl ToolRegistry { .is_some_and(|entry| entry.tool_type == ToolType::Custom) } + #[must_use] + pub fn is_client_shell_name(&self, name: &str) -> bool { + self.entries + .get(name) + .is_some_and(|entry| entry.tool_type == ToolType::Shell && !entry.ownership.is_gateway()) + } + /// Returns the subset of `calls` whose names map to client-owned tools /// (`Function`, Codex namespace members, or unknown names). #[must_use] diff --git a/crates/agentic-server-core/src/tool/shell.rs b/crates/agentic-server-core/src/tool/shell.rs new file mode 100644 index 00000000..19e10907 --- /dev/null +++ b/crates/agentic-server-core/src/tool/shell.rs @@ -0,0 +1,190 @@ +use std::collections::HashMap; + +use crate::types::io::{FunctionTool, FunctionToolCall, OutputItem, ShellCall, ShellCallAction, ShellCallStatus}; +use crate::types::tools::{ShellEnvironment, ShellToolParam}; +use crate::utils::common::deserialize_from_str; + +use super::{ToolEntry, ToolError, ToolHandler, ToolType}; + +pub(crate) const SHELL_FUNCTION_NAME: &str = "shell"; + +/// Handler for the client-executed local `type: "shell"` tool. +/// +/// The declaration is normalized to a function for inference, then restored +/// to a typed `shell_call` before it is returned to the client. This handler +/// deliberately does not implement `GatewayExecutor`: declaring a shell tool +/// never grants the gateway permission to execute arbitrary commands. +#[derive(Debug)] +pub struct ShellHandler; + +impl ShellHandler { + #[must_use] + pub(crate) fn output_item(call: &FunctionToolCall) -> Option { + Self::output_item_with_status(call, call.status.into()) + } + + #[must_use] + pub(crate) fn output_item_with_status(call: &FunctionToolCall, status: ShellCallStatus) -> Option { + let action = deserialize_from_str::(&call.arguments).ok()?; + Some(OutputItem::ShellCall(ShellCall { + id: Some(public_item_id(&call.id)), + call_id: call.call_id.clone(), + action, + status: Some(status), + extra: HashMap::new(), + })) + } +} + +impl ToolHandler for ShellHandler { + type ToolParams = ShellToolParam; + + fn tool_type(&self) -> ToolType { + ToolType::Shell + } + + fn validate(&self, params: &ShellToolParam) -> Result<(), ToolError> { + if !matches!(params.environment, ShellEnvironment::Local(_)) { + return Err(ToolError::Config( + "shell tool currently supports only environment.type='local'".to_owned(), + )); + } + Ok(()) + } + + fn normalize(&self, _params: &ShellToolParam) -> Vec { + vec![FunctionTool { + type_: "function".to_owned(), + name: SHELL_FUNCTION_NAME.to_owned(), + description: Some( + "Run one or more commands in the caller-provided local shell environment. The caller executes the commands and returns their outputs." + .to_owned(), + ), + parameters: Some(serde_json::json!({ + "type": "object", + "properties": { + "commands": { + "type": "array", + "items": {"type": "string"}, + "minItems": 1, + "description": "Commands to execute in order." + }, + "timeout_ms": { + "type": "integer", + "minimum": 0, + "description": "Optional timeout in milliseconds." + }, + "max_output_length": { + "type": "integer", + "minimum": 0, + "description": "Optional maximum captured output length." + } + }, + "required": ["commands"], + "additionalProperties": false + })), + strict: Some(false), + }] + } +} + +pub(crate) fn insert_shell_entry(entries: &mut HashMap) { + entries.insert(SHELL_FUNCTION_NAME.to_owned(), ToolEntry::client(ToolType::Shell, None)); +} + +#[must_use] +pub(crate) fn public_item_id(item_id: &str) -> String { + if item_id.starts_with("sh_") { + return item_id.to_owned(); + } + if let Some(suffix) = item_id.strip_prefix("fc_").filter(|suffix| !suffix.is_empty()) { + return format!("sh_{suffix}"); + } + format!("sh_{:016x}", stable_name_hash(item_id)) +} + +fn stable_name_hash(value: &str) -> u64 { + value.as_bytes().iter().fold(0xcbf2_9ce4_8422_2325_u64, |hash, byte| { + (hash ^ u64::from(*byte)).wrapping_mul(0x0000_0100_0000_01b3) + }) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::types::event::MessageStatus; + + #[test] + fn shell_entry_uses_client_execution() { + let mut entries = HashMap::new(); + insert_shell_entry(&mut entries); + let entry = &entries[SHELL_FUNCTION_NAME]; + assert_eq!(entry.tool_type, ToolType::Shell); + assert!(!entry.ownership.is_gateway()); + } + + #[test] + fn public_shell_ids_preserve_native_ids_and_translate_function_ids() { + let native_id = "sh_6d300b80c049eb3c"; + assert_eq!(public_item_id(native_id), native_id); + assert_eq!(public_item_id("fc_6d300b80c049eb3c"), native_id); + } + fn local_shell() -> ShellToolParam { + serde_json::from_value(serde_json::json!({ + "environment": {"type": "local"} + })) + .expect("local shell declaration") + } + + #[test] + fn local_shell_normalizes_to_a_function() { + let [tool] = ShellHandler.normalize(&local_shell()).try_into().expect("one tool"); + assert_eq!(tool.type_, "function"); + assert_eq!(tool.name, SHELL_FUNCTION_NAME); + assert_eq!(tool.parameters.unwrap()["required"], serde_json::json!(["commands"])); + assert_eq!(tool.strict, Some(false)); + } + + #[test] + fn unknown_shell_environment_is_rejected() { + let param = serde_json::from_value::(serde_json::json!({ + "environment": {"type": "container_auto"} + })) + .expect("preserved unknown environment"); + assert!(ShellHandler.validate(¶m).is_err()); + } + + #[test] + fn normalized_function_call_restores_shell_call() { + let call = FunctionToolCall { + id: "fc_123".to_owned(), + call_id: "call_123".to_owned(), + name: SHELL_FUNCTION_NAME.to_owned(), + namespace: None, + arguments: r#"{"commands":["pwd"],"timeout_ms":1000}"#.to_owned(), + status: MessageStatus::Completed, + }; + + let Some(OutputItem::ShellCall(shell)) = ShellHandler::output_item(&call) else { + panic!("expected shell call"); + }; + assert_eq!(shell.id.as_deref(), Some("sh_123")); + assert_eq!(shell.call_id, "call_123"); + assert_eq!(shell.action.commands, ["pwd"]); + assert_eq!(shell.action.timeout_ms, Some(1000)); + assert_eq!(shell.status, Some(ShellCallStatus::Completed)); + } + + #[test] + fn malformed_function_arguments_are_not_restored() { + let call = FunctionToolCall { + id: "fc_123".to_owned(), + call_id: "call_123".to_owned(), + name: SHELL_FUNCTION_NAME.to_owned(), + namespace: None, + arguments: "not-json".to_owned(), + status: MessageStatus::Completed, + }; + assert!(ShellHandler::output_item(&call).is_none()); + } +} diff --git a/crates/agentic-server-core/src/tool/tool_search.rs b/crates/agentic-server-core/src/tool/tool_search.rs index b11fdad4..5089d8ac 100644 --- a/crates/agentic-server-core/src/tool/tool_search.rs +++ b/crates/agentic-server-core/src/tool/tool_search.rs @@ -633,6 +633,7 @@ fn tool_has_deferred_definition(tool: &ResponsesTool) -> bool { | ResponsesTool::WebSearch(_) | ResponsesTool::FileSearch(_) | ResponsesTool::CodeInterpreter(_) + | ResponsesTool::Shell(_) | ResponsesTool::Unknown => false, } } @@ -656,6 +657,7 @@ fn has_reserved_tool_search_name(tool: &ResponsesTool) -> bool { | ResponsesTool::WebSearch(_) | ResponsesTool::FileSearch(_) | ResponsesTool::CodeInterpreter(_) + | ResponsesTool::Shell(_) | ResponsesTool::Unknown => false, } } @@ -978,6 +980,7 @@ fn definition_record( | ResponsesTool::WebSearch(_) | ResponsesTool::FileSearch(_) | ResponsesTool::CodeInterpreter(_) + | ResponsesTool::Shell(_) | ResponsesTool::Custom(_) | ResponsesTool::Unknown => { return Err(ToolError::Config( @@ -1171,6 +1174,8 @@ fn prepare_history( | InputItem::FunctionCallOutput(_) | InputItem::CustomToolCall(_) | InputItem::CustomToolCallOutput(_) + | InputItem::ShellCall(_) + | InputItem::ShellCallOutput(_) | InputItem::Reasoning(_) | InputItem::Compaction(_) | InputItem::Unknown => private_items.push(item.clone()), @@ -1332,6 +1337,7 @@ fn model_visible_output_tools(tools: &[ResponsesTool]) -> Result Err(ToolError::Config( "tool_search_output contains an unsupported model-output definition".to_owned(), @@ -1517,6 +1523,7 @@ fn loaded_tool_identity(tool: &ResponsesTool) -> Result return Ok(None), }; @@ -1591,6 +1598,7 @@ fn build_catalog( | ResponsesTool::WebSearch(_) | ResponsesTool::FileSearch(_) | ResponsesTool::CodeInterpreter(_) + | ResponsesTool::Shell(_) | ResponsesTool::Custom(_) | ResponsesTool::Unknown => None, } @@ -1653,6 +1661,7 @@ fn build_private_tools( | ResponsesTool::WebSearch(_) | ResponsesTool::FileSearch(_) | ResponsesTool::CodeInterpreter(_) + | ResponsesTool::Shell(_) | ResponsesTool::Custom(_) | ResponsesTool::Unknown => Some(tool.clone()), }) @@ -1679,6 +1688,7 @@ fn available_public_tools(public_tools: &[ResponsesTool], loaded_tools: &[Respon | ResponsesTool::WebSearch(_) | ResponsesTool::FileSearch(_) | ResponsesTool::CodeInterpreter(_) + | ResponsesTool::Shell(_) | ResponsesTool::Custom(_) | ResponsesTool::Unknown => {} } @@ -1724,6 +1734,7 @@ fn available_public_tools(public_tools: &[ResponsesTool], loaded_tools: &[Respon | ResponsesTool::WebSearch(_) | ResponsesTool::FileSearch(_) | ResponsesTool::CodeInterpreter(_) + | ResponsesTool::Shell(_) | ResponsesTool::Custom(_) | ResponsesTool::Unknown => Some(tool.clone()), ResponsesTool::ToolSearch(_) => None, @@ -1757,6 +1768,7 @@ fn private_definition( | ResponsesTool::WebSearch(_) | ResponsesTool::FileSearch(_) | ResponsesTool::CodeInterpreter(_) + | ResponsesTool::Shell(_) | ResponsesTool::Custom(_) | ResponsesTool::Unknown => None, } @@ -2023,6 +2035,45 @@ mod tests { ); } + #[test] + fn preparation_preserves_shell_declarations_and_history() { + let mut request: RequestPayload = serde_json::from_value(json!({ + "model": "test", + "tools": [ + {"type": "tool_search", "execution": "client"}, + {"type": "shell", "environment": {"type": "local"}} + ], + "input": [ + {"type": "shell_call", "call_id": "call_shell", "action": {"commands": ["pwd"]}}, + {"type": "shell_call_output", "call_id": "call_shell", "output": [ + {"stdout": "/workspace", "outcome": {"type": "exit", "exit_code": 0}} + ]} + ] + })) + .expect("shell history with tool search"); + let original_input = serialize_to_value(&request.input).expect("input serializes"); + + let state = ToolSearchHandler::prepare_request(&mut request, &[], false) + .expect("tool-search preparation") + .expect("active tool search"); + + assert_eq!(serialize_to_value(&request.input).unwrap(), original_input); + assert!( + request + .tools + .as_ref() + .unwrap() + .iter() + .any(|tool| matches!(tool, ResponsesTool::Shell(_))) + ); + assert!( + state + .public_response_tools() + .iter() + .any(|tool| matches!(tool, ResponsesTool::Shell(_))) + ); + } + #[test] fn ordinary_function_named_tool_search_does_not_require_preparation() { let request: RequestPayload = serde_json::from_value(json!({ @@ -2178,8 +2229,12 @@ mod tests { registry .install_tool_search_state(Some(state)) .expect("install prepared tool-search state"); - let serialized = serde_json::to_value(registry.tool_search_response_tools().expect("active public tools")) - .expect("public tools serialize"); + let serialized = serde_json::to_value( + registry + .response_tools(request.tools.as_deref()) + .expect("active public tools"), + ) + .expect("public tools serialize"); let serialized = serialized.to_string(); for secret in [ diff --git a/crates/agentic-server-core/src/types/io/input.rs b/crates/agentic-server-core/src/types/io/input.rs index 318d0c3d..bd184138 100644 --- a/crates/agentic-server-core/src/types/io/input.rs +++ b/crates/agentic-server-core/src/types/io/input.rs @@ -8,6 +8,7 @@ use crate::types::tools::{ResponsesTool, ToolSearchExecution, ToolSearchStatus}; use crate::utils::common::deserialize_from_value; use super::output::{CustomToolCall, FunctionToolCall, McpListTools, ReasoningOutput, ToolSearchCall}; +use super::shell::{ShellCall, ShellCallOutputMessage, ShellCallStatus}; #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))] @@ -255,6 +256,8 @@ mod openapi_schemas { .item(tagged_ref("tool_search_output", "ToolSearchOutputMessage")) .item(tagged_ref("custom_tool_call", "CustomToolCall")) .item(tagged_ref("custom_tool_call_output", "CustomToolCallOutputMessage")) + .item(tagged_ref("shell_call", "ShellCall")) + .item(tagged_ref("shell_call_output", "ShellCallOutputMessage")) .item(tagged_ref("reasoning", "ReasoningOutput")) .item(tagged_ref("mcp_list_tools", "McpListTools")) .item(tagged_ref("compaction", "CompactionItem")) @@ -345,6 +348,36 @@ impl From for InputFunctionToolCall { } } +impl From for InputFunctionToolCall { + fn from(call: ShellCall) -> Self { + Self { + id: call.id.as_deref().and_then(function_call_item_id), + call_id: call.call_id, + name: "shell".to_owned(), + namespace: None, + // The action contains only JSON-compatible values and string map keys. + arguments: serde_json::to_string(&call.action).expect("shell action serializes to JSON"), + status: match call.status { + Some(ShellCallStatus::Completed) => Some(MessageStatus::Completed), + Some(ShellCallStatus::InProgress) => Some(MessageStatus::InProgress), + Some(ShellCallStatus::Incomplete) | None => None, + }, + } + } +} + +impl From for FunctionToolResultMessage { + fn from(output: ShellCallOutputMessage) -> Self { + Self { + call_id: output.call_id, + // Command outputs contain only JSON-compatible values and string map keys. + output: serde_json::to_string(&output.output) + .expect("shell outputs serialize to JSON") + .into(), + } + } +} + pub(super) fn deserialize_non_blank_string<'de, D>(deserializer: D) -> Result where D: serde::Deserializer<'de>, @@ -449,6 +482,10 @@ pub enum InputItem { CustomToolCall(CustomToolCall), #[serde(rename = "custom_tool_call_output")] CustomToolCallOutput(CustomToolCallOutputMessage), + #[serde(rename = "shell_call")] + ShellCall(ShellCall), + #[serde(rename = "shell_call_output")] + ShellCallOutput(ShellCallOutputMessage), #[serde(rename = "reasoning")] Reasoning(ReasoningOutput), /// Internal history record used by gateway orchestration to remember that @@ -471,8 +508,10 @@ impl<'de> Deserialize<'de> for InputItem { where D: serde::Deserializer<'de>, { - let value = Value::deserialize(deserializer)?; - let item = match value.get("type").and_then(Value::as_str) { + let mut value = Value::deserialize(deserializer)?; + // Consume the enum discriminator before a flattened payload can retain it. + let kind = value.as_object_mut().and_then(|object| object.remove("type")); + let item = match kind.as_ref().and_then(Value::as_str) { None | Some("message") => deserialize_from_value(value).map(Self::Message), Some("function_call") => deserialize_from_value(value).map(Self::FunctionCall), Some("function_call_output") => deserialize_from_value(value).map(Self::FunctionCallOutput), @@ -480,6 +519,8 @@ impl<'de> Deserialize<'de> for InputItem { Some("tool_search_output") => deserialize_from_value(value).map(Self::ToolSearchOutput), Some("custom_tool_call") => deserialize_from_value(value).map(Self::CustomToolCall), Some("custom_tool_call_output") => deserialize_from_value(value).map(Self::CustomToolCallOutput), + Some("shell_call") => deserialize_from_value(value).map(Self::ShellCall), + Some("shell_call_output") => deserialize_from_value(value).map(Self::ShellCallOutput), Some("reasoning") => deserialize_from_value(value).map(Self::Reasoning), Some("mcp_list_tools") => deserialize_from_value(value).map(Self::McpListTools), Some("compaction") => deserialize_from_value(value).map(Self::Compaction), @@ -625,7 +666,11 @@ fn function_call_item_id(item_id: &str) -> Option { if item_id.is_empty() { return None; } - if let Some(suffix) = item_id.strip_prefix("ctc_").filter(|suffix| !suffix.is_empty()) { + if let Some(suffix) = item_id + .strip_prefix("ctc_") + .or_else(|| item_id.strip_prefix("sh_")) + .filter(|suffix| !suffix.is_empty()) + { return Some(format!("fc_{suffix}")); } Some(item_id.to_owned()) @@ -1069,4 +1114,56 @@ mod tests { assert_eq!(public_value[0]["type"], "custom_tool_call"); assert_eq!(public_value[1]["type"], "custom_tool_call_output"); } + + #[test] + fn shell_call_and_output_parse_as_typed_input_items() { + let input: ResponsesInput = serde_json::from_value(serde_json::json!([ + { + "type": "shell_call", + "id": "sh_1", + "call_id": "call_1", + "action": {"commands": ["pwd"], "timeout_ms": 1000}, + "status": "completed" + }, + { + "type": "shell_call_output", + "call_id": "call_1", + "max_output_length": 4096, + "output": [{ + "stdout": "/workspace\n", + "stderr": "", + "outcome": {"type": "exit", "exit_code": 0} + }], + "status": "completed" + } + ])) + .expect("shell history"); + + let ResponsesInput::Items(items) = &input else { + panic!("expected item input"); + }; + assert!(matches!(items[0], InputItem::ShellCall(_))); + assert!(matches!(items[1], InputItem::ShellCallOutput(_))); + + let borrowed = serde_json::to_value(Vec::::from(&input)).unwrap(); + let owned = serde_json::to_value(Vec::::from(input.clone())).unwrap(); + let prepared = ResponsesInput::Items(Vec::from(&input)); + let model = serde_json::to_value(prepared.model_input()).unwrap(); + assert_eq!(borrowed, owned); + assert_eq!(borrowed, model); + assert_eq!(model[0]["type"], "function_call"); + assert_eq!(model[0]["id"], "fc_1"); + assert_eq!(model[0]["name"], "shell"); + assert_eq!(model[0]["call_id"], model[1]["call_id"]); + assert_eq!(model[1]["type"], "function_call_output"); + let action: Value = serde_json::from_str(model[0]["arguments"].as_str().unwrap()).unwrap(); + assert_eq!(action, serde_json::json!({"commands": ["pwd"], "timeout_ms": 1000})); + let output: Value = serde_json::from_str(model[1]["output"].as_str().unwrap()).unwrap(); + assert_eq!(output[0]["outcome"]["exit_code"], 0); + + let serialized = serde_json::to_value(input).expect("shell history serializes"); + assert_eq!(serialized[0]["type"], "shell_call"); + assert_eq!(serialized[1]["type"], "shell_call_output"); + assert_eq!(serialized[1]["output"][0]["outcome"]["exit_code"], 0); + } } diff --git a/crates/agentic-server-core/src/types/io/mod.rs b/crates/agentic-server-core/src/types/io/mod.rs index c253d2c0..62549f8b 100644 --- a/crates/agentic-server-core/src/types/io/mod.rs +++ b/crates/agentic-server-core/src/types/io/mod.rs @@ -1,5 +1,6 @@ pub mod input; pub mod output; +pub mod shell; pub mod tools; pub mod usage; @@ -15,6 +16,9 @@ pub use output::{ WebSearchActionFindInPage, WebSearchActionOpenPage, WebSearchActionSearch, WebSearchCall, WebSearchCallStatus, WebSearchSource, }; +pub use shell::{ + ShellCall, ShellCallAction, ShellCallOutcome, ShellCallOutputContent, ShellCallOutputMessage, ShellCallStatus, +}; pub use tools::{AllowedTool, AllowedToolsMode, FunctionTool, ToolChoice}; pub(crate) use tools::{resolve_tool_choice, resolve_tools}; pub use usage::{InputTokenDetails, OutputTokenDetails, ResponseUsage}; diff --git a/crates/agentic-server-core/src/types/io/output.rs b/crates/agentic-server-core/src/types/io/output.rs index a66e0eea..421f01a4 100644 --- a/crates/agentic-server-core/src/types/io/output.rs +++ b/crates/agentic-server-core/src/types/io/output.rs @@ -2,6 +2,7 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_json::Value; use crate::events::EventPayload; +use crate::events::types::ShellCommandUpdate; use crate::executor::error::ExecutorError; use crate::tool::ToolRegistry; use crate::types::event::MessageStatus; @@ -13,6 +14,7 @@ use super::input::{ CompactionItem, InputContent, InputFunctionToolCall, InputItem, InputMessage, InputMessageContent, InputTextContent, InputToolSearchCall, deserialize_non_blank_string, }; +use super::shell::ShellCall; #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))] @@ -264,6 +266,49 @@ impl TryFrom<&EventPayload> for CompactionItem { } } +impl TryFrom<&EventPayload> for ShellCall { + type Error = ExecutorError; + + fn try_from(payload: &EventPayload) -> Result { + let EventPayload::OutputItemAdded { + shell_call: Some(call), .. + } = payload + else { + return Err(ExecutorError::ParseError("expected OutputItemAdded payload".into())); + }; + Ok(call.as_ref().clone()) + } +} + +impl ApplyDone for ShellCall { + fn apply_done(&mut self, payload: &EventPayload, buffer: &mut String) { + match payload { + EventPayload::ShellCallCommand { + command_index, + update: ShellCommandUpdate::Done(command), + .. + } => { + if let Some(target) = self.action.commands.get_mut(*command_index as usize) { + *target = if command.is_empty() { + std::mem::take(buffer) + } else { + buffer.clear(); + command.clone() + }; + } + } + EventPayload::OutputItemDone { item, .. } => { + // Deserialize through the tagged enum so `type` cannot enter flattened extras. + if let Some(OutputItem::ShellCall(call)) = deserialize_from_value_opt(item.clone()) { + *self = call; + buffer.clear(); + } + } + _ => {} + } + } +} + #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))] #[serde(rename_all = "snake_case")] @@ -947,6 +992,8 @@ pub enum OutputItem { ToolSearchCall(ToolSearchCall), #[serde(rename = "custom_tool_call")] CustomToolCall(CustomToolCall), + #[serde(rename = "shell_call")] + ShellCall(ShellCall), #[serde(rename = "web_search_call")] WebSearchCall(WebSearchCall), #[serde(rename = "mcp_call")] @@ -989,6 +1036,7 @@ impl utoipa::PartialSchema for OutputItem { .item(tagged("function_call", "FunctionToolCall")) .item(tagged("tool_search_call", "ToolSearchCall")) .item(tagged("custom_tool_call", "CustomToolCall")) + .item(tagged("shell_call", "ShellCall")) .item(tagged("web_search_call", "WebSearchCall")) .item(tagged("mcp_call", "McpCall")) .item(tagged("mcp_list_tools", "McpListTools")) @@ -1013,6 +1061,7 @@ impl OutputItem { Self::FunctionCall(item) => Some(&item.id), Self::ToolSearchCall(item) => Some(&item.id), Self::CustomToolCall(item) => Some(&item.id), + Self::ShellCall(item) => item.id.as_deref(), Self::WebSearchCall(item) => Some(&item.id), Self::McpCall(item) => Some(&item.id), Self::McpListTools(item) => Some(&item.id), @@ -1028,7 +1077,7 @@ impl OutputItem { Self::FunctionCall(call) => registry .lookup(&call.name) .is_none_or(|entry| !entry.ownership.is_gateway()), - Self::ToolSearchCall(_) | Self::CustomToolCall(_) => true, + Self::ToolSearchCall(_) | Self::CustomToolCall(_) | Self::ShellCall(_) => true, Self::Message(_) | Self::WebSearchCall(_) | Self::McpCall(_) @@ -1051,6 +1100,7 @@ impl OutputItem { Self::FunctionCall(call) => Some(InputItem::FunctionCall(InputFunctionToolCall::from(call.clone()))), Self::ToolSearchCall(call) => InputToolSearchCall::try_from(call).ok().map(InputItem::ToolSearchCall), Self::CustomToolCall(call) => Some(InputItem::FunctionCall(call.clone().into())), + Self::ShellCall(call) => Some(InputItem::FunctionCall(call.clone().into())), Self::McpListTools(list_tools) => Some(InputItem::McpListTools(list_tools.clone())), Self::Compaction(item) => Some(InputItem::Compaction(item.clone())), Self::WebSearchCall(_) | Self::McpCall(_) | Self::Unknown => None, @@ -1198,6 +1248,35 @@ mod tests { assert_eq!(call.arguments, r#"{"input":"*** Begin Patch\n*** End Patch"}"#); } + #[test] + fn shell_call_round_trips_and_rehydrates_as_function_input() { + let item: OutputItem = serde_json::from_value(serde_json::json!({ + "type": "shell_call", + "id": "sh_1", + "call_id": "call_1", + "action": { + "commands": ["pwd"], + "timeout_ms": 1000, + "max_output_length": 4096 + }, + "status": "completed" + })) + .unwrap(); + + assert!(item.requires_client_action(&ToolRegistry::default())); + let Some(InputItem::FunctionCall(call)) = item.to_input_item() else { + panic!("shell call should rehydrate as a function call input item"); + }; + assert_eq!(call.call_id, "call_1"); + assert_eq!(call.name, "shell"); + assert_eq!(call.id.as_deref(), Some("fc_1")); + let action: serde_json::Value = serde_json::from_str(&call.arguments).unwrap(); + assert_eq!(action["commands"], serde_json::json!(["pwd"])); + + let serialized = serde_json::to_value(item).unwrap(); + assert_eq!(serialized["type"], "shell_call"); + } + #[test] fn web_search_call_rejects_empty_queries() { let error = WebSearchCall::try_new("ws_1", WebSearchCallStatus::Completed, Vec::new(), Vec::new()).unwrap_err(); @@ -1294,6 +1373,7 @@ mod tests { #[test] fn reasoning_output_builds_from_added_and_applies_indexed_done_events() { let added = EventPayload::OutputItemAdded { + shell_call: None, item_id: "rs_1".to_owned(), item_type: crate::events::SSEItemType::Reasoning, output_index: 2, @@ -1495,6 +1575,7 @@ mod tests { #[test] fn mcp_list_tools_builds_from_added_and_applies_done_item() { let added = EventPayload::OutputItemAdded { + shell_call: None, item_id: "mcpl_1".to_owned(), item_type: crate::events::SSEItemType::McpListTools, output_index: 0, diff --git a/crates/agentic-server-core/src/types/io/shell.rs b/crates/agentic-server-core/src/types/io/shell.rs new file mode 100644 index 00000000..3d34de7b --- /dev/null +++ b/crates/agentic-server-core/src/types/io/shell.rs @@ -0,0 +1,155 @@ +use std::collections::HashMap; + +use serde::{Deserialize, Serialize}; +use serde_json::Value; + +/// Lifecycle status for a shell call or shell call output item. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))] +#[serde(rename_all = "snake_case")] +pub enum ShellCallStatus { + InProgress, + Completed, + Incomplete, +} + +impl From for ShellCallStatus { + fn from(status: crate::types::event::MessageStatus) -> Self { + match status { + crate::types::event::MessageStatus::InProgress => Self::InProgress, + crate::types::event::MessageStatus::Completed => Self::Completed, + } + } +} + +/// Commands and execution limits requested by a model-generated shell call. +#[derive(Debug, Clone, Serialize, Deserialize)] +#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))] +pub struct ShellCallAction { + pub commands: Vec, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timeout_ms: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub max_output_length: Option, + #[serde(default, flatten)] + pub extra: HashMap, +} + +/// A model-generated request to execute one or more shell commands. +#[derive(Debug, Clone, Serialize, Deserialize)] +#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))] +pub struct ShellCall { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + pub call_id: String, + pub action: ShellCallAction, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[serde(default, flatten)] + pub extra: HashMap, +} + +/// Outcome of one command in a shell call output. +#[non_exhaustive] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))] +#[serde(tag = "type", rename_all = "snake_case")] +pub enum ShellCallOutcome { + Exit { + exit_code: i32, + }, + Timeout, + #[serde(other)] + Unknown, +} + +/// Captured output and outcome for one command in a shell call. +#[derive(Debug, Clone, Serialize, Deserialize)] +#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))] +pub struct ShellCallOutputContent { + #[serde(default)] + pub stdout: String, + #[serde(default)] + pub stderr: String, + pub outcome: ShellCallOutcome, + #[serde(default, flatten)] + pub extra: HashMap, +} + +/// Output supplied for a previously emitted shell call. +#[derive(Debug, Clone, Serialize, Deserialize)] +#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))] +pub struct ShellCallOutputMessage { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + pub call_id: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub max_output_length: Option, + pub output: Vec, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[serde(default, flatten)] + pub extra: HashMap, +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn shell_call_round_trips_with_limits_and_extra_fields() { + let value = serde_json::json!({ + "id": "sh_1", + "call_id": "call_1", + "action": { + "commands": ["pwd", "cargo test"], + "timeout_ms": 120_000, + "max_output_length": 4096, + "future_action_field": true + }, + "status": "in_progress", + "future_item_field": "kept" + }); + + let call: ShellCall = serde_json::from_value(value).unwrap(); + assert_eq!(call.action.commands, ["pwd", "cargo test"]); + assert_eq!(call.action.timeout_ms, Some(120_000)); + assert_eq!(call.status, Some(ShellCallStatus::InProgress)); + + let serialized = serde_json::to_value(call).unwrap(); + assert_eq!(serialized["future_item_field"], "kept"); + assert_eq!(serialized["action"]["future_action_field"], true); + } + + #[test] + fn shell_call_output_round_trips_exit_and_timeout_outcomes() { + let value = serde_json::json!({ + "id": "sho_1", + "call_id": "call_1", + "max_output_length": 4096, + "output": [ + { + "stdout": "ok\n", + "stderr": "", + "outcome": {"type": "exit", "exit_code": 0} + }, + { + "stdout": "", + "stderr": "timed out", + "outcome": {"type": "timeout"} + } + ], + "status": "completed" + }); + + let output: ShellCallOutputMessage = serde_json::from_value(value).unwrap(); + assert_eq!(output.output.len(), 2); + assert_eq!(output.output[0].outcome, ShellCallOutcome::Exit { exit_code: 0 }); + assert_eq!(output.output[1].outcome, ShellCallOutcome::Timeout); + assert_eq!(output.status, Some(ShellCallStatus::Completed)); + + let serialized = serde_json::to_value(output).unwrap(); + assert_eq!(serialized["output"][0]["outcome"]["type"], "exit"); + assert_eq!(serialized["output"][1]["outcome"]["type"], "timeout"); + } +} diff --git a/crates/agentic-server-core/src/types/io/tools.rs b/crates/agentic-server-core/src/types/io/tools.rs index 808dc636..66e38688 100644 --- a/crates/agentic-server-core/src/types/io/tools.rs +++ b/crates/agentic-server-core/src/types/io/tools.rs @@ -20,6 +20,7 @@ pub enum ToolChoice { Auto, None, Required, + Shell, Function { namespace: Option, name: NonEmptyToolName, @@ -117,6 +118,11 @@ impl Serialize for ToolChoice { Self::Auto => serializer.serialize_str("auto"), Self::None => serializer.serialize_str("none"), Self::Required => serializer.serialize_str("required"), + Self::Shell => { + let mut map = serializer.serialize_map(Some(1))?; + map.serialize_entry("type", "shell")?; + map.end() + } Self::Function { namespace, name } => { let mut map = serializer.serialize_map(Some(2 + usize::from(namespace.is_some())))?; map.serialize_entry("type", "function")?; @@ -160,6 +166,9 @@ impl<'de> Deserialize<'de> for ToolChoice { )), }, Value::Object(object) => { + if object.get("type").and_then(Value::as_str) == Some("shell") { + return Ok(Self::Shell); + } if object.get("type").and_then(Value::as_str) == Some("function") { let namespace = object.get("namespace").and_then(Value::as_str).map(str::to_string); let name = object @@ -220,6 +229,11 @@ impl ToolChoice { #[must_use] pub(crate) fn normalized_for_upstream(&self) -> Self { match self { + Self::Shell => Self::Function { + namespace: None, + name: NonEmptyToolName::try_from(crate::tool::shell::SHELL_FUNCTION_NAME) + .expect("shell is a non-empty tool name"), + }, Self::Custom { name } => Self::Function { namespace: None, name: name.clone(), diff --git a/crates/agentic-server-core/src/types/mod.rs b/crates/agentic-server-core/src/types/mod.rs index b6bf8c43..bff79f6f 100644 --- a/crates/agentic-server-core/src/types/mod.rs +++ b/crates/agentic-server-core/src/types/mod.rs @@ -10,9 +10,10 @@ pub use io::{ InputFunctionToolCall, InputImageContent, InputItem, InputMessage, InputMessageContent, InputTextContent, InputTokenDetails, InputToolSearchCall, McpCall, McpCallError, McpCallStatus, McpToolExecutionError, McpToolExecutionErrorContent, OutputItem, OutputMessage, OutputTextContent, OutputTokenDetails, ReasoningOutput, - ReasoningTextContent, ResponseUsage, ResponsesInput, ToolCallOutput, ToolChoice, ToolOutputContent, ToolSearchCall, - ToolSearchOutputMessage, WebSearchAction, WebSearchActionError, WebSearchActionFindInPage, WebSearchActionOpenPage, - WebSearchActionSearch, WebSearchCall, WebSearchCallStatus, WebSearchSource, + ReasoningTextContent, ResponseUsage, ResponsesInput, ShellCall, ShellCallAction, ShellCallOutcome, + ShellCallOutputContent, ShellCallOutputMessage, ShellCallStatus, ToolCallOutput, ToolChoice, ToolOutputContent, + ToolSearchCall, ToolSearchOutputMessage, WebSearchAction, WebSearchActionError, WebSearchActionFindInPage, + WebSearchActionOpenPage, WebSearchActionSearch, WebSearchCall, WebSearchCallStatus, WebSearchSource, }; pub use request_response::{ CompactRequest, CompactedResponse, ContextManagement, IncompleteDetails, ReasoningConfig, RequestPayload, @@ -20,7 +21,7 @@ pub use request_response::{ }; pub use tools::{ CodeInterpreterToolParam, CodexNamespaceMember, CodexNamespaceToolParam, CustomToolParam, EmptyToolNameError, - FileSearchToolParam, FunctionToolParam, McpToolParam, NonEmptyToolName, ResponsesTool, ToolSearchExecution, - ToolSearchStatus, ToolSearchToolParam, WebSearchContextSize, WebSearchFilters, WebSearchToolParam, - WebSearchUserLocation, + FileSearchToolParam, FunctionToolParam, LocalShellEnvironment, McpToolParam, NonEmptyToolName, ResponsesTool, + ShellEnvironment, ShellToolParam, ToolSearchExecution, ToolSearchStatus, ToolSearchToolParam, WebSearchContextSize, + WebSearchFilters, WebSearchToolParam, WebSearchUserLocation, }; diff --git a/crates/agentic-server-core/src/types/request_response.rs b/crates/agentic-server-core/src/types/request_response.rs index 73edb30d..6359e247 100644 --- a/crates/agentic-server-core/src/types/request_response.rs +++ b/crates/agentic-server-core/src/types/request_response.rs @@ -543,6 +543,8 @@ impl From<&ResponsesInput> for Vec { .iter() .filter_map(|item| match item { InputItem::Unknown => None, + InputItem::ShellCall(call) => Some(InputItem::FunctionCall(call.clone().into())), + InputItem::ShellCallOutput(output) => Some(InputItem::FunctionCallOutput(output.clone().into())), InputItem::CustomToolCall(call) => Some(InputItem::FunctionCall(call.clone().into())), InputItem::CustomToolCallOutput(output) => { Some(InputItem::FunctionCallOutput(output.clone().into())) @@ -567,6 +569,8 @@ impl From for Vec { .into_iter() .filter_map(|item| match item { InputItem::Unknown => None, + InputItem::ShellCall(call) => Some(InputItem::FunctionCall(call.into())), + InputItem::ShellCallOutput(output) => Some(InputItem::FunctionCallOutput(output.into())), InputItem::CustomToolCall(call) => Some(InputItem::FunctionCall(call.into())), InputItem::CustomToolCallOutput(output) => Some(InputItem::FunctionCallOutput(output.into())), item => Some(item), diff --git a/crates/agentic-server-core/src/types/tools/mod.rs b/crates/agentic-server-core/src/types/tools/mod.rs index a7bf4b76..1e8c14a8 100644 --- a/crates/agentic-server-core/src/types/tools/mod.rs +++ b/crates/agentic-server-core/src/types/tools/mod.rs @@ -7,7 +7,7 @@ pub mod params; pub use params::{ CodeInterpreterToolParam, CodexNamespaceMember, CodexNamespaceToolParam, CustomToolParam, EmptyToolNameError, - FileSearchToolParam, FunctionToolParam, McpDiscoveredToolParam, McpToolParam, NonEmptyToolName, ResponsesTool, - ToolSearchExecution, ToolSearchStatus, ToolSearchToolParam, WebSearchContextSize, WebSearchFilters, - WebSearchToolParam, WebSearchUserLocation, + FileSearchToolParam, FunctionToolParam, LocalShellEnvironment, McpDiscoveredToolParam, McpToolParam, + NonEmptyToolName, ResponsesTool, ShellEnvironment, ShellToolParam, ToolSearchExecution, ToolSearchStatus, + ToolSearchToolParam, WebSearchContextSize, WebSearchFilters, WebSearchToolParam, WebSearchUserLocation, }; diff --git a/crates/agentic-server-core/src/types/tools/params.rs b/crates/agentic-server-core/src/types/tools/params.rs index 77ce5fb5..5c54af18 100644 --- a/crates/agentic-server-core/src/types/tools/params.rs +++ b/crates/agentic-server-core/src/types/tools/params.rs @@ -114,6 +114,8 @@ pub enum ResponsesTool { FileSearch(FileSearchToolParam), #[serde(rename = "code_interpreter")] CodeInterpreter(CodeInterpreterToolParam), + #[serde(rename = "shell")] + Shell(ShellToolParam), #[serde(rename = "namespace")] Namespace(CodexNamespaceToolParam), /// A freeform tool declaration. Unlike a function tool, calls carry raw @@ -298,6 +300,98 @@ pub struct FileSearchToolParam { #[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))] pub struct CodeInterpreterToolParam {} +/// Parameters for the shell built-in tool. +#[derive(Debug, Clone, Serialize, Deserialize)] +#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))] +pub struct ShellToolParam { + pub environment: ShellEnvironment, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub allowed_callers: Option>, + #[serde(default, flatten)] + pub extra: HashMap, +} + +/// Environment in which shell calls are executed. +#[non_exhaustive] +#[derive(Debug, Clone)] +pub enum ShellEnvironment { + Local(LocalShellEnvironment), + Unknown(Value), +} + +#[cfg(feature = "openapi")] +impl utoipa::PartialSchema for ShellEnvironment { + fn schema() -> utoipa::openapi::RefOr { + use utoipa::openapi::Ref; + use utoipa::openapi::schema::{AllOfBuilder, ObjectBuilder, SchemaType, Type}; + + AllOfBuilder::new() + .item( + ObjectBuilder::new() + .property( + "type", + ObjectBuilder::new() + .schema_type(SchemaType::new(Type::String)) + .enum_values(Some(["local"])), + ) + .required("type"), + ) + .item(Ref::from_schema_name("LocalShellEnvironment")) + .into() + } +} + +#[cfg(feature = "openapi")] +impl utoipa::ToSchema for ShellEnvironment { + fn name() -> std::borrow::Cow<'static, str> { + std::borrow::Cow::Borrowed("ShellEnvironment") + } +} + +impl Serialize for ShellEnvironment { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + let mut value = match self { + Self::Local(environment) => serde_json::to_value(environment).map_err(serde::ser::Error::custom)?, + Self::Unknown(value) => return value.serialize(serializer), + }; + let object = value + .as_object_mut() + .ok_or_else(|| serde::ser::Error::custom("shell environment must serialize as an object"))?; + object.insert("type".to_owned(), Value::String("local".to_owned())); + value.serialize(serializer) + } +} + +impl<'de> Deserialize<'de> for ShellEnvironment { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let mut value = Value::deserialize(deserializer)?; + if value.get("type").and_then(Value::as_str) != Some("local") { + return Ok(Self::Unknown(value)); + } + value + .as_object_mut() + .expect("a value with a string type field must be an object") + .remove("type"); + serde_json::from_value(value) + .map(Self::Local) + .map_err(serde::de::Error::custom) + } +} + +/// Caller-provided local environment configuration. +#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))] +pub struct LocalShellEnvironment { + #[serde(default, flatten)] + pub extra: HashMap, +} + #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))] pub struct CodexNamespaceToolParam { @@ -368,6 +462,7 @@ impl utoipa::PartialSchema for ResponsesTool { ) .item(tagged("file_search", "FileSearchToolParam")) .item(tagged("code_interpreter", "CodeInterpreterToolParam")) + .item(tagged("shell", "ShellToolParam")) .item(tagged("namespace", "CodexNamespaceToolParam")) .item(tagged("custom", "CustomToolParam")) .into() @@ -422,6 +517,7 @@ impl ResponsesTool { Self::WebSearch(_) => Some("web_search_preview"), Self::FileSearch(_) => Some("file_search"), Self::CodeInterpreter(_) => Some("code_interpreter"), + Self::Shell(_) => Some("shell"), Self::Namespace(_) => Some("namespace"), Self::Custom(_) => Some("custom"), Self::Unknown => None, @@ -739,6 +835,50 @@ mod tests { assert_eq!(serde_json::to_value(&tool).unwrap()["type"], "code_interpreter"); } + #[test] + fn responses_tool_shell_local_environment_round_trips() { + let json = serde_json::json!({ + "type": "shell", + "environment": { + "type": "local", + "skills": [{"name": "repo", "path": "/workspace/repo"}] + }, + "allowed_callers": ["assistant"], + "future_tool_field": true + }); + let tool: ResponsesTool = serde_json::from_value(json).unwrap(); + assert!(matches!(tool, ResponsesTool::Shell(_))); + + let serialized = serde_json::to_value(tool).unwrap(); + assert_eq!(serialized["type"], "shell"); + assert_eq!(serialized["environment"]["type"], "local"); + assert_eq!(serialized["environment"]["skills"][0]["name"], "repo"); + assert_eq!(serialized["allowed_callers"][0], "assistant"); + assert_eq!(serialized["future_tool_field"], true); + } + + #[test] + fn responses_tool_shell_preserves_unknown_environment() { + let json = serde_json::json!({ + "type": "shell", + "environment": { + "type": "container_reference", + "container": "cntr_123", + "future_environment_field": true + } + }); + let tool: ResponsesTool = serde_json::from_value(json.clone()).unwrap(); + assert!(matches!( + tool, + ResponsesTool::Shell(ShellToolParam { + environment: ShellEnvironment::Unknown(_), + .. + }) + )); + + assert_eq!(serde_json::to_value(tool).unwrap(), json); + } + #[test] fn mcp_tool_param_round_trips_with_tool_schema() { let json = serde_json::json!({ diff --git a/crates/agentic-server-core/tests/cassettes/README.md b/crates/agentic-server-core/tests/cassettes/README.md index ef30b4e1..467a1acb 100644 --- a/crates/agentic-server-core/tests/cassettes/README.md +++ b/crates/agentic-server-core/tests/cassettes/README.md @@ -208,6 +208,7 @@ turns: | `record_tool_call_cassettes.sh` | 8 tool-call cassettes (4 tool_choice modes x streaming + non-streaming) | vLLM | | `record_codex_cli_tool_call_cassettes.sh` | Codex function/namespace/custom-tool matrix | gateway, vLLM, and OpenAI | | `record_custom_tool_cassettes.sh` | Matching two-turn custom-tool flows (streaming + non-streaming) | gateway and OpenAI reference | +| `record_shell_cassettes.sh` | Four two-turn local-shell scenarios (streaming + non-streaming) | gateway and OpenAI reference | | `record_mcp_cassettes.sh` | Native MCP counter tool discovery and calls (streaming + non-streaming) | gateway and OpenAI reference | | `record_web_search_cassettes.sh` | Matching web-search calls (streaming + non-streaming) | gateway and OpenAI reference | | `record_dynamo_cassettes.sh` | Stateful two-turn and client-executed function tool call cassettes (streaming + non-streaming) | NVIDIA Dynamo frontend | @@ -355,6 +356,26 @@ bash crates/agentic-server-core/tests/cassettes/record_custom_tool_cassettes.sh Use `CUSTOM_TOOL_RECORD_SET=gateway` or `CUSTOM_TOOL_RECORD_SET=openai` to record only one provider. +### Shell (gateway and OpenAI) + +See [the shell recording guide](shell/README.md) for branch build, gateway startup, +and recording commands. Each scenario records two requests: a shell call, then +matching structured `shell_call_output` and a follow-up user message chained with +`previous_response_id`. The cases cover successful output, stderr with a nonzero +exit code, timeout, and multiple commands with ordered outputs. Both streaming +and non-streaming modes are recorded for each provider. + +The client command outputs are simulated by `shell/scenarios.py`; no commands are +executed. The requests and model responses are captured live by the standard +recorder. Each recording is written directly to its output YAML, which is retained +if recording or validation fails. Streaming validation requires command added/delta/done +events. Use `SHELL_RECORD_SET=gateway`, `openai`, or `all` (default). + +The shared recorder's `--tool-outputs` option accepts a Python `shell(action=...)` +callback or a JSON `shell` key containing an object with `output` and optional +`max_output_length`. It builds `shell_call_output` using the actual `call_id` and +preserves the structured stdout/stderr/outcome entries. + ### Codex custom tools (gateway, vLLM, and OpenAI) The custom fixture uses a Lark grammar and records two turns: the model returns raw `custom_tool_call.input`, then the diff --git a/crates/agentic-server-core/tests/cassettes/record_cassette.py b/crates/agentic-server-core/tests/cassettes/record_cassette.py index c302546e..fccbfcbe 100644 --- a/crates/agentic-server-core/tests/cassettes/record_cassette.py +++ b/crates/agentic-server-core/tests/cassettes/record_cassette.py @@ -694,28 +694,27 @@ def _inject_tools( def _extract_tool_calls(response_data: dict | None) -> list[dict]: - """Extract client-owned tool calls from a Responses output.""" + """Extract client-executed function, custom, shell, and tool-search calls from a response.""" if not response_data: return [] output = response_data.get("output", []) return [ item for item in output - if item.get("type") - in {"function_call", "custom_tool_call", "tool_search_call"} + if item.get("type") in {"function_call", "custom_tool_call", "shell_call", "tool_search_call"} ] def _build_tool_output_input( tool_calls: list[dict], - tool_outputs: "dict[str, str] | types.ModuleType", + tool_outputs: "dict[str, Any] | types.ModuleType", user_prompt: str | None, tool_search_tools: list[dict] | None = None, ) -> list[dict]: """Build tool output items followed by an optional user message. Args: - tool_calls: client-owned function, custom, or tool-search calls from the previous response. + tool_calls: function_call, custom_tool_call, shell_call, or tool_search_call output items. tool_outputs: either - a dict mapping tool name -> fake JSON output string (loaded from a --tool-outputs *.json* file), matched by name only; or @@ -729,6 +728,9 @@ def _build_tool_output_input( provider's behavior when the client leaves one specific pending call unresolved (e.g. one of two parallel calls to the same tool with different arguments) while resolving its sibling(s). + Shell calls use the key/function `shell`. Its value (or return value + from `shell(action=...)`) is an object containing the structured + `output` array and optional `max_output_length`, not a JSON string. user_prompt: the next user message (None for tool-output-only turns). tool_search_tools: tools returned for public or synthetic tool search. @@ -744,6 +746,21 @@ def _build_tool_output_input( ) call_type = call.get("type") + if call_type == "shell_call": + if isinstance(tool_outputs, types.ModuleType): + fn = getattr(tool_outputs, "shell", None) + result = fn(action=call["action"]) if fn else None + else: + result = tool_outputs.get("shell") + if result is None: + continue + if not isinstance(result, dict) or not isinstance(result.get("output"), list): + raise click.UsageError("shell tool output must be an object containing an output array") + item = {"type": "shell_call_output", "call_id": call_id, "output": result["output"]} + if "max_output_length" in result: + item["max_output_length"] = result["max_output_length"] + input_items.append(item) + continue name = call.get("name", "") is_public_search = call_type == "tool_search_call" is_synthetic_search = call_type == "function_call" and name == "tool_search" @@ -1039,7 +1056,7 @@ def run_responses( tools: list | None = None, tool_choice: Any = None, tool_choice_sequence: list[Any] | None = None, - tool_outputs: "dict[str, str] | types.ModuleType | None" = None, + tool_outputs: "dict[str, Any] | types.ModuleType | None" = None, tool_search_output_tools: list[dict] | None = None, tools_after_search: list | None = None, max_output_tokens: int | None = None, @@ -1326,7 +1343,9 @@ def run_responses( help="Path to a *.json file mapping tool names to fake output strings, or a *.py file defining " "one function per tool name (called with the model's actual parsed arguments; returning None " "omits that call's output). When provided, matching function_call_output or " - "custom_tool_call_output items are injected between turns (required for OpenAI Responses API).", + "custom_tool_call_output items are injected between turns (required for OpenAI Responses API). " + "Shell calls use the key/function shell (called with action=...) returning an object with " + "an output array and optional max_output_length for shell_call_output.", ) @click.option( "--tool-search-output-tools", @@ -1519,7 +1538,7 @@ def main( if parallel_tool_calls_raw is not None: parallel_tool_calls = parallel_tool_calls_raw == "true" - tool_outputs: "dict[str, str] | types.ModuleType | None" = None + tool_outputs: "dict[str, Any] | types.ModuleType | None" = None if tool_outputs_file: if tool_outputs_file.endswith(".py"): spec = importlib.util.spec_from_file_location("cassette_tool_outputs", tool_outputs_file) diff --git a/crates/agentic-server-core/tests/cassettes/record_shell_cassettes.sh b/crates/agentic-server-core/tests/cassettes/record_shell_cassettes.sh new file mode 100755 index 00000000..7bc325c9 --- /dev/null +++ b/crates/agentic-server-core/tests/cassettes/record_shell_cassettes.sh @@ -0,0 +1,94 @@ +#!/usr/bin/env bash +# Records two-turn local-shell conversations against the gateway and OpenAI. +# Turn 1 requests a shell_call; turn 2 submits simulated shell_call_output and +# a follow-up user message, then captures the model's interpretation. +# Covers success, nonzero exit, timeout, and multiple commands in both modes. +# Model-generated commands are never executed. See shell/scenarios.py. +# Usage: SHELL_RECORD_SET=gateway GATEWAY_URL=http://localhost:9000 MODEL=... bash "$0" + +set -euo pipefail + +SCRIPTS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +BASE_DIR="${SHELL_OUTPUT_DIR:-$SCRIPTS_DIR/shell}" +TOOLS_FILE="$SCRIPTS_DIR/shell/tools.json" +SCENARIOS_FILE="$SCRIPTS_DIR/shell/scenarios.py" +GATEWAY_URL="${GATEWAY_URL:-http://localhost:9000}" +MODEL="${MODEL:-Qwen/Qwen3.5-35B-A3B-FP8}" +MODEL_SLUG="$(echo "$MODEL" | tr '/: ' '---')" +OPENAI_MODEL="${OPENAI_MODEL:-gpt-5.6}" +OPENAI_MODEL_SLUG="$(echo "$OPENAI_MODEL" | tr '/: ' '---')" +SHELL_RECORD_SET="${SHELL_RECORD_SET:-all}" +record_scenario() { + local endpoint_flag="$1" + local endpoint="$2" + local model="$3" + local output="$4" + local stream_flag="$5" + local scenario="$6" + echo "Recording $scenario ($stream_flag) against $endpoint with $model" + if ! python "$SCENARIOS_FILE" prompts "$scenario" \ + | python "$SCRIPTS_DIR/record_cassette.py" \ + --mode responses \ + --turns 2 \ + "$stream_flag" \ + --model "$model" \ + "$endpoint_flag" "$endpoint" \ + --tools "$TOOLS_FILE" \ + --tool-outputs "$SCENARIOS_FILE" \ + --tool-choice auto \ + --max-output-tokens 4096 \ + --output "$output" + then + echo "ERROR: recording failed; captured YAML retained at $output" >&2 + return 1 + fi + if ! python "$SCENARIOS_FILE" validate "$output" "$scenario" "$stream_flag"; then + echo "ERROR: validation failed; captured YAML retained at $output" >&2 + return 1 + fi +} + +record_provider_suite() { + local endpoint_flag="$1" + local endpoint="$2" + local model="$3" + local slug="$4" + local provider="$5" + local scenario + + for scenario in success nonzero-exit timeout multiple-commands; do + record_scenario \ + "$endpoint_flag" "$endpoint" "$model" \ + "$BASE_DIR/shell-${provider}-${scenario}-${slug}-streaming.yaml" --stream "$scenario" + record_scenario \ + "$endpoint_flag" "$endpoint" "$model" \ + "$BASE_DIR/shell-${provider}-${scenario}-${slug}-nonstreaming.yaml" --no-stream "$scenario" + done +} + +case "$SHELL_RECORD_SET" in + gateway|openai|all) ;; + *) + echo "ERROR: SHELL_RECORD_SET must be gateway, openai, or all" >&2 + exit 1 + ;; +esac + +if [[ "$SHELL_RECORD_SET" == "openai" || "$SHELL_RECORD_SET" == "all" ]]; then + if [[ -z "${OPENAI_API_KEY:-}" ]]; then + echo "ERROR: OPENAI_API_KEY must be set for SHELL_RECORD_SET=$SHELL_RECORD_SET" >&2 + exit 1 + fi +fi + +mkdir -p "$BASE_DIR" + +if [[ "$SHELL_RECORD_SET" == "openai" || "$SHELL_RECORD_SET" == "all" ]]; then + record_provider_suite --openai https://api.openai.com "$OPENAI_MODEL" "$OPENAI_MODEL_SLUG" openai-reference +fi + +if [[ "$SHELL_RECORD_SET" == "gateway" || "$SHELL_RECORD_SET" == "all" ]]; then + record_provider_suite --gateway "$GATEWAY_URL" "$MODEL" "$MODEL_SLUG" gateway +fi + +echo "Shell cassettes recorded and validated in $BASE_DIR" diff --git a/crates/agentic-server-core/tests/cassettes/shell/scenarios.py b/crates/agentic-server-core/tests/cassettes/shell/scenarios.py new file mode 100644 index 00000000..1f2ab91f --- /dev/null +++ b/crates/agentic-server-core/tests/cassettes/shell/scenarios.py @@ -0,0 +1,195 @@ +"""Local-shell recording inputs and validation; command outputs are simulated. + +No model-generated command is executed. Only the fixed commands below have +client output fixtures. API requests/responses are captured by record_cassette.py. +Wire format: https://developers.openai.com/api/docs/guides/tools-shell#local-shell-mode +""" + +import copy +import json +import sys +from pathlib import Path + +import yaml + + +def exited(stdout: str = "", stderr: str = "", code: int = 0) -> dict: + return {"stdout": stdout, "stderr": stderr, "outcome": {"type": "exit", "exit_code": code}} + + +COMMAND_OUTPUTS = { + "printf 'SHELL_OK\\n'": exited(stdout="SHELL_OK\n"), + "printf 'SHELL_ERROR\\n' >&2; exit 7": exited(stderr="SHELL_ERROR\n", code=7), + "printf 'SHELL_ERROR\\n' >&2": exited(stderr="SHELL_ERROR\n"), + "exit 7": exited(code=7), + "sleep 2": {"stdout": "", "stderr": "", "outcome": {"type": "timeout"}}, +} +SCENARIOS = { + "success": ["printf 'SHELL_OK\\n'"], + "nonzero-exit": ["printf 'SHELL_ERROR\\n' >&2; exit 7"], + "timeout": ["sleep 2"], + "multiple-commands": ["printf 'SHELL_OK\\n'", "printf 'SHELL_ERROR\\n' >&2; exit 7", "sleep 2"], +} +FOLLOW_UP = ( + "Use the shell output above without calling any more tools. For each command, " + "report its stdout, stderr, and exit code or timeout outcome in order." +) + + +def first_prompt(scenario: str) -> str: + return ( + "The local shell environment is Linux bash. Use the shell tool exactly once " + "with this exact action, preserving the commands array and its order: " + + json.dumps({"commands": SCENARIOS[scenario], "timeout_ms": 1000, "max_output_length": 4096}) + + ". Keep semicolon-separated statements in the same command string. " + "Wait for the client to return shell_call_output before interpreting the results." + ) + + +def shell(action: dict) -> dict: + """--tool-outputs callback: return structured fixtures for the actual commands.""" + commands = action.get("commands") + if not isinstance(commands, list) or not commands: + raise ValueError("Expected a nonempty shell commands array") + for command in commands: + if command not in COMMAND_OUTPUTS: + raise ValueError(f"No simulated shell output for command: {command!r}") + result = {"output": [copy.deepcopy(COMMAND_OUTPUTS[command]) for command in commands]} + if action.get("max_output_length") is not None: + result["max_output_length"] = action["max_output_length"] + return result + + +def require(condition: bool, message: str) -> None: + if not condition: + raise ValueError(message) + + +def completed_response(turn: dict, streaming: bool) -> dict: + response = turn["response"] + require(response.get("status_code") == 200, f"HTTP recording failed: {response.get('status_code')}") + if streaming: + events = [ + json.loads(line[5:].strip()) + for raw in response.get("sse", []) + for line in raw.splitlines() + if line.startswith("data:") and line[5:].strip() != "[DONE]" + ] + require( + not any(event.get("type") in {"error", "response.failed", "response.incomplete"} for event in events), + "Recording contains a failed or incomplete streaming event", + ) + completed = [event["response"] for event in events if event.get("type") == "response.completed"] + require(len(completed) == 1, "Expected one response.completed event") + body = completed[0] + calls = [item for item in body.get("output", []) if item.get("type") == "shell_call"] + for call in calls: + for event_type in ("response.output_item.added", "response.output_item.done"): + require( + any( + event.get("type") == event_type + and event.get("item", {}).get("type") == "shell_call" + and event["item"].get("id") == call.get("id") + for event in events + ), + f"Missing {event_type} for shell_call", + ) + added = next(event for event in events if event.get("type") == "response.output_item.added" + and event.get("item", {}).get("id") == call["id"]) + require(added["item"]["action"]["commands"] == [], "Shell item must start with empty commands") + index = added["output_index"] + commands = [] + done = [] + for event in events: + if event.get("output_index") != index: + continue + kind = event.get("type", "") + if not kind.startswith("response.shell_call_command."): + continue + command_index = event.get("command_index") + require(type(command_index) is int and command_index >= 0, "Invalid command_index") + if kind == "response.shell_call_command.added": + require(command_index == len(commands), "Command added out of order") + commands.append(event["command"]) + done.append(False) + else: + require(command_index < len(commands) and not done[command_index], "No active shell command") + if kind == "response.shell_call_command.delta": + commands[command_index] += event["delta"] + elif kind == "response.shell_call_command.done": + require(event["command"] == commands[command_index], "Command done differs from deltas") + done[command_index] = True + require(commands == call["action"]["commands"] and all(done), "Missing or incomplete shell command events") + else: + body = response.get("body", {}) + require(body.get("status") == "completed", "Response did not complete") + require(bool(body.get("id")), "Response has no ID") + return body + + +def validate(document: dict, scenario: str, streaming: bool) -> None: + turns = document.get("turns", []) + require(len(turns) == 2, "Expected exactly two recorded requests") + requests = [turn["request"]["body"] for turn in turns] + for request in requests: + require(request.get("stream") is streaming, "Wrong stream mode") + require(request.get("store") is True, "Stored responses are required for continuation") + require( + request.get("tools") == [{"type": "shell", "environment": {"type": "local"}}], + "Expected the documented local shell tool declaration", + ) + responses = [completed_response(turn, streaming) for turn in turns] + require(requests[0].get("input") == first_prompt(scenario), "Wrong first prompt") + require(requests[1].get("previous_response_id") == responses[0]["id"], "Broken previous_response_id chain") + calls = [item for item in responses[0].get("output", []) if item.get("type") == "shell_call"] + require(len(calls) == 1, "Expected exactly one shell_call in the first response") + call = calls[0] + require(bool(call.get("call_id")), "Missing shell call_id") + # Some models split the stderr/exit script into two commands. Preserve that + # actual action and supply one accurate fixture per command, including exit 0 + # for printf and exit 7 for the separate exit command. + expected_commands = SCENARIOS[scenario] + split_commands = [ + part + for command in expected_commands + for part in ( + ["printf 'SHELL_ERROR\\n' >&2", "exit 7"] + if command == "printf 'SHELL_ERROR\\n' >&2; exit 7" + else [command] + ) + ] + require( + call["action"].get("commands") in [expected_commands, split_commands], + "Model did not emit the requested commands or the supported split stderr/exit commands", + ) + require(call["action"].get("timeout_ms") == 1000, "Model did not emit the requested timeout_ms") + require(call["action"].get("max_output_length") == 4096, "Model did not emit the requested max_output_length") + expected_output = {"type": "shell_call_output", "call_id": call["call_id"], **shell(call["action"])} + require( + requests[1].get("input") == [expected_output, {"type": "message", "role": "user", "content": FOLLOW_UP}], + "Continuation must contain matching structured shell output followed by the user message", + ) + output = responses[1].get("output", []) + require( + not any(item.get("type") in {"shell_call", "function_call", "custom_tool_call"} for item in output), + "Second response requested another tool call instead of interpreting the output", + ) + text = "".join( + part.get("text", "") + for item in output if item.get("type") == "message" + for part in item.get("content", []) if part.get("type") == "output_text" + ) + require(bool(text.strip()), "Second response has no final assistant text") + + +if __name__ == "__main__": + if sys.argv[1] == "prompts": + print(first_prompt(sys.argv[2])) + print(FOLLOW_UP) + elif sys.argv[1] == "validate": + try: + validate(yaml.safe_load(Path(sys.argv[2]).read_text()), sys.argv[3], sys.argv[4] == "--stream") + except (ValueError, KeyError, TypeError) as error: + raise SystemExit(f"ERROR: {sys.argv[2]}: {error}") from error + else: + raise SystemExit("Usage: scenarios.py prompts SCENARIO | validate FILE SCENARIO --stream/--no-stream") diff --git a/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-multiple-commands-Qwen-Qwen3.5-35B-A3B-FP8-nonstreaming.yaml b/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-multiple-commands-Qwen-Qwen3.5-35B-A3B-FP8-nonstreaming.yaml new file mode 100644 index 00000000..6804cc5f --- /dev/null +++ b/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-multiple-commands-Qwen-Qwen3.5-35B-A3B-FP8-nonstreaming.yaml @@ -0,0 +1,214 @@ +turns: +- filename: t1 + request: + body: + input: 'The local shell environment is Linux bash. Use the shell tool exactly + once with this exact action, preserving the commands array and its order: + {"commands": ["printf ''SHELL_OK\\n''", "printf ''SHELL_ERROR\\n'' >&2; exit + 7", "sleep 2"], "timeout_ms": 1000, "max_output_length": 4096}. Keep semicolon-separated + statements in the same command string. Wait for the client to return shell_call_output + before interpreting the results.' + max_output_tokens: 4096 + model: Qwen/Qwen3.5-35B-A3B-FP8 + store: true + stream: false + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + body: + conversation_id: null + created_at: 1788851408 + error: null + id: resp_01a07fda-4a82-7130-9be9-183ef7971b0b + incomplete_details: null + instructions: null + model: Qwen/Qwen3.5-35B-A3B-FP8 + object: response + output: + - content: + - text: 'The user wants me to execute a shell command using the shell tool. + They''ve provided the exact parameters I need to use: + + + 1. commands: ["printf ''SHELL_OK\\n''", "printf ''SHELL_ERROR\\n'' >&2; + exit 7", "sleep 2"] + + 2. timeout_ms: 1000 + + 3. max_output_length: 4096 + + + I need to call the shell function with these exact parameters. The commands + array has 3 commands that will be executed in order. I should wait for + the result before interpreting it. + + + Let me make the function call with these exact parameters. + + ' + type: reasoning_text + encrypted_content: null + id: rs_b5200a0edbcbd490 + status: null + summary: [] + type: reasoning + - action: + commands: + - printf 'SHELL_OK\n' + - printf 'SHELL_ERROR\n' >&2; exit 7 + - sleep 2 + max_output_length: 4096 + timeout_ms: 1000 + call_id: chatcmpl-tool-a5c8933a3e6749ed + id: sh_bea2ca3d52270581 + status: completed + type: shell_call + previous_response_id: null + status: completed + usage: + input_tokens: 505 + input_tokens_details: + cached_tokens: 0 + output_tokens: 222 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 727 + headers: + content-type: application/json + status_code: 200 +- filename: t2 + request: + body: + input: + - call_id: chatcmpl-tool-a5c8933a3e6749ed + max_output_length: 4096 + output: + - outcome: + exit_code: 0 + type: exit + stderr: '' + stdout: 'SHELL_OK + + ' + - outcome: + exit_code: 7 + type: exit + stderr: 'SHELL_ERROR + + ' + stdout: '' + - outcome: + type: timeout + stderr: '' + stdout: '' + type: shell_call_output + - content: Use the shell output above without calling any more tools. For each + command, report its stdout, stderr, and exit code or timeout outcome in + order. + role: user + type: message + max_output_tokens: 4096 + model: Qwen/Qwen3.5-35B-A3B-FP8 + previous_response_id: resp_01a07fda-4a82-7130-9be9-183ef7971b0b + store: true + stream: false + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + body: + conversation_id: null + created_at: 1788851411 + error: null + id: resp_01a07fda-5048-7722-85c5-689b32df7131 + incomplete_details: null + instructions: null + model: Qwen/Qwen3.5-35B-A3B-FP8 + object: response + output: + - content: + - text: "Let me analyze the shell output for each command in order:\n\n1.\ + \ First command: `printf 'SHELL_OK\\n'`\n - stdout: \"SHELL_OK\\n\"\n\ + \ - stderr: \"\" (empty)\n - outcome: exit_code 0 (successful completion)\n\ + \n2. Second command: `printf 'SHELL_ERROR\\n' >&2; exit 7`\n - stdout:\ + \ \"\" (empty)\n - stderr: \"SHELL_ERROR\\n\"\n - outcome: exit_code\ + \ 7 (the exit command)\n\n3. Third command: `sleep 2`\n - stdout: \"\ + \" (empty)\n - stderr: \"\" (empty)\n - outcome: timeout (the command\ + \ timed out, which makes sense since sleep 2 with a 1000ms timeout would\ + \ timeout)\n\nI need to report these results in order for each command.\n" + type: reasoning_text + encrypted_content: null + id: rs_ae78128de0c6afde + status: null + summary: [] + type: reasoning + - content: + - annotations: [] + text: ' + + + Here are the results for each command in order: + + + **Command 1: `printf ''SHELL_OK\n''`** + + - stdout: `SHELL_OK` + + - stderr: (empty) + + - exit code: 0 (success) + + + **Command 2: `printf ''SHELL_ERROR\n'' >&2; exit 7`** + + - stdout: (empty) + + - stderr: `SHELL_ERROR` + + - exit code: 7 (explicit exit) + + + **Command 3: `sleep 2`** + + - stdout: (empty) + + - stderr: (empty) + + - outcome: timeout (the command exceeded the 1000ms timeout)' + type: output_text + id: msg_bcf01bcdb77a96c6 + role: assistant + status: completed + type: message + previous_response_id: resp_01a07fda-4a82-7130-9be9-183ef7971b0b + status: completed + usage: + input_tokens: 695 + input_tokens_details: + cached_tokens: 0 + output_tokens: 337 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 1032 + headers: + content-type: application/json + status_code: 200 diff --git a/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-multiple-commands-Qwen-Qwen3.5-35B-A3B-FP8-streaming.yaml b/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-multiple-commands-Qwen-Qwen3.5-35B-A3B-FP8-streaming.yaml new file mode 100644 index 00000000..568965ba --- /dev/null +++ b/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-multiple-commands-Qwen-Qwen3.5-35B-A3B-FP8-streaming.yaml @@ -0,0 +1,6707 @@ +turns: +- filename: t1 + request: + body: + input: 'The local shell environment is Linux bash. Use the shell tool exactly + once with this exact action, preserving the commands array and its order: + {"commands": ["printf ''SHELL_OK\\n''", "printf ''SHELL_ERROR\\n'' >&2; exit + 7", "sleep 2"], "timeout_ms": 1000, "max_output_length": 4096}. Keep semicolon-separated + statements in the same command string. Wait for the client to return shell_call_output + before interpreting the results.' + max_output_tokens: 4096 + model: Qwen/Qwen3.5-35B-A3B-FP8 + store: true + stream: true + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + headers: + content-type: text/event-stream; charset=utf-8 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_01a07fda-302f-7340-be8e-df03fecdb04f","created_at":1788851400,"incomplete_details":null,"instructions":null,"metadata":null,"model":"Qwen/Qwen3.5-35B-A3B-FP8","object":"response","output":[],"parallel_tool_calls":false,"temperature":1.0,"tool_choice":"auto","tools":[{"name":"shell","parameters":{"type":"object","properties":{"commands":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Commands + to execute in order."},"timeout_ms":{"type":"integer","minimum":0,"description":"Optional + timeout in milliseconds."},"max_output_length":{"type":"integer","minimum":0,"description":"Optional + maximum captured output length."}},"required":["commands"],"additionalProperties":false},"strict":false,"type":"function","allowed_callers":null,"defer_loading":null,"description":"Run + one or more commands in the caller-provided local shell environment. The caller + executes the commands and returns their outputs.","output_schema":null}],"top_p":0.95,"background":false,"max_output_tokens":4096,"max_tool_calls":null,"previous_response_id":null,"prompt":null,"reasoning":null,"service_tier":"auto","status":"in_progress","text":null,"top_logprobs":null,"truncation":"disabled","usage":null,"user":null,"presence_penalty":0.0,"frequency_penalty":0.0,"kv_transfer_params":null,"ec_transfer_params":null,"input_messages":null,"output_messages":null}} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_01a07fda-302f-7340-be8e-df03fecdb04f","created_at":1788851400,"incomplete_details":null,"instructions":null,"metadata":null,"model":"Qwen/Qwen3.5-35B-A3B-FP8","object":"response","output":[],"parallel_tool_calls":false,"temperature":1.0,"tool_choice":"auto","tools":[{"name":"shell","parameters":{"type":"object","properties":{"commands":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Commands + to execute in order."},"timeout_ms":{"type":"integer","minimum":0,"description":"Optional + timeout in milliseconds."},"max_output_length":{"type":"integer","minimum":0,"description":"Optional + maximum captured output length."}},"required":["commands"],"additionalProperties":false},"strict":false,"type":"function","allowed_callers":null,"defer_loading":null,"description":"Run + one or more commands in the caller-provided local shell environment. The caller + executes the commands and returns their outputs.","output_schema":null}],"top_p":0.95,"background":false,"max_output_tokens":4096,"max_tool_calls":null,"previous_response_id":null,"prompt":null,"reasoning":null,"service_tier":"auto","status":"in_progress","text":null,"top_logprobs":null,"truncation":"disabled","usage":null,"user":null,"presence_penalty":0.0,"frequency_penalty":0.0,"kv_transfer_params":null,"ec_transfer_params":null,"input_messages":null,"output_messages":null}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"87b34b7b9890b8ec","summary":[],"type":"reasoning","content":null,"encrypted_content":null,"status":"in_progress"}} + + ' + - ' + + ' + - 'event: response.reasoning_part.added + + ' + - 'data: {"type":"response.reasoning_part.added","sequence_number":3,"output_index":0,"content_index":0,"item_id":"87b34b7b9890b8ec","part":{"text":"","type":"reasoning_text"}} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":4,"output_index":0,"content_index":0,"delta":"The","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":5,"output_index":0,"content_index":0,"delta":" + user","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":6,"output_index":0,"content_index":0,"delta":" + wants","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":7,"output_index":0,"content_index":0,"delta":" + me","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":8,"output_index":0,"content_index":0,"delta":" + to","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":9,"output_index":0,"content_index":0,"delta":" + use","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":10,"output_index":0,"content_index":0,"delta":" + the","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":11,"output_index":0,"content_index":0,"delta":" + shell","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":12,"output_index":0,"content_index":0,"delta":" + tool","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":13,"output_index":0,"content_index":0,"delta":" + exactly","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":14,"output_index":0,"content_index":0,"delta":" + once","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":15,"output_index":0,"content_index":0,"delta":" + with","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":16,"output_index":0,"content_index":0,"delta":" + specific","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":17,"output_index":0,"content_index":0,"delta":" + commands","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":18,"output_index":0,"content_index":0,"delta":".","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":19,"output_index":0,"content_index":0,"delta":" + They","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":20,"output_index":0,"content_index":0,"delta":" + want","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":21,"output_index":0,"content_index":0,"delta":" + me","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":22,"output_index":0,"content_index":0,"delta":" + to","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":23,"output_index":0,"content_index":0,"delta":":","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":24,"output_index":0,"content_index":0,"delta":"\n","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":25,"output_index":0,"content_index":0,"delta":"1","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":26,"output_index":0,"content_index":0,"delta":".","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":27,"output_index":0,"content_index":0,"delta":" + Run","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":28,"output_index":0,"content_index":0,"delta":" + a","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":29,"output_index":0,"content_index":0,"delta":" + shell","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":30,"output_index":0,"content_index":0,"delta":" + command","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":31,"output_index":0,"content_index":0,"delta":" + with","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":32,"output_index":0,"content_index":0,"delta":" + specific","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":33,"output_index":0,"content_index":0,"delta":" + parameters","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":34,"output_index":0,"content_index":0,"delta":"\n","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":35,"output_index":0,"content_index":0,"delta":"2","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":36,"output_index":0,"content_index":0,"delta":".","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":37,"output_index":0,"content_index":0,"delta":" + Preserve","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":38,"output_index":0,"content_index":0,"delta":" + the","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":39,"output_index":0,"content_index":0,"delta":" + commands","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":40,"output_index":0,"content_index":0,"delta":" + array","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":41,"output_index":0,"content_index":0,"delta":" + and","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":42,"output_index":0,"content_index":0,"delta":" + its","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":43,"output_index":0,"content_index":0,"delta":" + order","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":44,"output_index":0,"content_index":0,"delta":"\n","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":45,"output_index":0,"content_index":0,"delta":"3","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":46,"output_index":0,"content_index":0,"delta":".","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":47,"output_index":0,"content_index":0,"delta":" + Keep","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":48,"output_index":0,"content_index":0,"delta":" + sem","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":49,"output_index":0,"content_index":0,"delta":"icolon","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":50,"output_index":0,"content_index":0,"delta":"-separated","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":51,"output_index":0,"content_index":0,"delta":" + statements","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":52,"output_index":0,"content_index":0,"delta":" + in","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":53,"output_index":0,"content_index":0,"delta":" + the","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":54,"output_index":0,"content_index":0,"delta":" + same","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":55,"output_index":0,"content_index":0,"delta":" + command","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":56,"output_index":0,"content_index":0,"delta":" + string","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":57,"output_index":0,"content_index":0,"delta":"\n","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":58,"output_index":0,"content_index":0,"delta":"4","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":59,"output_index":0,"content_index":0,"delta":".","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":60,"output_index":0,"content_index":0,"delta":" + Wait","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":61,"output_index":0,"content_index":0,"delta":" + for","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":62,"output_index":0,"content_index":0,"delta":" + the","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":63,"output_index":0,"content_index":0,"delta":" + client","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":64,"output_index":0,"content_index":0,"delta":" + to","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":65,"output_index":0,"content_index":0,"delta":" + return","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":66,"output_index":0,"content_index":0,"delta":" + shell","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":67,"output_index":0,"content_index":0,"delta":"_call","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":68,"output_index":0,"content_index":0,"delta":"_output","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":69,"output_index":0,"content_index":0,"delta":" + before","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":70,"output_index":0,"content_index":0,"delta":" + interpreting","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":71,"output_index":0,"content_index":0,"delta":" + results","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":72,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":73,"output_index":0,"content_index":0,"delta":"Looking","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":74,"output_index":0,"content_index":0,"delta":" + at","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":75,"output_index":0,"content_index":0,"delta":" + the","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":76,"output_index":0,"content_index":0,"delta":" + commands","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":77,"output_index":0,"content_index":0,"delta":" + array","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":78,"output_index":0,"content_index":0,"delta":",","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":79,"output_index":0,"content_index":0,"delta":" + I","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":80,"output_index":0,"content_index":0,"delta":" + see","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":81,"output_index":0,"content_index":0,"delta":" + there","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":82,"output_index":0,"content_index":0,"delta":" + are","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":83,"output_index":0,"content_index":0,"delta":" + ","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":84,"output_index":0,"content_index":0,"delta":"3","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":85,"output_index":0,"content_index":0,"delta":" + commands","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":86,"output_index":0,"content_index":0,"delta":":","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":87,"output_index":0,"content_index":0,"delta":"\n","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":88,"output_index":0,"content_index":0,"delta":"1","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":89,"output_index":0,"content_index":0,"delta":".","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":90,"output_index":0,"content_index":0,"delta":" + \"","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":91,"output_index":0,"content_index":0,"delta":"printf","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":92,"output_index":0,"content_index":0,"delta":" + ''","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":93,"output_index":0,"content_index":0,"delta":"S","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":94,"output_index":0,"content_index":0,"delta":"HELL","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":95,"output_index":0,"content_index":0,"delta":"_OK","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":96,"output_index":0,"content_index":0,"delta":"\\\\","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":97,"output_index":0,"content_index":0,"delta":"n","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":98,"output_index":0,"content_index":0,"delta":"''\"","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":99,"output_index":0,"content_index":0,"delta":"\n","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":100,"output_index":0,"content_index":0,"delta":"2","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":101,"output_index":0,"content_index":0,"delta":".","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":102,"output_index":0,"content_index":0,"delta":" + \"","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":103,"output_index":0,"content_index":0,"delta":"printf","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":104,"output_index":0,"content_index":0,"delta":" + ''","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":105,"output_index":0,"content_index":0,"delta":"S","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":106,"output_index":0,"content_index":0,"delta":"HELL","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":107,"output_index":0,"content_index":0,"delta":"_ERROR","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":108,"output_index":0,"content_index":0,"delta":"\\\\","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":109,"output_index":0,"content_index":0,"delta":"n","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":110,"output_index":0,"content_index":0,"delta":"''","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":111,"output_index":0,"content_index":0,"delta":" + >&","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":112,"output_index":0,"content_index":0,"delta":"2","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":113,"output_index":0,"content_index":0,"delta":";","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":114,"output_index":0,"content_index":0,"delta":" + exit","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":115,"output_index":0,"content_index":0,"delta":" + ","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":116,"output_index":0,"content_index":0,"delta":"7","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":117,"output_index":0,"content_index":0,"delta":"\"","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":118,"output_index":0,"content_index":0,"delta":"\n","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":119,"output_index":0,"content_index":0,"delta":"3","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":120,"output_index":0,"content_index":0,"delta":".","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":121,"output_index":0,"content_index":0,"delta":" + \"","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":122,"output_index":0,"content_index":0,"delta":"sleep","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":123,"output_index":0,"content_index":0,"delta":" + ","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":124,"output_index":0,"content_index":0,"delta":"2","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":125,"output_index":0,"content_index":0,"delta":"\"","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":126,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":127,"output_index":0,"content_index":0,"delta":"The","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":128,"output_index":0,"content_index":0,"delta":" + timeout","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":129,"output_index":0,"content_index":0,"delta":" + is","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":130,"output_index":0,"content_index":0,"delta":" + ","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":131,"output_index":0,"content_index":0,"delta":"1","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":132,"output_index":0,"content_index":0,"delta":"0","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":133,"output_index":0,"content_index":0,"delta":"0","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":134,"output_index":0,"content_index":0,"delta":"0","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":135,"output_index":0,"content_index":0,"delta":"ms","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":136,"output_index":0,"content_index":0,"delta":" + (","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":137,"output_index":0,"content_index":0,"delta":"1","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":138,"output_index":0,"content_index":0,"delta":" + second","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":139,"output_index":0,"content_index":0,"delta":"),","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":140,"output_index":0,"content_index":0,"delta":" + and","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":141,"output_index":0,"content_index":0,"delta":" + max","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":142,"output_index":0,"content_index":0,"delta":"_output","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":143,"output_index":0,"content_index":0,"delta":"_length","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":144,"output_index":0,"content_index":0,"delta":" + is","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":145,"output_index":0,"content_index":0,"delta":" + ","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":146,"output_index":0,"content_index":0,"delta":"4","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":147,"output_index":0,"content_index":0,"delta":"0","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":148,"output_index":0,"content_index":0,"delta":"9","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":149,"output_index":0,"content_index":0,"delta":"6","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":150,"output_index":0,"content_index":0,"delta":".","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":151,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":152,"output_index":0,"content_index":0,"delta":"However","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":153,"output_index":0,"content_index":0,"delta":",","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":154,"output_index":0,"content_index":0,"delta":" + I","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":155,"output_index":0,"content_index":0,"delta":" + notice","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":156,"output_index":0,"content_index":0,"delta":" + that","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":157,"output_index":0,"content_index":0,"delta":" + command","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":158,"output_index":0,"content_index":0,"delta":" + ","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":159,"output_index":0,"content_index":0,"delta":"2","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":160,"output_index":0,"content_index":0,"delta":" + has","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":161,"output_index":0,"content_index":0,"delta":" + \"","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":162,"output_index":0,"content_index":0,"delta":"exit","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":163,"output_index":0,"content_index":0,"delta":" + ","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":164,"output_index":0,"content_index":0,"delta":"7","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":165,"output_index":0,"content_index":0,"delta":"\"","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":166,"output_index":0,"content_index":0,"delta":" + which","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":167,"output_index":0,"content_index":0,"delta":" + will","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":168,"output_index":0,"content_index":0,"delta":" + cause","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":169,"output_index":0,"content_index":0,"delta":" + the","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":170,"output_index":0,"content_index":0,"delta":" + shell","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":171,"output_index":0,"content_index":0,"delta":" + to","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":172,"output_index":0,"content_index":0,"delta":" + exit","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":173,"output_index":0,"content_index":0,"delta":" + with","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":174,"output_index":0,"content_index":0,"delta":" + code","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":175,"output_index":0,"content_index":0,"delta":" + ","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":176,"output_index":0,"content_index":0,"delta":"7","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":177,"output_index":0,"content_index":0,"delta":".","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":178,"output_index":0,"content_index":0,"delta":" + Command","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":179,"output_index":0,"content_index":0,"delta":" + ","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":180,"output_index":0,"content_index":0,"delta":"3","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":181,"output_index":0,"content_index":0,"delta":" + (","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":182,"output_index":0,"content_index":0,"delta":"sleep","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":183,"output_index":0,"content_index":0,"delta":" + ","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":184,"output_index":0,"content_index":0,"delta":"2","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":185,"output_index":0,"content_index":0,"delta":")","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":186,"output_index":0,"content_index":0,"delta":" + won","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":187,"output_index":0,"content_index":0,"delta":"''t","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":188,"output_index":0,"content_index":0,"delta":" + execute","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":189,"output_index":0,"content_index":0,"delta":" + because","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":190,"output_index":0,"content_index":0,"delta":" + the","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":191,"output_index":0,"content_index":0,"delta":" + shell","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":192,"output_index":0,"content_index":0,"delta":" + exits","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":193,"output_index":0,"content_index":0,"delta":" + before","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":194,"output_index":0,"content_index":0,"delta":" + it","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":195,"output_index":0,"content_index":0,"delta":" + runs","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":196,"output_index":0,"content_index":0,"delta":".","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":197,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":198,"output_index":0,"content_index":0,"delta":"But","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":199,"output_index":0,"content_index":0,"delta":" + the","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":200,"output_index":0,"content_index":0,"delta":" + timeout","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":201,"output_index":0,"content_index":0,"delta":" + is","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":202,"output_index":0,"content_index":0,"delta":" + only","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":203,"output_index":0,"content_index":0,"delta":" + ","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":204,"output_index":0,"content_index":0,"delta":"1","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":205,"output_index":0,"content_index":0,"delta":"0","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":206,"output_index":0,"content_index":0,"delta":"0","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":207,"output_index":0,"content_index":0,"delta":"0","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":208,"output_index":0,"content_index":0,"delta":"ms","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":209,"output_index":0,"content_index":0,"delta":",","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":210,"output_index":0,"content_index":0,"delta":" + and","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":211,"output_index":0,"content_index":0,"delta":" + sleep","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":212,"output_index":0,"content_index":0,"delta":" + ","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":213,"output_index":0,"content_index":0,"delta":"2","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":214,"output_index":0,"content_index":0,"delta":" + would","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":215,"output_index":0,"content_index":0,"delta":" + take","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":216,"output_index":0,"content_index":0,"delta":" + ","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":217,"output_index":0,"content_index":0,"delta":"2","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":218,"output_index":0,"content_index":0,"delta":" + seconds","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":219,"output_index":0,"content_index":0,"delta":",","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":220,"output_index":0,"content_index":0,"delta":" + so","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":221,"output_index":0,"content_index":0,"delta":" + even","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":222,"output_index":0,"content_index":0,"delta":" + if","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":223,"output_index":0,"content_index":0,"delta":" + it","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":224,"output_index":0,"content_index":0,"delta":" + did","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":225,"output_index":0,"content_index":0,"delta":" + run","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":226,"output_index":0,"content_index":0,"delta":",","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":227,"output_index":0,"content_index":0,"delta":" + it","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":228,"output_index":0,"content_index":0,"delta":" + would","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":229,"output_index":0,"content_index":0,"delta":" + timeout","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":230,"output_index":0,"content_index":0,"delta":".","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":231,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":232,"output_index":0,"content_index":0,"delta":"Let","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":233,"output_index":0,"content_index":0,"delta":" + me","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":234,"output_index":0,"content_index":0,"delta":" + execute","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":235,"output_index":0,"content_index":0,"delta":" + this","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":236,"output_index":0,"content_index":0,"delta":" + as","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":237,"output_index":0,"content_index":0,"delta":" + requested","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":238,"output_index":0,"content_index":0,"delta":" + with","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":239,"output_index":0,"content_index":0,"delta":" + the","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":240,"output_index":0,"content_index":0,"delta":" + shell","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":241,"output_index":0,"content_index":0,"delta":" + tool","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":242,"output_index":0,"content_index":0,"delta":".","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":243,"output_index":0,"content_index":0,"delta":"\n","item_id":"87b34b7b9890b8ec"} + + ' + - ' + + ' + - 'event: response.reasoning_text.done + + ' + - 'data: {"type":"response.reasoning_text.done","sequence_number":244,"output_index":0,"content_index":0,"item_id":"87b34b7b9890b8ec","text":"The + user wants me to use the shell tool exactly once with specific commands. They + want me to:\n1. Run a shell command with specific parameters\n2. Preserve the + commands array and its order\n3. Keep semicolon-separated statements in the + same command string\n4. Wait for the client to return shell_call_output before + interpreting results\n\nLooking at the commands array, I see there are 3 commands:\n1. + \"printf ''SHELL_OK\\\\n''\"\n2. \"printf ''SHELL_ERROR\\\\n'' >&2; exit 7\"\n3. + \"sleep 2\"\n\nThe timeout is 1000ms (1 second), and max_output_length is 4096.\n\nHowever, + I notice that command 2 has \"exit 7\" which will cause the shell to exit with + code 7. Command 3 (sleep 2) won''t execute because the shell exits before it + runs.\n\nBut the timeout is only 1000ms, and sleep 2 would take 2 seconds, so + even if it did run, it would timeout.\n\nLet me execute this as requested with + the shell tool.\n"} + + ' + - ' + + ' + - 'event: response.reasoning_part.done + + ' + - 'data: {"type":"response.reasoning_part.done","sequence_number":245,"output_index":0,"content_index":0,"item_id":"87b34b7b9890b8ec","part":{"text":"The + user wants me to use the shell tool exactly once with specific commands. They + want me to:\n1. Run a shell command with specific parameters\n2. Preserve the + commands array and its order\n3. Keep semicolon-separated statements in the + same command string\n4. Wait for the client to return shell_call_output before + interpreting results\n\nLooking at the commands array, I see there are 3 commands:\n1. + \"printf ''SHELL_OK\\\\n''\"\n2. \"printf ''SHELL_ERROR\\\\n'' >&2; exit 7\"\n3. + \"sleep 2\"\n\nThe timeout is 1000ms (1 second), and max_output_length is 4096.\n\nHowever, + I notice that command 2 has \"exit 7\" which will cause the shell to exit with + code 7. Command 3 (sleep 2) won''t execute because the shell exits before it + runs.\n\nBut the timeout is only 1000ms, and sleep 2 would take 2 seconds, so + even if it did run, it would timeout.\n\nLet me execute this as requested with + the shell tool.\n","type":"reasoning_text"}} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":246,"output_index":0,"item":{"id":"87b34b7b9890b8ec","summary":[],"type":"reasoning","content":[{"text":"The + user wants me to use the shell tool exactly once with specific commands. They + want me to:\n1. Run a shell command with specific parameters\n2. Preserve the + commands array and its order\n3. Keep semicolon-separated statements in the + same command string\n4. Wait for the client to return shell_call_output before + interpreting results\n\nLooking at the commands array, I see there are 3 commands:\n1. + \"printf ''SHELL_OK\\\\n''\"\n2. \"printf ''SHELL_ERROR\\\\n'' >&2; exit 7\"\n3. + \"sleep 2\"\n\nThe timeout is 1000ms (1 second), and max_output_length is 4096.\n\nHowever, + I notice that command 2 has \"exit 7\" which will cause the shell to exit with + code 7. Command 3 (sleep 2) won''t execute because the shell exits before it + runs.\n\nBut the timeout is only 1000ms, and sleep 2 would take 2 seconds, so + even if it did run, it would timeout.\n\nLet me execute this as requested with + the shell tool.\n","type":"reasoning_text"}],"encrypted_content":null,"status":"completed"}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":247,"output_index":1,"item":{"type":"shell_call","id":"sh_cd31a2b822bc7751","call_id":"call_b537171bd3124eec","status":"in_progress","action":{"commands":[],"timeout_ms":null,"max_output_length":null}}} + + ' + - ' + + ' + - 'event: response.shell_call_command.added + + ' + - 'data: {"type":"response.shell_call_command.added","sequence_number":248,"output_index":1,"command_index":0,"command":""} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","sequence_number":249,"output_index":1,"command_index":0,"delta":"printf + ''SHELL_OK\\n''"} + + ' + - ' + + ' + - 'event: response.shell_call_command.done + + ' + - 'data: {"type":"response.shell_call_command.done","sequence_number":250,"output_index":1,"command_index":0,"command":"printf + ''SHELL_OK\\n''"} + + ' + - ' + + ' + - 'event: response.shell_call_command.added + + ' + - 'data: {"type":"response.shell_call_command.added","sequence_number":251,"output_index":1,"command_index":1,"command":""} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","sequence_number":252,"output_index":1,"command_index":1,"delta":"printf + ''SHELL_ERROR\\n'' >&2; exit 7"} + + ' + - ' + + ' + - 'event: response.shell_call_command.done + + ' + - 'data: {"type":"response.shell_call_command.done","sequence_number":253,"output_index":1,"command_index":1,"command":"printf + ''SHELL_ERROR\\n'' >&2; exit 7"} + + ' + - ' + + ' + - 'event: response.shell_call_command.added + + ' + - 'data: {"type":"response.shell_call_command.added","sequence_number":254,"output_index":1,"command_index":2,"command":""} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","sequence_number":255,"output_index":1,"command_index":2,"delta":"sleep + 2"} + + ' + - ' + + ' + - 'event: response.shell_call_command.done + + ' + - 'data: {"type":"response.shell_call_command.done","sequence_number":256,"output_index":1,"command_index":2,"command":"sleep + 2"} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":257,"output_index":1,"item":{"type":"shell_call","id":"sh_cd31a2b822bc7751","call_id":"call_b537171bd3124eec","action":{"commands":["printf + ''SHELL_OK\\n''","printf ''SHELL_ERROR\\n'' >&2; exit 7","sleep 2"],"timeout_ms":1000,"max_output_length":4096},"status":"completed"}} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","sequence_number":258,"response":{"id":"resp_01a07fda-302f-7340-be8e-df03fecdb04f","object":"response","created_at":1788851402,"model":"Qwen/Qwen3.5-35B-A3B-FP8","status":"completed","output":[{"type":"reasoning","id":"87b34b7b9890b8ec","content":[{"type":"reasoning_text","text":"The + user wants me to use the shell tool exactly once with specific commands. They + want me to:\n1. Run a shell command with specific parameters\n2. Preserve the + commands array and its order\n3. Keep semicolon-separated statements in the + same command string\n4. Wait for the client to return shell_call_output before + interpreting results\n\nLooking at the commands array, I see there are 3 commands:\n1. + \"printf ''SHELL_OK\\\\n''\"\n2. \"printf ''SHELL_ERROR\\\\n'' >&2; exit 7\"\n3. + \"sleep 2\"\n\nThe timeout is 1000ms (1 second), and max_output_length is 4096.\n\nHowever, + I notice that command 2 has \"exit 7\" which will cause the shell to exit with + code 7. Command 3 (sleep 2) won''t execute because the shell exits before it + runs.\n\nBut the timeout is only 1000ms, and sleep 2 would take 2 seconds, so + even if it did run, it would timeout.\n\nLet me execute this as requested with + the shell tool.\n"}],"summary":[],"encrypted_content":null,"status":"completed"},{"type":"shell_call","id":"sh_cd31a2b822bc7751","call_id":"call_b537171bd3124eec","action":{"commands":["printf + ''SHELL_OK\\n''","printf ''SHELL_ERROR\\n'' >&2; exit 7","sleep 2"],"timeout_ms":1000,"max_output_length":4096},"status":"completed"}],"usage":{"input_tokens":505,"output_tokens":329,"total_tokens":834,"input_tokens_details":{"cached_tokens":0},"output_tokens_details":{"reasoning_tokens":0}},"incomplete_details":null,"error":null,"previous_response_id":null,"conversation_id":null,"instructions":null}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 +- filename: t2 + request: + body: + input: + - call_id: call_b537171bd3124eec + max_output_length: 4096 + output: + - outcome: + exit_code: 0 + type: exit + stderr: '' + stdout: 'SHELL_OK + + ' + - outcome: + exit_code: 7 + type: exit + stderr: 'SHELL_ERROR + + ' + stdout: '' + - outcome: + type: timeout + stderr: '' + stdout: '' + type: shell_call_output + - content: Use the shell output above without calling any more tools. For each + command, report its stdout, stderr, and exit code or timeout outcome in + order. + role: user + type: message + max_output_tokens: 4096 + model: Qwen/Qwen3.5-35B-A3B-FP8 + previous_response_id: resp_01a07fda-302f-7340-be8e-df03fecdb04f + store: true + stream: true + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + headers: + content-type: text/event-stream; charset=utf-8 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_01a07fda-38f0-7380-b0e7-064c3a4b4470","created_at":1788851403,"incomplete_details":null,"instructions":null,"metadata":null,"model":"Qwen/Qwen3.5-35B-A3B-FP8","object":"response","output":[],"parallel_tool_calls":false,"temperature":1.0,"tool_choice":"auto","tools":[{"name":"shell","parameters":{"type":"object","properties":{"commands":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Commands + to execute in order."},"timeout_ms":{"type":"integer","minimum":0,"description":"Optional + timeout in milliseconds."},"max_output_length":{"type":"integer","minimum":0,"description":"Optional + maximum captured output length."}},"required":["commands"],"additionalProperties":false},"strict":false,"type":"function","allowed_callers":null,"defer_loading":null,"description":"Run + one or more commands in the caller-provided local shell environment. The caller + executes the commands and returns their outputs.","output_schema":null}],"top_p":0.95,"background":false,"max_output_tokens":4096,"max_tool_calls":null,"previous_response_id":"resp_01a07fda-302f-7340-be8e-df03fecdb04f","prompt":null,"reasoning":null,"service_tier":"auto","status":"in_progress","text":null,"top_logprobs":null,"truncation":"disabled","usage":null,"user":null,"presence_penalty":0.0,"frequency_penalty":0.0,"kv_transfer_params":null,"ec_transfer_params":null,"input_messages":null,"output_messages":null}} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_01a07fda-38f0-7380-b0e7-064c3a4b4470","created_at":1788851403,"incomplete_details":null,"instructions":null,"metadata":null,"model":"Qwen/Qwen3.5-35B-A3B-FP8","object":"response","output":[],"parallel_tool_calls":false,"temperature":1.0,"tool_choice":"auto","tools":[{"name":"shell","parameters":{"type":"object","properties":{"commands":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Commands + to execute in order."},"timeout_ms":{"type":"integer","minimum":0,"description":"Optional + timeout in milliseconds."},"max_output_length":{"type":"integer","minimum":0,"description":"Optional + maximum captured output length."}},"required":["commands"],"additionalProperties":false},"strict":false,"type":"function","allowed_callers":null,"defer_loading":null,"description":"Run + one or more commands in the caller-provided local shell environment. The caller + executes the commands and returns their outputs.","output_schema":null}],"top_p":0.95,"background":false,"max_output_tokens":4096,"max_tool_calls":null,"previous_response_id":"resp_01a07fda-302f-7340-be8e-df03fecdb04f","prompt":null,"reasoning":null,"service_tier":"auto","status":"in_progress","text":null,"top_logprobs":null,"truncation":"disabled","usage":null,"user":null,"presence_penalty":0.0,"frequency_penalty":0.0,"kv_transfer_params":null,"ec_transfer_params":null,"input_messages":null,"output_messages":null}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"b6f467c716010495","summary":[],"type":"reasoning","content":null,"encrypted_content":null,"status":"in_progress"}} + + ' + - ' + + ' + - 'event: response.reasoning_part.added + + ' + - 'data: {"type":"response.reasoning_part.added","sequence_number":3,"output_index":0,"content_index":0,"item_id":"b6f467c716010495","part":{"text":"","type":"reasoning_text"}} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":4,"output_index":0,"content_index":0,"delta":"The","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":5,"output_index":0,"content_index":0,"delta":" + user","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":6,"output_index":0,"content_index":0,"delta":" + is","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":7,"output_index":0,"content_index":0,"delta":" + asking","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":8,"output_index":0,"content_index":0,"delta":" + me","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":9,"output_index":0,"content_index":0,"delta":" + to","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":10,"output_index":0,"content_index":0,"delta":" + analyze","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":11,"output_index":0,"content_index":0,"delta":" + the","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":12,"output_index":0,"content_index":0,"delta":" + shell","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":13,"output_index":0,"content_index":0,"delta":" + output","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":14,"output_index":0,"content_index":0,"delta":" + and","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":15,"output_index":0,"content_index":0,"delta":" + report","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":16,"output_index":0,"content_index":0,"delta":" + the","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":17,"output_index":0,"content_index":0,"delta":" + results","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":18,"output_index":0,"content_index":0,"delta":" + for","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":19,"output_index":0,"content_index":0,"delta":" + each","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":20,"output_index":0,"content_index":0,"delta":" + command","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":21,"output_index":0,"content_index":0,"delta":".","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":22,"output_index":0,"content_index":0,"delta":" + The","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":23,"output_index":0,"content_index":0,"delta":" + shell","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":24,"output_index":0,"content_index":0,"delta":" + output","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":25,"output_index":0,"content_index":0,"delta":" + shows","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":26,"output_index":0,"content_index":0,"delta":" + ","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":27,"output_index":0,"content_index":0,"delta":"3","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":28,"output_index":0,"content_index":0,"delta":" + separate","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":29,"output_index":0,"content_index":0,"delta":" + outcomes","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":30,"output_index":0,"content_index":0,"delta":" + for","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":31,"output_index":0,"content_index":0,"delta":" + the","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":32,"output_index":0,"content_index":0,"delta":" + ","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":33,"output_index":0,"content_index":0,"delta":"3","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":34,"output_index":0,"content_index":0,"delta":" + commands","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":35,"output_index":0,"content_index":0,"delta":" + I","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":36,"output_index":0,"content_index":0,"delta":" + ran","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":37,"output_index":0,"content_index":0,"delta":".","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":38,"output_index":0,"content_index":0,"delta":" + Let","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":39,"output_index":0,"content_index":0,"delta":" + me","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":40,"output_index":0,"content_index":0,"delta":" + break","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":41,"output_index":0,"content_index":0,"delta":" + down","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":42,"output_index":0,"content_index":0,"delta":" + each","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":43,"output_index":0,"content_index":0,"delta":" + command","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":44,"output_index":0,"content_index":0,"delta":"''s","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":45,"output_index":0,"content_index":0,"delta":" + result","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":46,"output_index":0,"content_index":0,"delta":":","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":47,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":48,"output_index":0,"content_index":0,"delta":"1","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":49,"output_index":0,"content_index":0,"delta":".","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":50,"output_index":0,"content_index":0,"delta":" + First","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":51,"output_index":0,"content_index":0,"delta":" + command","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":52,"output_index":0,"content_index":0,"delta":":","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":53,"output_index":0,"content_index":0,"delta":" + `","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":54,"output_index":0,"content_index":0,"delta":"printf","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":55,"output_index":0,"content_index":0,"delta":" + ''","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":56,"output_index":0,"content_index":0,"delta":"S","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":57,"output_index":0,"content_index":0,"delta":"HELL","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":58,"output_index":0,"content_index":0,"delta":"_OK","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":59,"output_index":0,"content_index":0,"delta":"\\n","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":60,"output_index":0,"content_index":0,"delta":"''","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":61,"output_index":0,"content_index":0,"delta":"`","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":62,"output_index":0,"content_index":0,"delta":"\n","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":63,"output_index":0,"content_index":0,"delta":" ","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":64,"output_index":0,"content_index":0,"delta":" + -","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":65,"output_index":0,"content_index":0,"delta":" + stdout","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":66,"output_index":0,"content_index":0,"delta":":","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":67,"output_index":0,"content_index":0,"delta":" + \"","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":68,"output_index":0,"content_index":0,"delta":"S","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":69,"output_index":0,"content_index":0,"delta":"HELL","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":70,"output_index":0,"content_index":0,"delta":"_OK","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":71,"output_index":0,"content_index":0,"delta":"\\n","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":72,"output_index":0,"content_index":0,"delta":"\"","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":73,"output_index":0,"content_index":0,"delta":"\n","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":74,"output_index":0,"content_index":0,"delta":" ","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":75,"output_index":0,"content_index":0,"delta":" + -","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":76,"output_index":0,"content_index":0,"delta":" + stderr","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":77,"output_index":0,"content_index":0,"delta":":","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":78,"output_index":0,"content_index":0,"delta":" + \"\"","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":79,"output_index":0,"content_index":0,"delta":" + (","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":80,"output_index":0,"content_index":0,"delta":"empty","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":81,"output_index":0,"content_index":0,"delta":")","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":82,"output_index":0,"content_index":0,"delta":"\n","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":83,"output_index":0,"content_index":0,"delta":" ","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":84,"output_index":0,"content_index":0,"delta":" + -","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":85,"output_index":0,"content_index":0,"delta":" + outcome","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":86,"output_index":0,"content_index":0,"delta":":","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":87,"output_index":0,"content_index":0,"delta":" + exit","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":88,"output_index":0,"content_index":0,"delta":"_code","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":89,"output_index":0,"content_index":0,"delta":" + ","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":90,"output_index":0,"content_index":0,"delta":"0","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":91,"output_index":0,"content_index":0,"delta":" + (","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":92,"output_index":0,"content_index":0,"delta":"success","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":93,"output_index":0,"content_index":0,"delta":")","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":94,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":95,"output_index":0,"content_index":0,"delta":"2","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":96,"output_index":0,"content_index":0,"delta":".","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":97,"output_index":0,"content_index":0,"delta":" + Second","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":98,"output_index":0,"content_index":0,"delta":" + command","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":99,"output_index":0,"content_index":0,"delta":":","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":100,"output_index":0,"content_index":0,"delta":" + `","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":101,"output_index":0,"content_index":0,"delta":"printf","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":102,"output_index":0,"content_index":0,"delta":" + ''","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":103,"output_index":0,"content_index":0,"delta":"S","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":104,"output_index":0,"content_index":0,"delta":"HELL","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":105,"output_index":0,"content_index":0,"delta":"_ERROR","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":106,"output_index":0,"content_index":0,"delta":"\\n","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":107,"output_index":0,"content_index":0,"delta":"''","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":108,"output_index":0,"content_index":0,"delta":" + >&","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":109,"output_index":0,"content_index":0,"delta":"2","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":110,"output_index":0,"content_index":0,"delta":";","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":111,"output_index":0,"content_index":0,"delta":" + exit","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":112,"output_index":0,"content_index":0,"delta":" + ","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":113,"output_index":0,"content_index":0,"delta":"7","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":114,"output_index":0,"content_index":0,"delta":"`","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":115,"output_index":0,"content_index":0,"delta":"\n","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":116,"output_index":0,"content_index":0,"delta":" ","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":117,"output_index":0,"content_index":0,"delta":" + -","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":118,"output_index":0,"content_index":0,"delta":" + stdout","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":119,"output_index":0,"content_index":0,"delta":":","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":120,"output_index":0,"content_index":0,"delta":" + \"\"","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":121,"output_index":0,"content_index":0,"delta":" + (","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":122,"output_index":0,"content_index":0,"delta":"empty","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":123,"output_index":0,"content_index":0,"delta":")","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":124,"output_index":0,"content_index":0,"delta":"\n","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":125,"output_index":0,"content_index":0,"delta":" ","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":126,"output_index":0,"content_index":0,"delta":" + -","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":127,"output_index":0,"content_index":0,"delta":" + stderr","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":128,"output_index":0,"content_index":0,"delta":":","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":129,"output_index":0,"content_index":0,"delta":" + \"","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":130,"output_index":0,"content_index":0,"delta":"S","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":131,"output_index":0,"content_index":0,"delta":"HELL","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":132,"output_index":0,"content_index":0,"delta":"_ERROR","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":133,"output_index":0,"content_index":0,"delta":"\\n","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":134,"output_index":0,"content_index":0,"delta":"\"","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":135,"output_index":0,"content_index":0,"delta":"\n","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":136,"output_index":0,"content_index":0,"delta":" ","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":137,"output_index":0,"content_index":0,"delta":" + -","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":138,"output_index":0,"content_index":0,"delta":" + outcome","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":139,"output_index":0,"content_index":0,"delta":":","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":140,"output_index":0,"content_index":0,"delta":" + exit","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":141,"output_index":0,"content_index":0,"delta":"_code","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":142,"output_index":0,"content_index":0,"delta":" + ","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":143,"output_index":0,"content_index":0,"delta":"7","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":144,"output_index":0,"content_index":0,"delta":" + (","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":145,"output_index":0,"content_index":0,"delta":"error","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":146,"output_index":0,"content_index":0,"delta":")","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":147,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":148,"output_index":0,"content_index":0,"delta":"3","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":149,"output_index":0,"content_index":0,"delta":".","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":150,"output_index":0,"content_index":0,"delta":" + Third","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":151,"output_index":0,"content_index":0,"delta":" + command","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":152,"output_index":0,"content_index":0,"delta":":","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":153,"output_index":0,"content_index":0,"delta":" + `","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":154,"output_index":0,"content_index":0,"delta":"sleep","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":155,"output_index":0,"content_index":0,"delta":" + ","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":156,"output_index":0,"content_index":0,"delta":"2","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":157,"output_index":0,"content_index":0,"delta":"`","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":158,"output_index":0,"content_index":0,"delta":"\n","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":159,"output_index":0,"content_index":0,"delta":" ","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":160,"output_index":0,"content_index":0,"delta":" + -","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":161,"output_index":0,"content_index":0,"delta":" + stdout","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":162,"output_index":0,"content_index":0,"delta":":","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":163,"output_index":0,"content_index":0,"delta":" + \"\"","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":164,"output_index":0,"content_index":0,"delta":" + (","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":165,"output_index":0,"content_index":0,"delta":"empty","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":166,"output_index":0,"content_index":0,"delta":")","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":167,"output_index":0,"content_index":0,"delta":"\n","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":168,"output_index":0,"content_index":0,"delta":" ","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":169,"output_index":0,"content_index":0,"delta":" + -","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":170,"output_index":0,"content_index":0,"delta":" + stderr","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":171,"output_index":0,"content_index":0,"delta":":","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":172,"output_index":0,"content_index":0,"delta":" + \"\"","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":173,"output_index":0,"content_index":0,"delta":" + (","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":174,"output_index":0,"content_index":0,"delta":"empty","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":175,"output_index":0,"content_index":0,"delta":")","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":176,"output_index":0,"content_index":0,"delta":"\n","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":177,"output_index":0,"content_index":0,"delta":" ","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":178,"output_index":0,"content_index":0,"delta":" + -","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":179,"output_index":0,"content_index":0,"delta":" + outcome","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":180,"output_index":0,"content_index":0,"delta":":","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":181,"output_index":0,"content_index":0,"delta":" + timeout","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":182,"output_index":0,"content_index":0,"delta":" + (","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":183,"output_index":0,"content_index":0,"delta":"the","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":184,"output_index":0,"content_index":0,"delta":" + ","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":185,"output_index":0,"content_index":0,"delta":"2","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":186,"output_index":0,"content_index":0,"delta":" + second","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":187,"output_index":0,"content_index":0,"delta":" + sleep","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":188,"output_index":0,"content_index":0,"delta":" + was","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":189,"output_index":0,"content_index":0,"delta":" + cut","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":190,"output_index":0,"content_index":0,"delta":" + short","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":191,"output_index":0,"content_index":0,"delta":" + by","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":192,"output_index":0,"content_index":0,"delta":" + the","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":193,"output_index":0,"content_index":0,"delta":" + ","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":194,"output_index":0,"content_index":0,"delta":"1","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":195,"output_index":0,"content_index":0,"delta":"0","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":196,"output_index":0,"content_index":0,"delta":"0","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":197,"output_index":0,"content_index":0,"delta":"0","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":198,"output_index":0,"content_index":0,"delta":"ms","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":199,"output_index":0,"content_index":0,"delta":" + timeout","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":200,"output_index":0,"content_index":0,"delta":")","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":201,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":202,"output_index":0,"content_index":0,"delta":"I","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":203,"output_index":0,"content_index":0,"delta":" + need","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":204,"output_index":0,"content_index":0,"delta":" + to","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":205,"output_index":0,"content_index":0,"delta":" + report","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":206,"output_index":0,"content_index":0,"delta":" + this","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":207,"output_index":0,"content_index":0,"delta":" + information","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":208,"output_index":0,"content_index":0,"delta":" + clearly","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":209,"output_index":0,"content_index":0,"delta":" + for","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":210,"output_index":0,"content_index":0,"delta":" + each","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":211,"output_index":0,"content_index":0,"delta":" + command","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":212,"output_index":0,"content_index":0,"delta":".","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":213,"output_index":0,"content_index":0,"delta":"\n","item_id":"b6f467c716010495"} + + ' + - ' + + ' + - 'event: response.reasoning_text.done + + ' + - 'data: {"type":"response.reasoning_text.done","sequence_number":214,"output_index":0,"content_index":0,"item_id":"b6f467c716010495","text":"The + user is asking me to analyze the shell output and report the results for each + command. The shell output shows 3 separate outcomes for the 3 commands I ran. + Let me break down each command''s result:\n\n1. First command: `printf ''SHELL_OK\\n''`\n - + stdout: \"SHELL_OK\\n\"\n - stderr: \"\" (empty)\n - outcome: exit_code + 0 (success)\n\n2. Second command: `printf ''SHELL_ERROR\\n'' >&2; exit 7`\n - + stdout: \"\" (empty)\n - stderr: \"SHELL_ERROR\\n\"\n - outcome: exit_code + 7 (error)\n\n3. Third command: `sleep 2`\n - stdout: \"\" (empty)\n - stderr: + \"\" (empty)\n - outcome: timeout (the 2 second sleep was cut short by the + 1000ms timeout)\n\nI need to report this information clearly for each command.\n"} + + ' + - ' + + ' + - 'event: response.reasoning_part.done + + ' + - 'data: {"type":"response.reasoning_part.done","sequence_number":215,"output_index":0,"content_index":0,"item_id":"b6f467c716010495","part":{"text":"The + user is asking me to analyze the shell output and report the results for each + command. The shell output shows 3 separate outcomes for the 3 commands I ran. + Let me break down each command''s result:\n\n1. First command: `printf ''SHELL_OK\\n''`\n - + stdout: \"SHELL_OK\\n\"\n - stderr: \"\" (empty)\n - outcome: exit_code + 0 (success)\n\n2. Second command: `printf ''SHELL_ERROR\\n'' >&2; exit 7`\n - + stdout: \"\" (empty)\n - stderr: \"SHELL_ERROR\\n\"\n - outcome: exit_code + 7 (error)\n\n3. Third command: `sleep 2`\n - stdout: \"\" (empty)\n - stderr: + \"\" (empty)\n - outcome: timeout (the 2 second sleep was cut short by the + 1000ms timeout)\n\nI need to report this information clearly for each command.\n","type":"reasoning_text"}} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":216,"output_index":0,"item":{"id":"b6f467c716010495","summary":[],"type":"reasoning","content":[{"text":"The + user is asking me to analyze the shell output and report the results for each + command. The shell output shows 3 separate outcomes for the 3 commands I ran. + Let me break down each command''s result:\n\n1. First command: `printf ''SHELL_OK\\n''`\n - + stdout: \"SHELL_OK\\n\"\n - stderr: \"\" (empty)\n - outcome: exit_code + 0 (success)\n\n2. Second command: `printf ''SHELL_ERROR\\n'' >&2; exit 7`\n - + stdout: \"\" (empty)\n - stderr: \"SHELL_ERROR\\n\"\n - outcome: exit_code + 7 (error)\n\n3. Third command: `sleep 2`\n - stdout: \"\" (empty)\n - stderr: + \"\" (empty)\n - outcome: timeout (the 2 second sleep was cut short by the + 1000ms timeout)\n\nI need to report this information clearly for each command.\n","type":"reasoning_text"}],"encrypted_content":null,"status":"completed"}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":217,"output_index":1,"item":{"id":"936dd2b7c41379c4","content":[],"role":"assistant","status":"in_progress","type":"message","phase":null}} + + ' + - ' + + ' + - 'event: response.content_part.added + + ' + - 'data: {"type":"response.content_part.added","sequence_number":218,"output_index":1,"content_index":0,"item_id":"936dd2b7c41379c4","part":{"annotations":[],"text":"","type":"output_text","logprobs":[]}} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":219,"output_index":1,"content_index":0,"delta":"\n\nHere","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":220,"output_index":1,"content_index":0,"delta":" + are","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":221,"output_index":1,"content_index":0,"delta":" + the","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":222,"output_index":1,"content_index":0,"delta":" + results","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":223,"output_index":1,"content_index":0,"delta":" + for","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":224,"output_index":1,"content_index":0,"delta":" + each","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":225,"output_index":1,"content_index":0,"delta":" + command","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":226,"output_index":1,"content_index":0,"delta":" + in","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":227,"output_index":1,"content_index":0,"delta":" + order","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":228,"output_index":1,"content_index":0,"delta":":","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":229,"output_index":1,"content_index":0,"delta":"\n\n","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":230,"output_index":1,"content_index":0,"delta":"**","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":231,"output_index":1,"content_index":0,"delta":"Command","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":232,"output_index":1,"content_index":0,"delta":" + ","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":233,"output_index":1,"content_index":0,"delta":"1","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":234,"output_index":1,"content_index":0,"delta":":**","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":235,"output_index":1,"content_index":0,"delta":" + `","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":236,"output_index":1,"content_index":0,"delta":"printf","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":237,"output_index":1,"content_index":0,"delta":" + ''","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":238,"output_index":1,"content_index":0,"delta":"S","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":239,"output_index":1,"content_index":0,"delta":"HELL","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":240,"output_index":1,"content_index":0,"delta":"_OK","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":241,"output_index":1,"content_index":0,"delta":"\\n","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":242,"output_index":1,"content_index":0,"delta":"''","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":243,"output_index":1,"content_index":0,"delta":"`","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":244,"output_index":1,"content_index":0,"delta":"\n","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":245,"output_index":1,"content_index":0,"delta":"-","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":246,"output_index":1,"content_index":0,"delta":" + **","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":247,"output_index":1,"content_index":0,"delta":"stdout","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":248,"output_index":1,"content_index":0,"delta":":**","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":249,"output_index":1,"content_index":0,"delta":" + SHE","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":250,"output_index":1,"content_index":0,"delta":"LL","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":251,"output_index":1,"content_index":0,"delta":"_OK","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":252,"output_index":1,"content_index":0,"delta":"\n","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":253,"output_index":1,"content_index":0,"delta":"-","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":254,"output_index":1,"content_index":0,"delta":" + **","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":255,"output_index":1,"content_index":0,"delta":"stderr","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":256,"output_index":1,"content_index":0,"delta":":**","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":257,"output_index":1,"content_index":0,"delta":" + (","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":258,"output_index":1,"content_index":0,"delta":"empty","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":259,"output_index":1,"content_index":0,"delta":")","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":260,"output_index":1,"content_index":0,"delta":"\n","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":261,"output_index":1,"content_index":0,"delta":"-","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":262,"output_index":1,"content_index":0,"delta":" + **","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":263,"output_index":1,"content_index":0,"delta":"outcome","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":264,"output_index":1,"content_index":0,"delta":":**","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":265,"output_index":1,"content_index":0,"delta":" + exit","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":266,"output_index":1,"content_index":0,"delta":" + code","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":267,"output_index":1,"content_index":0,"delta":" + ","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":268,"output_index":1,"content_index":0,"delta":"0","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":269,"output_index":1,"content_index":0,"delta":" + (","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":270,"output_index":1,"content_index":0,"delta":"success","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":271,"output_index":1,"content_index":0,"delta":")","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":272,"output_index":1,"content_index":0,"delta":"\n\n","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":273,"output_index":1,"content_index":0,"delta":"**","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":274,"output_index":1,"content_index":0,"delta":"Command","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":275,"output_index":1,"content_index":0,"delta":" + ","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":276,"output_index":1,"content_index":0,"delta":"2","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":277,"output_index":1,"content_index":0,"delta":":**","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":278,"output_index":1,"content_index":0,"delta":" + `","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":279,"output_index":1,"content_index":0,"delta":"printf","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":280,"output_index":1,"content_index":0,"delta":" + ''","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":281,"output_index":1,"content_index":0,"delta":"S","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":282,"output_index":1,"content_index":0,"delta":"HELL","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":283,"output_index":1,"content_index":0,"delta":"_ERROR","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":284,"output_index":1,"content_index":0,"delta":"\\n","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":285,"output_index":1,"content_index":0,"delta":"''","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":286,"output_index":1,"content_index":0,"delta":" + >&","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":287,"output_index":1,"content_index":0,"delta":"2","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":288,"output_index":1,"content_index":0,"delta":";","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":289,"output_index":1,"content_index":0,"delta":" + exit","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":290,"output_index":1,"content_index":0,"delta":" + ","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":291,"output_index":1,"content_index":0,"delta":"7","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":292,"output_index":1,"content_index":0,"delta":"`","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":293,"output_index":1,"content_index":0,"delta":"\n","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":294,"output_index":1,"content_index":0,"delta":"-","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":295,"output_index":1,"content_index":0,"delta":" + **","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":296,"output_index":1,"content_index":0,"delta":"stdout","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":297,"output_index":1,"content_index":0,"delta":":**","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":298,"output_index":1,"content_index":0,"delta":" + (","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":299,"output_index":1,"content_index":0,"delta":"empty","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":300,"output_index":1,"content_index":0,"delta":")","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":301,"output_index":1,"content_index":0,"delta":"\n","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":302,"output_index":1,"content_index":0,"delta":"-","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":303,"output_index":1,"content_index":0,"delta":" + **","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":304,"output_index":1,"content_index":0,"delta":"stderr","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":305,"output_index":1,"content_index":0,"delta":":**","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":306,"output_index":1,"content_index":0,"delta":" + SHE","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":307,"output_index":1,"content_index":0,"delta":"LL","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":308,"output_index":1,"content_index":0,"delta":"_ERROR","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":309,"output_index":1,"content_index":0,"delta":"\n","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":310,"output_index":1,"content_index":0,"delta":"-","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":311,"output_index":1,"content_index":0,"delta":" + **","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":312,"output_index":1,"content_index":0,"delta":"outcome","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":313,"output_index":1,"content_index":0,"delta":":**","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":314,"output_index":1,"content_index":0,"delta":" + exit","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":315,"output_index":1,"content_index":0,"delta":" + code","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":316,"output_index":1,"content_index":0,"delta":" + ","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":317,"output_index":1,"content_index":0,"delta":"7","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":318,"output_index":1,"content_index":0,"delta":" + (","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":319,"output_index":1,"content_index":0,"delta":"error","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":320,"output_index":1,"content_index":0,"delta":")","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":321,"output_index":1,"content_index":0,"delta":"\n\n","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":322,"output_index":1,"content_index":0,"delta":"**","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":323,"output_index":1,"content_index":0,"delta":"Command","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":324,"output_index":1,"content_index":0,"delta":" + ","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":325,"output_index":1,"content_index":0,"delta":"3","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":326,"output_index":1,"content_index":0,"delta":":**","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":327,"output_index":1,"content_index":0,"delta":" + `","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":328,"output_index":1,"content_index":0,"delta":"sleep","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":329,"output_index":1,"content_index":0,"delta":" + ","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":330,"output_index":1,"content_index":0,"delta":"2","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":331,"output_index":1,"content_index":0,"delta":"`","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":332,"output_index":1,"content_index":0,"delta":"\n","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":333,"output_index":1,"content_index":0,"delta":"-","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":334,"output_index":1,"content_index":0,"delta":" + **","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":335,"output_index":1,"content_index":0,"delta":"stdout","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":336,"output_index":1,"content_index":0,"delta":":**","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":337,"output_index":1,"content_index":0,"delta":" + (","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":338,"output_index":1,"content_index":0,"delta":"empty","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":339,"output_index":1,"content_index":0,"delta":")","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":340,"output_index":1,"content_index":0,"delta":"\n","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":341,"output_index":1,"content_index":0,"delta":"-","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":342,"output_index":1,"content_index":0,"delta":" + **","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":343,"output_index":1,"content_index":0,"delta":"stderr","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":344,"output_index":1,"content_index":0,"delta":":**","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":345,"output_index":1,"content_index":0,"delta":" + (","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":346,"output_index":1,"content_index":0,"delta":"empty","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":347,"output_index":1,"content_index":0,"delta":")","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":348,"output_index":1,"content_index":0,"delta":"\n","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":349,"output_index":1,"content_index":0,"delta":"-","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":350,"output_index":1,"content_index":0,"delta":" + **","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":351,"output_index":1,"content_index":0,"delta":"outcome","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":352,"output_index":1,"content_index":0,"delta":":**","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":353,"output_index":1,"content_index":0,"delta":" + timeout","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":354,"output_index":1,"content_index":0,"delta":" + (","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":355,"output_index":1,"content_index":0,"delta":"ex","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":356,"output_index":1,"content_index":0,"delta":"ceeded","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":357,"output_index":1,"content_index":0,"delta":" + ","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":358,"output_index":1,"content_index":0,"delta":"1","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":359,"output_index":1,"content_index":0,"delta":"0","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":360,"output_index":1,"content_index":0,"delta":"0","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":361,"output_index":1,"content_index":0,"delta":"0","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":362,"output_index":1,"content_index":0,"delta":"ms","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":363,"output_index":1,"content_index":0,"delta":" + timeout","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":364,"output_index":1,"content_index":0,"delta":")","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":365,"output_index":1,"content_index":0,"delta":"\n\n","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":366,"output_index":1,"content_index":0,"delta":"The","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":367,"output_index":1,"content_index":0,"delta":" + first","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":368,"output_index":1,"content_index":0,"delta":" + command","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":369,"output_index":1,"content_index":0,"delta":" + executed","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":370,"output_index":1,"content_index":0,"delta":" + successfully","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":371,"output_index":1,"content_index":0,"delta":" + and","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":372,"output_index":1,"content_index":0,"delta":" + printed","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":373,"output_index":1,"content_index":0,"delta":" + to","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":374,"output_index":1,"content_index":0,"delta":" + stdout","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":375,"output_index":1,"content_index":0,"delta":".","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":376,"output_index":1,"content_index":0,"delta":" + The","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":377,"output_index":1,"content_index":0,"delta":" + second","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":378,"output_index":1,"content_index":0,"delta":" + command","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":379,"output_index":1,"content_index":0,"delta":" + printed","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":380,"output_index":1,"content_index":0,"delta":" + an","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":381,"output_index":1,"content_index":0,"delta":" + error","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":382,"output_index":1,"content_index":0,"delta":" + message","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":383,"output_index":1,"content_index":0,"delta":" + to","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":384,"output_index":1,"content_index":0,"delta":" + stderr","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":385,"output_index":1,"content_index":0,"delta":" + and","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":386,"output_index":1,"content_index":0,"delta":" + exited","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":387,"output_index":1,"content_index":0,"delta":" + with","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":388,"output_index":1,"content_index":0,"delta":" + code","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":389,"output_index":1,"content_index":0,"delta":" + ","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":390,"output_index":1,"content_index":0,"delta":"7","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":391,"output_index":1,"content_index":0,"delta":".","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":392,"output_index":1,"content_index":0,"delta":" + The","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":393,"output_index":1,"content_index":0,"delta":" + third","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":394,"output_index":1,"content_index":0,"delta":" + command","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":395,"output_index":1,"content_index":0,"delta":" + was","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":396,"output_index":1,"content_index":0,"delta":" + interrupted","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":397,"output_index":1,"content_index":0,"delta":" + by","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":398,"output_index":1,"content_index":0,"delta":" + the","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":399,"output_index":1,"content_index":0,"delta":" + timeout","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":400,"output_index":1,"content_index":0,"delta":" + before","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":401,"output_index":1,"content_index":0,"delta":" + it","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":402,"output_index":1,"content_index":0,"delta":" + could","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":403,"output_index":1,"content_index":0,"delta":" + complete","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":404,"output_index":1,"content_index":0,"delta":" + (","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":405,"output_index":1,"content_index":0,"delta":"sleep","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":406,"output_index":1,"content_index":0,"delta":"ing","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":407,"output_index":1,"content_index":0,"delta":" + for","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":408,"output_index":1,"content_index":0,"delta":" + ","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":409,"output_index":1,"content_index":0,"delta":"2","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":410,"output_index":1,"content_index":0,"delta":" + seconds","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":411,"output_index":1,"content_index":0,"delta":" + but","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":412,"output_index":1,"content_index":0,"delta":" + only","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":413,"output_index":1,"content_index":0,"delta":" + ","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":414,"output_index":1,"content_index":0,"delta":"1","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":415,"output_index":1,"content_index":0,"delta":" + second","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":416,"output_index":1,"content_index":0,"delta":" + allowed","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":417,"output_index":1,"content_index":0,"delta":").","item_id":"936dd2b7c41379c4","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.done + + ' + - 'data: {"type":"response.output_text.done","sequence_number":418,"output_index":1,"content_index":0,"item_id":"936dd2b7c41379c4","logprobs":[],"text":"\n\nHere + are the results for each command in order:\n\n**Command 1:** `printf ''SHELL_OK\\n''`\n- + **stdout:** SHELL_OK\n- **stderr:** (empty)\n- **outcome:** exit code 0 (success)\n\n**Command + 2:** `printf ''SHELL_ERROR\\n'' >&2; exit 7`\n- **stdout:** (empty)\n- **stderr:** + SHELL_ERROR\n- **outcome:** exit code 7 (error)\n\n**Command 3:** `sleep 2`\n- + **stdout:** (empty)\n- **stderr:** (empty)\n- **outcome:** timeout (exceeded + 1000ms timeout)\n\nThe first command executed successfully and printed to stdout. + The second command printed an error message to stderr and exited with code 7. + The third command was interrupted by the timeout before it could complete (sleeping + for 2 seconds but only 1 second allowed)."} + + ' + - ' + + ' + - 'event: response.content_part.done + + ' + - 'data: {"type":"response.content_part.done","sequence_number":419,"output_index":1,"content_index":0,"item_id":"936dd2b7c41379c4","part":{"annotations":[],"text":"\n\nHere + are the results for each command in order:\n\n**Command 1:** `printf ''SHELL_OK\\n''`\n- + **stdout:** SHELL_OK\n- **stderr:** (empty)\n- **outcome:** exit code 0 (success)\n\n**Command + 2:** `printf ''SHELL_ERROR\\n'' >&2; exit 7`\n- **stdout:** (empty)\n- **stderr:** + SHELL_ERROR\n- **outcome:** exit code 7 (error)\n\n**Command 3:** `sleep 2`\n- + **stdout:** (empty)\n- **stderr:** (empty)\n- **outcome:** timeout (exceeded + 1000ms timeout)\n\nThe first command executed successfully and printed to stdout. + The second command printed an error message to stderr and exited with code 7. + The third command was interrupted by the timeout before it could complete (sleeping + for 2 seconds but only 1 second allowed).","type":"output_text","logprobs":null}} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":420,"output_index":1,"item":{"id":"936dd2b7c41379c4","content":[{"annotations":[],"text":"\n\nHere + are the results for each command in order:\n\n**Command 1:** `printf ''SHELL_OK\\n''`\n- + **stdout:** SHELL_OK\n- **stderr:** (empty)\n- **outcome:** exit code 0 (success)\n\n**Command + 2:** `printf ''SHELL_ERROR\\n'' >&2; exit 7`\n- **stdout:** (empty)\n- **stderr:** + SHELL_ERROR\n- **outcome:** exit code 7 (error)\n\n**Command 3:** `sleep 2`\n- + **stdout:** (empty)\n- **stderr:** (empty)\n- **outcome:** timeout (exceeded + 1000ms timeout)\n\nThe first command executed successfully and printed to stdout. + The second command printed an error message to stderr and exited with code 7. + The third command was interrupted by the timeout before it could complete (sleeping + for 2 seconds but only 1 second allowed).","type":"output_text","logprobs":null}],"role":"assistant","status":"completed","type":"message","phase":null,"summary":[]}} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","sequence_number":421,"response":{"id":"resp_01a07fda-38f0-7380-b0e7-064c3a4b4470","object":"response","created_at":1788851405,"model":"Qwen/Qwen3.5-35B-A3B-FP8","status":"completed","output":[{"type":"reasoning","id":"b6f467c716010495","content":[{"type":"reasoning_text","text":"The + user is asking me to analyze the shell output and report the results for each + command. The shell output shows 3 separate outcomes for the 3 commands I ran. + Let me break down each command''s result:\n\n1. First command: `printf ''SHELL_OK\\n''`\n - + stdout: \"SHELL_OK\\n\"\n - stderr: \"\" (empty)\n - outcome: exit_code + 0 (success)\n\n2. Second command: `printf ''SHELL_ERROR\\n'' >&2; exit 7`\n - + stdout: \"\" (empty)\n - stderr: \"SHELL_ERROR\\n\"\n - outcome: exit_code + 7 (error)\n\n3. Third command: `sleep 2`\n - stdout: \"\" (empty)\n - stderr: + \"\" (empty)\n - outcome: timeout (the 2 second sleep was cut short by the + 1000ms timeout)\n\nI need to report this information clearly for each command.\n"}],"summary":[],"encrypted_content":null,"status":"completed"},{"type":"message","id":"936dd2b7c41379c4","role":"assistant","status":"completed","content":[{"type":"output_text","text":"\n\nHere + are the results for each command in order:\n\n**Command 1:** `printf ''SHELL_OK\\n''`\n- + **stdout:** SHELL_OK\n- **stderr:** (empty)\n- **outcome:** exit code 0 (success)\n\n**Command + 2:** `printf ''SHELL_ERROR\\n'' >&2; exit 7`\n- **stdout:** (empty)\n- **stderr:** + SHELL_ERROR\n- **outcome:** exit code 7 (error)\n\n**Command 3:** `sleep 2`\n- + **stdout:** (empty)\n- **stderr:** (empty)\n- **outcome:** timeout (exceeded + 1000ms timeout)\n\nThe first command executed successfully and printed to stdout. + The second command printed an error message to stderr and exited with code 7. + The third command was interrupted by the timeout before it could complete (sleeping + for 2 seconds but only 1 second allowed).","annotations":[]}]}],"usage":{"input_tokens":695,"output_tokens":412,"total_tokens":1107,"input_tokens_details":{"cached_tokens":0},"output_tokens_details":{"reasoning_tokens":0}},"incomplete_details":null,"error":null,"previous_response_id":"resp_01a07fda-302f-7340-be8e-df03fecdb04f","conversation_id":null,"instructions":null}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 diff --git a/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-nonzero-exit-Qwen-Qwen3.5-35B-A3B-FP8-nonstreaming.yaml b/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-nonzero-exit-Qwen-Qwen3.5-35B-A3B-FP8-nonstreaming.yaml new file mode 100644 index 00000000..d1a4f21e --- /dev/null +++ b/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-nonzero-exit-Qwen-Qwen3.5-35B-A3B-FP8-nonstreaming.yaml @@ -0,0 +1,197 @@ +turns: +- filename: t1 + request: + body: + input: 'The local shell environment is Linux bash. Use the shell tool exactly + once with this exact action, preserving the commands array and its order: + {"commands": ["printf ''SHELL_ERROR\\n'' >&2; exit 7"], "timeout_ms": 1000, + "max_output_length": 4096}. Keep semicolon-separated statements in the same + command string. Wait for the client to return shell_call_output before interpreting + the results.' + max_output_tokens: 4096 + model: Qwen/Qwen3.5-35B-A3B-FP8 + store: true + stream: false + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + body: + conversation_id: null + created_at: 1788851389 + error: null + id: resp_01a07fda-0000-77f2-8eec-607bf0ab7f47 + incomplete_details: null + instructions: null + model: Qwen/Qwen3.5-35B-A3B-FP8 + object: response + output: + - content: + - text: 'The user wants me to use the shell tool exactly once with a specific + command that writes "SHELL_ERROR" to stderr and exits with code 7. They + want me to wait for the shell_call_output before interpreting results. + Let me execute this command exactly as specified. + + ' + type: reasoning_text + encrypted_content: null + id: rs_b7f3ac0c0c7bb073 + status: null + summary: [] + type: reasoning + - action: + commands: + - printf 'SHELL_ERROR\n' >&2; exit 7 + max_output_length: 4096 + timeout_ms: 1000 + call_id: chatcmpl-tool-87b07b3953fa04b8 + id: sh_9811c7c5c18b8952 + status: completed + type: shell_call + previous_response_id: null + status: completed + usage: + input_tokens: 491 + input_tokens_details: + cached_tokens: 0 + output_tokens: 130 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 621 + headers: + content-type: application/json + status_code: 200 +- filename: t2 + request: + body: + input: + - call_id: chatcmpl-tool-87b07b3953fa04b8 + max_output_length: 4096 + output: + - outcome: + exit_code: 7 + type: exit + stderr: 'SHELL_ERROR + + ' + stdout: '' + type: shell_call_output + - content: Use the shell output above without calling any more tools. For each + command, report its stdout, stderr, and exit code or timeout outcome in + order. + role: user + type: message + max_output_tokens: 4096 + model: Qwen/Qwen3.5-35B-A3B-FP8 + previous_response_id: resp_01a07fda-0000-77f2-8eec-607bf0ab7f47 + store: true + stream: false + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + body: + conversation_id: null + created_at: 1788851390 + error: null + id: resp_01a07fda-0384-7761-b27e-2707d404b97e + incomplete_details: null + instructions: null + model: Qwen/Qwen3.5-35B-A3B-FP8 + object: response + output: + - content: + - text: 'The user wants me to analyze the shell output that was just returned. + I need to report the stdout, stderr, and exit code/timeout outcome for + the command that was executed. + + + From the shell output: + + - stdout: "" (empty) + + - stderr: "SHELL_ERROR\n" + + - outcome: {"type": "exit", "exit_code": 7} + + + So the command: + + - Produced no stdout + + - Produced "SHELL_ERROR" on stderr + + - Exited with code 7 + + + I should report this information clearly for the user. + + ' + type: reasoning_text + encrypted_content: null + id: rs_bdec96bd92ab2bfd + status: null + summary: [] + type: reasoning + - content: + - annotations: [] + text: ' + + + **Command Analysis:** + + + **Command:** `printf ''SHELL_ERROR\n'' >&2; exit 7` + + + **Results:** + + - **stdout:** (empty) + + - **stderr:** `SHELL_ERROR` + + - **Exit Code:** 7 + + - **Outcome:** The command terminated normally with exit code 7 (not a + timeout) + + + **Summary:** The command successfully wrote "SHELL_ERROR" to stderr and + exited with code 7, as expected from the intentional error handling in + the shell script.' + type: output_text + id: msg_ba10a92b74bc12ea + role: assistant + status: completed + type: message + previous_response_id: resp_01a07fda-0000-77f2-8eec-607bf0ab7f47 + status: completed + usage: + input_tokens: 635 + input_tokens_details: + cached_tokens: 0 + output_tokens: 226 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 861 + headers: + content-type: application/json + status_code: 200 diff --git a/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-nonzero-exit-Qwen-Qwen3.5-35B-A3B-FP8-streaming.yaml b/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-nonzero-exit-Qwen-Qwen3.5-35B-A3B-FP8-streaming.yaml new file mode 100644 index 00000000..e114c525 --- /dev/null +++ b/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-nonzero-exit-Qwen-Qwen3.5-35B-A3B-FP8-streaming.yaml @@ -0,0 +1,2556 @@ +turns: +- filename: t1 + request: + body: + input: 'The local shell environment is Linux bash. Use the shell tool exactly + once with this exact action, preserving the commands array and its order: + {"commands": ["printf ''SHELL_ERROR\\n'' >&2; exit 7"], "timeout_ms": 1000, + "max_output_length": 4096}. Keep semicolon-separated statements in the same + command string. Wait for the client to return shell_call_output before interpreting + the results.' + max_output_tokens: 4096 + model: Qwen/Qwen3.5-35B-A3B-FP8 + store: true + stream: true + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + headers: + content-type: text/event-stream; charset=utf-8 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_01a07fd9-f15d-7fc1-aebe-ed8301c2ee93","created_at":1788851384,"incomplete_details":null,"instructions":null,"metadata":null,"model":"Qwen/Qwen3.5-35B-A3B-FP8","object":"response","output":[],"parallel_tool_calls":false,"temperature":1.0,"tool_choice":"auto","tools":[{"name":"shell","parameters":{"type":"object","properties":{"commands":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Commands + to execute in order."},"timeout_ms":{"type":"integer","minimum":0,"description":"Optional + timeout in milliseconds."},"max_output_length":{"type":"integer","minimum":0,"description":"Optional + maximum captured output length."}},"required":["commands"],"additionalProperties":false},"strict":false,"type":"function","allowed_callers":null,"defer_loading":null,"description":"Run + one or more commands in the caller-provided local shell environment. The caller + executes the commands and returns their outputs.","output_schema":null}],"top_p":0.95,"background":false,"max_output_tokens":4096,"max_tool_calls":null,"previous_response_id":null,"prompt":null,"reasoning":null,"service_tier":"auto","status":"in_progress","text":null,"top_logprobs":null,"truncation":"disabled","usage":null,"user":null,"presence_penalty":0.0,"frequency_penalty":0.0,"kv_transfer_params":null,"ec_transfer_params":null,"input_messages":null,"output_messages":null}} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_01a07fd9-f15d-7fc1-aebe-ed8301c2ee93","created_at":1788851384,"incomplete_details":null,"instructions":null,"metadata":null,"model":"Qwen/Qwen3.5-35B-A3B-FP8","object":"response","output":[],"parallel_tool_calls":false,"temperature":1.0,"tool_choice":"auto","tools":[{"name":"shell","parameters":{"type":"object","properties":{"commands":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Commands + to execute in order."},"timeout_ms":{"type":"integer","minimum":0,"description":"Optional + timeout in milliseconds."},"max_output_length":{"type":"integer","minimum":0,"description":"Optional + maximum captured output length."}},"required":["commands"],"additionalProperties":false},"strict":false,"type":"function","allowed_callers":null,"defer_loading":null,"description":"Run + one or more commands in the caller-provided local shell environment. The caller + executes the commands and returns their outputs.","output_schema":null}],"top_p":0.95,"background":false,"max_output_tokens":4096,"max_tool_calls":null,"previous_response_id":null,"prompt":null,"reasoning":null,"service_tier":"auto","status":"in_progress","text":null,"top_logprobs":null,"truncation":"disabled","usage":null,"user":null,"presence_penalty":0.0,"frequency_penalty":0.0,"kv_transfer_params":null,"ec_transfer_params":null,"input_messages":null,"output_messages":null}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"9515711636afb006","summary":[],"type":"reasoning","content":null,"encrypted_content":null,"status":"in_progress"}} + + ' + - ' + + ' + - 'event: response.reasoning_part.added + + ' + - 'data: {"type":"response.reasoning_part.added","sequence_number":3,"output_index":0,"content_index":0,"item_id":"9515711636afb006","part":{"text":"","type":"reasoning_text"}} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":4,"output_index":0,"content_index":0,"delta":"The","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":5,"output_index":0,"content_index":0,"delta":" + user","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":6,"output_index":0,"content_index":0,"delta":" + wants","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":7,"output_index":0,"content_index":0,"delta":" + me","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":8,"output_index":0,"content_index":0,"delta":" + to","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":9,"output_index":0,"content_index":0,"delta":" + execute","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":10,"output_index":0,"content_index":0,"delta":" + a","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":11,"output_index":0,"content_index":0,"delta":" + shell","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":12,"output_index":0,"content_index":0,"delta":" + command","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":13,"output_index":0,"content_index":0,"delta":" + exactly","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":14,"output_index":0,"content_index":0,"delta":" + once","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":15,"output_index":0,"content_index":0,"delta":" + with","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":16,"output_index":0,"content_index":0,"delta":" + specific","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":17,"output_index":0,"content_index":0,"delta":" + parameters","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":18,"output_index":0,"content_index":0,"delta":".","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":19,"output_index":0,"content_index":0,"delta":" + They","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":20,"output_index":0,"content_index":0,"delta":"''ve","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":21,"output_index":0,"content_index":0,"delta":" + provided","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":22,"output_index":0,"content_index":0,"delta":" + the","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":23,"output_index":0,"content_index":0,"delta":" + exact","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":24,"output_index":0,"content_index":0,"delta":" + command","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":25,"output_index":0,"content_index":0,"delta":" + structure","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":26,"output_index":0,"content_index":0,"delta":" + with","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":27,"output_index":0,"content_index":0,"delta":":","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":28,"output_index":0,"content_index":0,"delta":"\n","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":29,"output_index":0,"content_index":0,"delta":"-","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":30,"output_index":0,"content_index":0,"delta":" + Commands","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":31,"output_index":0,"content_index":0,"delta":" + array","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":32,"output_index":0,"content_index":0,"delta":" + containing","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":33,"output_index":0,"content_index":0,"delta":" + one","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":34,"output_index":0,"content_index":0,"delta":" + command","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":35,"output_index":0,"content_index":0,"delta":":","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":36,"output_index":0,"content_index":0,"delta":" + \"","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":37,"output_index":0,"content_index":0,"delta":"printf","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":38,"output_index":0,"content_index":0,"delta":" + ''","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":39,"output_index":0,"content_index":0,"delta":"S","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":40,"output_index":0,"content_index":0,"delta":"HELL","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":41,"output_index":0,"content_index":0,"delta":"_ERROR","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":42,"output_index":0,"content_index":0,"delta":"\\\\","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":43,"output_index":0,"content_index":0,"delta":"n","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":44,"output_index":0,"content_index":0,"delta":"''","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":45,"output_index":0,"content_index":0,"delta":" + >&","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":46,"output_index":0,"content_index":0,"delta":"2","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":47,"output_index":0,"content_index":0,"delta":";","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":48,"output_index":0,"content_index":0,"delta":" + exit","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":49,"output_index":0,"content_index":0,"delta":" + ","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":50,"output_index":0,"content_index":0,"delta":"7","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":51,"output_index":0,"content_index":0,"delta":"\"","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":52,"output_index":0,"content_index":0,"delta":"\n","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":53,"output_index":0,"content_index":0,"delta":"-","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":54,"output_index":0,"content_index":0,"delta":" + timeout","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":55,"output_index":0,"content_index":0,"delta":"_ms","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":56,"output_index":0,"content_index":0,"delta":":","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":57,"output_index":0,"content_index":0,"delta":" + ","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":58,"output_index":0,"content_index":0,"delta":"1","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":59,"output_index":0,"content_index":0,"delta":"0","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":60,"output_index":0,"content_index":0,"delta":"0","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":61,"output_index":0,"content_index":0,"delta":"0","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":62,"output_index":0,"content_index":0,"delta":"\n","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":63,"output_index":0,"content_index":0,"delta":"-","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":64,"output_index":0,"content_index":0,"delta":" + max","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":65,"output_index":0,"content_index":0,"delta":"_output","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":66,"output_index":0,"content_index":0,"delta":"_length","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":67,"output_index":0,"content_index":0,"delta":":","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":68,"output_index":0,"content_index":0,"delta":" + ","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":69,"output_index":0,"content_index":0,"delta":"4","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":70,"output_index":0,"content_index":0,"delta":"0","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":71,"output_index":0,"content_index":0,"delta":"9","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":72,"output_index":0,"content_index":0,"delta":"6","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":73,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":74,"output_index":0,"content_index":0,"delta":"I","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":75,"output_index":0,"content_index":0,"delta":" + need","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":76,"output_index":0,"content_index":0,"delta":" + to","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":77,"output_index":0,"content_index":0,"delta":" + use","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":78,"output_index":0,"content_index":0,"delta":" + the","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":79,"output_index":0,"content_index":0,"delta":" + shell","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":80,"output_index":0,"content_index":0,"delta":" + tool","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":81,"output_index":0,"content_index":0,"delta":" + with","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":82,"output_index":0,"content_index":0,"delta":" + these","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":83,"output_index":0,"content_index":0,"delta":" + exact","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":84,"output_index":0,"content_index":0,"delta":" + parameters","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":85,"output_index":0,"content_index":0,"delta":" + and","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":86,"output_index":0,"content_index":0,"delta":" + wait","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":87,"output_index":0,"content_index":0,"delta":" + for","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":88,"output_index":0,"content_index":0,"delta":" + the","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":89,"output_index":0,"content_index":0,"delta":" + client","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":90,"output_index":0,"content_index":0,"delta":" + to","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":91,"output_index":0,"content_index":0,"delta":" + return","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":92,"output_index":0,"content_index":0,"delta":" + the","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":93,"output_index":0,"content_index":0,"delta":" + shell","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":94,"output_index":0,"content_index":0,"delta":"_call","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":95,"output_index":0,"content_index":0,"delta":"_output","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":96,"output_index":0,"content_index":0,"delta":" + before","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":97,"output_index":0,"content_index":0,"delta":" + interpreting","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":98,"output_index":0,"content_index":0,"delta":" + results","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":99,"output_index":0,"content_index":0,"delta":".","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":100,"output_index":0,"content_index":0,"delta":"\n","item_id":"9515711636afb006"} + + ' + - ' + + ' + - 'event: response.reasoning_text.done + + ' + - 'data: {"type":"response.reasoning_text.done","sequence_number":101,"output_index":0,"content_index":0,"item_id":"9515711636afb006","text":"The + user wants me to execute a shell command exactly once with specific parameters. + They''ve provided the exact command structure with:\n- Commands array containing + one command: \"printf ''SHELL_ERROR\\\\n'' >&2; exit 7\"\n- timeout_ms: 1000\n- + max_output_length: 4096\n\nI need to use the shell tool with these exact parameters + and wait for the client to return the shell_call_output before interpreting + results.\n"} + + ' + - ' + + ' + - 'event: response.reasoning_part.done + + ' + - 'data: {"type":"response.reasoning_part.done","sequence_number":102,"output_index":0,"content_index":0,"item_id":"9515711636afb006","part":{"text":"The + user wants me to execute a shell command exactly once with specific parameters. + They''ve provided the exact command structure with:\n- Commands array containing + one command: \"printf ''SHELL_ERROR\\\\n'' >&2; exit 7\"\n- timeout_ms: 1000\n- + max_output_length: 4096\n\nI need to use the shell tool with these exact parameters + and wait for the client to return the shell_call_output before interpreting + results.\n","type":"reasoning_text"}} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":103,"output_index":0,"item":{"id":"9515711636afb006","summary":[],"type":"reasoning","content":[{"text":"The + user wants me to execute a shell command exactly once with specific parameters. + They''ve provided the exact command structure with:\n- Commands array containing + one command: \"printf ''SHELL_ERROR\\\\n'' >&2; exit 7\"\n- timeout_ms: 1000\n- + max_output_length: 4096\n\nI need to use the shell tool with these exact parameters + and wait for the client to return the shell_call_output before interpreting + results.\n","type":"reasoning_text"}],"encrypted_content":null,"status":"completed"}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":104,"output_index":1,"item":{"type":"shell_call","id":"sh_3667777a4bc9cc76","call_id":"call_964c4928ea75ad36","status":"in_progress","action":{"commands":[],"timeout_ms":null,"max_output_length":null}}} + + ' + - ' + + ' + - 'event: response.shell_call_command.added + + ' + - 'data: {"type":"response.shell_call_command.added","sequence_number":105,"output_index":1,"command_index":0,"command":""} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","sequence_number":106,"output_index":1,"command_index":0,"delta":"printf + ''SHELL_ERROR\\n'' >&2; exit 7"} + + ' + - ' + + ' + - 'event: response.shell_call_command.done + + ' + - 'data: {"type":"response.shell_call_command.done","sequence_number":107,"output_index":1,"command_index":0,"command":"printf + ''SHELL_ERROR\\n'' >&2; exit 7"} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":108,"output_index":1,"item":{"type":"shell_call","id":"sh_3667777a4bc9cc76","call_id":"call_964c4928ea75ad36","action":{"commands":["printf + ''SHELL_ERROR\\n'' >&2; exit 7"],"timeout_ms":1000,"max_output_length":4096},"status":"completed"}} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","sequence_number":109,"response":{"id":"resp_01a07fd9-f15d-7fc1-aebe-ed8301c2ee93","object":"response","created_at":1788851385,"model":"Qwen/Qwen3.5-35B-A3B-FP8","status":"completed","output":[{"type":"reasoning","id":"9515711636afb006","content":[{"type":"reasoning_text","text":"The + user wants me to execute a shell command exactly once with specific parameters. + They''ve provided the exact command structure with:\n- Commands array containing + one command: \"printf ''SHELL_ERROR\\\\n'' >&2; exit 7\"\n- timeout_ms: 1000\n- + max_output_length: 4096\n\nI need to use the shell tool with these exact parameters + and wait for the client to return the shell_call_output before interpreting + results.\n"}],"summary":[],"encrypted_content":null,"status":"completed"},{"type":"shell_call","id":"sh_3667777a4bc9cc76","call_id":"call_964c4928ea75ad36","action":{"commands":["printf + ''SHELL_ERROR\\n'' >&2; exit 7"],"timeout_ms":1000,"max_output_length":4096},"status":"completed"}],"usage":{"input_tokens":491,"output_tokens":172,"total_tokens":663,"input_tokens_details":{"cached_tokens":0},"output_tokens_details":{"reasoning_tokens":0}},"incomplete_details":null,"error":null,"previous_response_id":null,"conversation_id":null,"instructions":null}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 +- filename: t2 + request: + body: + input: + - call_id: call_964c4928ea75ad36 + max_output_length: 4096 + output: + - outcome: + exit_code: 7 + type: exit + stderr: 'SHELL_ERROR + + ' + stdout: '' + type: shell_call_output + - content: Use the shell output above without calling any more tools. For each + command, report its stdout, stderr, and exit code or timeout outcome in + order. + role: user + type: message + max_output_tokens: 4096 + model: Qwen/Qwen3.5-35B-A3B-FP8 + previous_response_id: resp_01a07fd9-f15d-7fc1-aebe-ed8301c2ee93 + store: true + stream: true + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + headers: + content-type: text/event-stream; charset=utf-8 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_01a07fd9-f610-75a1-b948-66eb384e9f48","created_at":1788851385,"incomplete_details":null,"instructions":null,"metadata":null,"model":"Qwen/Qwen3.5-35B-A3B-FP8","object":"response","output":[],"parallel_tool_calls":false,"temperature":1.0,"tool_choice":"auto","tools":[{"name":"shell","parameters":{"type":"object","properties":{"commands":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Commands + to execute in order."},"timeout_ms":{"type":"integer","minimum":0,"description":"Optional + timeout in milliseconds."},"max_output_length":{"type":"integer","minimum":0,"description":"Optional + maximum captured output length."}},"required":["commands"],"additionalProperties":false},"strict":false,"type":"function","allowed_callers":null,"defer_loading":null,"description":"Run + one or more commands in the caller-provided local shell environment. The caller + executes the commands and returns their outputs.","output_schema":null}],"top_p":0.95,"background":false,"max_output_tokens":4096,"max_tool_calls":null,"previous_response_id":"resp_01a07fd9-f15d-7fc1-aebe-ed8301c2ee93","prompt":null,"reasoning":null,"service_tier":"auto","status":"in_progress","text":null,"top_logprobs":null,"truncation":"disabled","usage":null,"user":null,"presence_penalty":0.0,"frequency_penalty":0.0,"kv_transfer_params":null,"ec_transfer_params":null,"input_messages":null,"output_messages":null}} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_01a07fd9-f610-75a1-b948-66eb384e9f48","created_at":1788851385,"incomplete_details":null,"instructions":null,"metadata":null,"model":"Qwen/Qwen3.5-35B-A3B-FP8","object":"response","output":[],"parallel_tool_calls":false,"temperature":1.0,"tool_choice":"auto","tools":[{"name":"shell","parameters":{"type":"object","properties":{"commands":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Commands + to execute in order."},"timeout_ms":{"type":"integer","minimum":0,"description":"Optional + timeout in milliseconds."},"max_output_length":{"type":"integer","minimum":0,"description":"Optional + maximum captured output length."}},"required":["commands"],"additionalProperties":false},"strict":false,"type":"function","allowed_callers":null,"defer_loading":null,"description":"Run + one or more commands in the caller-provided local shell environment. The caller + executes the commands and returns their outputs.","output_schema":null}],"top_p":0.95,"background":false,"max_output_tokens":4096,"max_tool_calls":null,"previous_response_id":"resp_01a07fd9-f15d-7fc1-aebe-ed8301c2ee93","prompt":null,"reasoning":null,"service_tier":"auto","status":"in_progress","text":null,"top_logprobs":null,"truncation":"disabled","usage":null,"user":null,"presence_penalty":0.0,"frequency_penalty":0.0,"kv_transfer_params":null,"ec_transfer_params":null,"input_messages":null,"output_messages":null}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"98593861f4e03deb","summary":[],"type":"reasoning","content":null,"encrypted_content":null,"status":"in_progress"}} + + ' + - ' + + ' + - 'event: response.reasoning_part.added + + ' + - 'data: {"type":"response.reasoning_part.added","sequence_number":3,"output_index":0,"content_index":0,"item_id":"98593861f4e03deb","part":{"text":"","type":"reasoning_text"}} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":4,"output_index":0,"content_index":0,"delta":"The","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":5,"output_index":0,"content_index":0,"delta":" + shell","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":6,"output_index":0,"content_index":0,"delta":" + output","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":7,"output_index":0,"content_index":0,"delta":" + shows","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":8,"output_index":0,"content_index":0,"delta":" + the","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":9,"output_index":0,"content_index":0,"delta":" + result","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":10,"output_index":0,"content_index":0,"delta":" + of","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":11,"output_index":0,"content_index":0,"delta":" + executing","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":12,"output_index":0,"content_index":0,"delta":" + the","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":13,"output_index":0,"content_index":0,"delta":" + single","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":14,"output_index":0,"content_index":0,"delta":" + command","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":15,"output_index":0,"content_index":0,"delta":".","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":16,"output_index":0,"content_index":0,"delta":" + I","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":17,"output_index":0,"content_index":0,"delta":" + need","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":18,"output_index":0,"content_index":0,"delta":" + to","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":19,"output_index":0,"content_index":0,"delta":" + report","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":20,"output_index":0,"content_index":0,"delta":" + the","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":21,"output_index":0,"content_index":0,"delta":" + stdout","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":22,"output_index":0,"content_index":0,"delta":",","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":23,"output_index":0,"content_index":0,"delta":" + stderr","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":24,"output_index":0,"content_index":0,"delta":",","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":25,"output_index":0,"content_index":0,"delta":" + and","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":26,"output_index":0,"content_index":0,"delta":" + exit","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":27,"output_index":0,"content_index":0,"delta":" + code","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":28,"output_index":0,"content_index":0,"delta":"/","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":29,"output_index":0,"content_index":0,"delta":"timeout","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":30,"output_index":0,"content_index":0,"delta":" + outcome","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":31,"output_index":0,"content_index":0,"delta":" + for","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":32,"output_index":0,"content_index":0,"delta":" + each","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":33,"output_index":0,"content_index":0,"delta":" + command","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":34,"output_index":0,"content_index":0,"delta":" + in","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":35,"output_index":0,"content_index":0,"delta":" + order","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":36,"output_index":0,"content_index":0,"delta":".","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":37,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":38,"output_index":0,"content_index":0,"delta":"From","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":39,"output_index":0,"content_index":0,"delta":" + the","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":40,"output_index":0,"content_index":0,"delta":" + output","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":41,"output_index":0,"content_index":0,"delta":":","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":42,"output_index":0,"content_index":0,"delta":"\n","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":43,"output_index":0,"content_index":0,"delta":"-","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":44,"output_index":0,"content_index":0,"delta":" + stdout","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":45,"output_index":0,"content_index":0,"delta":":","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":46,"output_index":0,"content_index":0,"delta":" + \"\"","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":47,"output_index":0,"content_index":0,"delta":" + (","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":48,"output_index":0,"content_index":0,"delta":"empty","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":49,"output_index":0,"content_index":0,"delta":")","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":50,"output_index":0,"content_index":0,"delta":"\n","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":51,"output_index":0,"content_index":0,"delta":"-","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":52,"output_index":0,"content_index":0,"delta":" + stderr","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":53,"output_index":0,"content_index":0,"delta":":","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":54,"output_index":0,"content_index":0,"delta":" + \"","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":55,"output_index":0,"content_index":0,"delta":"S","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":56,"output_index":0,"content_index":0,"delta":"HELL","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":57,"output_index":0,"content_index":0,"delta":"_ERROR","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":58,"output_index":0,"content_index":0,"delta":"\\n","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":59,"output_index":0,"content_index":0,"delta":"\"","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":60,"output_index":0,"content_index":0,"delta":"\n","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":61,"output_index":0,"content_index":0,"delta":"-","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":62,"output_index":0,"content_index":0,"delta":" + exit","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":63,"output_index":0,"content_index":0,"delta":"_code","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":64,"output_index":0,"content_index":0,"delta":":","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":65,"output_index":0,"content_index":0,"delta":" + ","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":66,"output_index":0,"content_index":0,"delta":"7","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":67,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":68,"output_index":0,"content_index":0,"delta":"This","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":69,"output_index":0,"content_index":0,"delta":" + is","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":70,"output_index":0,"content_index":0,"delta":" + the","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":71,"output_index":0,"content_index":0,"delta":" + outcome","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":72,"output_index":0,"content_index":0,"delta":" + of","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":73,"output_index":0,"content_index":0,"delta":" + a","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":74,"output_index":0,"content_index":0,"delta":" + single","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":75,"output_index":0,"content_index":0,"delta":" + command","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":76,"output_index":0,"content_index":0,"delta":" + execution","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":77,"output_index":0,"content_index":0,"delta":".","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":78,"output_index":0,"content_index":0,"delta":"\n","item_id":"98593861f4e03deb"} + + ' + - ' + + ' + - 'event: response.reasoning_text.done + + ' + - 'data: {"type":"response.reasoning_text.done","sequence_number":79,"output_index":0,"content_index":0,"item_id":"98593861f4e03deb","text":"The + shell output shows the result of executing the single command. I need to report + the stdout, stderr, and exit code/timeout outcome for each command in order.\n\nFrom + the output:\n- stdout: \"\" (empty)\n- stderr: \"SHELL_ERROR\\n\"\n- exit_code: + 7\n\nThis is the outcome of a single command execution.\n"} + + ' + - ' + + ' + - 'event: response.reasoning_part.done + + ' + - 'data: {"type":"response.reasoning_part.done","sequence_number":80,"output_index":0,"content_index":0,"item_id":"98593861f4e03deb","part":{"text":"The + shell output shows the result of executing the single command. I need to report + the stdout, stderr, and exit code/timeout outcome for each command in order.\n\nFrom + the output:\n- stdout: \"\" (empty)\n- stderr: \"SHELL_ERROR\\n\"\n- exit_code: + 7\n\nThis is the outcome of a single command execution.\n","type":"reasoning_text"}} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":81,"output_index":0,"item":{"id":"98593861f4e03deb","summary":[],"type":"reasoning","content":[{"text":"The + shell output shows the result of executing the single command. I need to report + the stdout, stderr, and exit code/timeout outcome for each command in order.\n\nFrom + the output:\n- stdout: \"\" (empty)\n- stderr: \"SHELL_ERROR\\n\"\n- exit_code: + 7\n\nThis is the outcome of a single command execution.\n","type":"reasoning_text"}],"encrypted_content":null,"status":"completed"}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":82,"output_index":1,"item":{"id":"b40224e61c1b90f7","content":[],"role":"assistant","status":"in_progress","type":"message","phase":null}} + + ' + - ' + + ' + - 'event: response.content_part.added + + ' + - 'data: {"type":"response.content_part.added","sequence_number":83,"output_index":1,"content_index":0,"item_id":"b40224e61c1b90f7","part":{"annotations":[],"text":"","type":"output_text","logprobs":[]}} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":84,"output_index":1,"content_index":0,"delta":"\n\nBased","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":85,"output_index":1,"content_index":0,"delta":" + on","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":86,"output_index":1,"content_index":0,"delta":" + the","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":87,"output_index":1,"content_index":0,"delta":" + shell","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":88,"output_index":1,"content_index":0,"delta":" + output","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":89,"output_index":1,"content_index":0,"delta":":","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":90,"output_index":1,"content_index":0,"delta":"\n\n","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":91,"output_index":1,"content_index":0,"delta":"**","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":92,"output_index":1,"content_index":0,"delta":"Command","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":93,"output_index":1,"content_index":0,"delta":" + ","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":94,"output_index":1,"content_index":0,"delta":"1","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":95,"output_index":1,"content_index":0,"delta":":**","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":96,"output_index":1,"content_index":0,"delta":" + `","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":97,"output_index":1,"content_index":0,"delta":"printf","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":98,"output_index":1,"content_index":0,"delta":" + ''","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":99,"output_index":1,"content_index":0,"delta":"S","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":100,"output_index":1,"content_index":0,"delta":"HELL","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":101,"output_index":1,"content_index":0,"delta":"_ERROR","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":102,"output_index":1,"content_index":0,"delta":"\\n","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":103,"output_index":1,"content_index":0,"delta":"''","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":104,"output_index":1,"content_index":0,"delta":" + >&","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":105,"output_index":1,"content_index":0,"delta":"2","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":106,"output_index":1,"content_index":0,"delta":";","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":107,"output_index":1,"content_index":0,"delta":" + exit","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":108,"output_index":1,"content_index":0,"delta":" + ","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":109,"output_index":1,"content_index":0,"delta":"7","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":110,"output_index":1,"content_index":0,"delta":"`","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":111,"output_index":1,"content_index":0,"delta":"\n","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":112,"output_index":1,"content_index":0,"delta":"-","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":113,"output_index":1,"content_index":0,"delta":" + **","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":114,"output_index":1,"content_index":0,"delta":"stdout","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":115,"output_index":1,"content_index":0,"delta":":**","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":116,"output_index":1,"content_index":0,"delta":" + (","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":117,"output_index":1,"content_index":0,"delta":"empty","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":118,"output_index":1,"content_index":0,"delta":")","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":119,"output_index":1,"content_index":0,"delta":"\n","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":120,"output_index":1,"content_index":0,"delta":"-","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":121,"output_index":1,"content_index":0,"delta":" + **","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":122,"output_index":1,"content_index":0,"delta":"stderr","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":123,"output_index":1,"content_index":0,"delta":":**","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":124,"output_index":1,"content_index":0,"delta":" + `","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":125,"output_index":1,"content_index":0,"delta":"S","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":126,"output_index":1,"content_index":0,"delta":"HELL","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":127,"output_index":1,"content_index":0,"delta":"_ERROR","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":128,"output_index":1,"content_index":0,"delta":"`","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":129,"output_index":1,"content_index":0,"delta":"\n","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":130,"output_index":1,"content_index":0,"delta":"-","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":131,"output_index":1,"content_index":0,"delta":" + **","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":132,"output_index":1,"content_index":0,"delta":"Outcome","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":133,"output_index":1,"content_index":0,"delta":":**","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":134,"output_index":1,"content_index":0,"delta":" + Exit","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":135,"output_index":1,"content_index":0,"delta":" + with","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":136,"output_index":1,"content_index":0,"delta":" + code","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":137,"output_index":1,"content_index":0,"delta":" + ","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":138,"output_index":1,"content_index":0,"delta":"7","item_id":"b40224e61c1b90f7","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.done + + ' + - 'data: {"type":"response.output_text.done","sequence_number":139,"output_index":1,"content_index":0,"item_id":"b40224e61c1b90f7","logprobs":[],"text":"\n\nBased + on the shell output:\n\n**Command 1:** `printf ''SHELL_ERROR\\n'' >&2; exit + 7`\n- **stdout:** (empty)\n- **stderr:** `SHELL_ERROR`\n- **Outcome:** Exit + with code 7"} + + ' + - ' + + ' + - 'event: response.content_part.done + + ' + - 'data: {"type":"response.content_part.done","sequence_number":140,"output_index":1,"content_index":0,"item_id":"b40224e61c1b90f7","part":{"annotations":[],"text":"\n\nBased + on the shell output:\n\n**Command 1:** `printf ''SHELL_ERROR\\n'' >&2; exit + 7`\n- **stdout:** (empty)\n- **stderr:** `SHELL_ERROR`\n- **Outcome:** Exit + with code 7","type":"output_text","logprobs":null}} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":141,"output_index":1,"item":{"id":"b40224e61c1b90f7","content":[{"annotations":[],"text":"\n\nBased + on the shell output:\n\n**Command 1:** `printf ''SHELL_ERROR\\n'' >&2; exit + 7`\n- **stdout:** (empty)\n- **stderr:** `SHELL_ERROR`\n- **Outcome:** Exit + with code 7","type":"output_text","logprobs":null}],"role":"assistant","status":"completed","type":"message","phase":null,"summary":[]}} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","sequence_number":142,"response":{"id":"resp_01a07fd9-f610-75a1-b948-66eb384e9f48","object":"response","created_at":1788851386,"model":"Qwen/Qwen3.5-35B-A3B-FP8","status":"completed","output":[{"type":"reasoning","id":"98593861f4e03deb","content":[{"type":"reasoning_text","text":"The + shell output shows the result of executing the single command. I need to report + the stdout, stderr, and exit code/timeout outcome for each command in order.\n\nFrom + the output:\n- stdout: \"\" (empty)\n- stderr: \"SHELL_ERROR\\n\"\n- exit_code: + 7\n\nThis is the outcome of a single command execution.\n"}],"summary":[],"encrypted_content":null,"status":"completed"},{"type":"message","id":"b40224e61c1b90f7","role":"assistant","status":"completed","content":[{"type":"output_text","text":"\n\nBased + on the shell output:\n\n**Command 1:** `printf ''SHELL_ERROR\\n'' >&2; exit + 7`\n- **stdout:** (empty)\n- **stderr:** `SHELL_ERROR`\n- **Outcome:** Exit + with code 7","annotations":[]}]}],"usage":{"input_tokens":635,"output_tokens":133,"total_tokens":768,"input_tokens_details":{"cached_tokens":0},"output_tokens_details":{"reasoning_tokens":0}},"incomplete_details":null,"error":null,"previous_response_id":"resp_01a07fd9-f15d-7fc1-aebe-ed8301c2ee93","conversation_id":null,"instructions":null}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 diff --git a/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-success-Qwen-Qwen3.5-35B-A3B-FP8-nonstreaming.yaml b/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-success-Qwen-Qwen3.5-35B-A3B-FP8-nonstreaming.yaml new file mode 100644 index 00000000..a5076b13 --- /dev/null +++ b/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-success-Qwen-Qwen3.5-35B-A3B-FP8-nonstreaming.yaml @@ -0,0 +1,178 @@ +turns: +- filename: t1 + request: + body: + input: 'The local shell environment is Linux bash. Use the shell tool exactly + once with this exact action, preserving the commands array and its order: + {"commands": ["printf ''SHELL_OK\\n''"], "timeout_ms": 1000, "max_output_length": + 4096}. Keep semicolon-separated statements in the same command string. Wait + for the client to return shell_call_output before interpreting the results.' + max_output_tokens: 4096 + model: Qwen/Qwen3.5-35B-A3B-FP8 + store: true + stream: false + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + body: + conversation_id: null + created_at: 1788851382 + error: null + id: resp_01a07fd9-e3e1-7652-accb-809e0744cf95 + incomplete_details: null + instructions: null + model: Qwen/Qwen3.5-35B-A3B-FP8 + object: response + output: + - content: + - text: 'The user is asking me to use the shell tool exactly once with specific + commands. They''ve provided a specific action with a commands array containing + one command: ["printf ''SHELL_OK\\n''"] with timeout_ms of 1000 and max_output_length + of 4096. + + + They want me to call the shell function with these exact parameters. Let + me format this correctly. + + ' + type: reasoning_text + encrypted_content: null + id: rs_9ce0829b57171675 + status: null + summary: [] + type: reasoning + - action: + commands: + - printf 'SHELL_OK\n' + max_output_length: 4096 + timeout_ms: 1000 + call_id: chatcmpl-tool-a95aec1211d91651 + id: sh_9989093f4e383727 + status: completed + type: shell_call + previous_response_id: null + status: completed + usage: + input_tokens: 485 + input_tokens_details: + cached_tokens: 0 + output_tokens: 150 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 635 + headers: + content-type: application/json + status_code: 200 +- filename: t2 + request: + body: + input: + - call_id: chatcmpl-tool-a95aec1211d91651 + max_output_length: 4096 + output: + - outcome: + exit_code: 0 + type: exit + stderr: '' + stdout: 'SHELL_OK + + ' + type: shell_call_output + - content: Use the shell output above without calling any more tools. For each + command, report its stdout, stderr, and exit code or timeout outcome in + order. + role: user + type: message + max_output_tokens: 4096 + model: Qwen/Qwen3.5-35B-A3B-FP8 + previous_response_id: resp_01a07fd9-e3e1-7652-accb-809e0744cf95 + store: true + stream: false + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + body: + conversation_id: null + created_at: 1788851383 + error: null + id: resp_01a07fd9-e7e1-7d12-8380-eaabf10caad6 + incomplete_details: null + instructions: null + model: Qwen/Qwen3.5-35B-A3B-FP8 + object: response + output: + - content: + - text: 'The user wants me to report the shell output without calling any + more tools. I need to report the stdout, stderr, and exit code/outcome + for the command that was executed. + + + From the shell output I received: + + - stdout: "SHELL_OK\n" + + - stderr: "" + + - outcome: {"type":"exit","exit_code":0} + + + This is straightforward - I just need to report this information in a + clear format. + + ' + type: reasoning_text + encrypted_content: null + id: rs_9eedd40ce9fb5964 + status: null + summary: [] + type: reasoning + - content: + - annotations: [] + text: ' + + + **Command 1:** `printf ''SHELL_OK\n''` + + - **stdout:** `SHELL_OK` + + - **stderr:** (empty) + + - **outcome:** exit with code 0' + type: output_text + id: msg_a199910ae461cf10 + role: assistant + status: completed + type: message + previous_response_id: resp_01a07fd9-e3e1-7652-accb-809e0744cf95 + status: completed + usage: + input_tokens: 623 + input_tokens_details: + cached_tokens: 0 + output_tokens: 136 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 759 + headers: + content-type: application/json + status_code: 200 diff --git a/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-success-Qwen-Qwen3.5-35B-A3B-FP8-streaming.yaml b/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-success-Qwen-Qwen3.5-35B-A3B-FP8-streaming.yaml new file mode 100644 index 00000000..2968d37b --- /dev/null +++ b/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-success-Qwen-Qwen3.5-35B-A3B-FP8-streaming.yaml @@ -0,0 +1,2804 @@ +turns: +- filename: t1 + request: + body: + input: 'The local shell environment is Linux bash. Use the shell tool exactly + once with this exact action, preserving the commands array and its order: + {"commands": ["printf ''SHELL_OK\\n''"], "timeout_ms": 1000, "max_output_length": + 4096}. Keep semicolon-separated statements in the same command string. Wait + for the client to return shell_call_output before interpreting the results.' + max_output_tokens: 4096 + model: Qwen/Qwen3.5-35B-A3B-FP8 + store: true + stream: true + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + headers: + content-type: text/event-stream; charset=utf-8 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_01a07fd9-d4a1-7330-b750-290afb5fdf0e","created_at":1788851377,"incomplete_details":null,"instructions":null,"metadata":null,"model":"Qwen/Qwen3.5-35B-A3B-FP8","object":"response","output":[],"parallel_tool_calls":false,"temperature":1.0,"tool_choice":"auto","tools":[{"name":"shell","parameters":{"type":"object","properties":{"commands":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Commands + to execute in order."},"timeout_ms":{"type":"integer","minimum":0,"description":"Optional + timeout in milliseconds."},"max_output_length":{"type":"integer","minimum":0,"description":"Optional + maximum captured output length."}},"required":["commands"],"additionalProperties":false},"strict":false,"type":"function","allowed_callers":null,"defer_loading":null,"description":"Run + one or more commands in the caller-provided local shell environment. The caller + executes the commands and returns their outputs.","output_schema":null}],"top_p":0.95,"background":false,"max_output_tokens":4096,"max_tool_calls":null,"previous_response_id":null,"prompt":null,"reasoning":null,"service_tier":"auto","status":"in_progress","text":null,"top_logprobs":null,"truncation":"disabled","usage":null,"user":null,"presence_penalty":0.0,"frequency_penalty":0.0,"kv_transfer_params":null,"ec_transfer_params":null,"input_messages":null,"output_messages":null}} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_01a07fd9-d4a1-7330-b750-290afb5fdf0e","created_at":1788851377,"incomplete_details":null,"instructions":null,"metadata":null,"model":"Qwen/Qwen3.5-35B-A3B-FP8","object":"response","output":[],"parallel_tool_calls":false,"temperature":1.0,"tool_choice":"auto","tools":[{"name":"shell","parameters":{"type":"object","properties":{"commands":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Commands + to execute in order."},"timeout_ms":{"type":"integer","minimum":0,"description":"Optional + timeout in milliseconds."},"max_output_length":{"type":"integer","minimum":0,"description":"Optional + maximum captured output length."}},"required":["commands"],"additionalProperties":false},"strict":false,"type":"function","allowed_callers":null,"defer_loading":null,"description":"Run + one or more commands in the caller-provided local shell environment. The caller + executes the commands and returns their outputs.","output_schema":null}],"top_p":0.95,"background":false,"max_output_tokens":4096,"max_tool_calls":null,"previous_response_id":null,"prompt":null,"reasoning":null,"service_tier":"auto","status":"in_progress","text":null,"top_logprobs":null,"truncation":"disabled","usage":null,"user":null,"presence_penalty":0.0,"frequency_penalty":0.0,"kv_transfer_params":null,"ec_transfer_params":null,"input_messages":null,"output_messages":null}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"b8d3e4f66be9a550","summary":[],"type":"reasoning","content":null,"encrypted_content":null,"status":"in_progress"}} + + ' + - ' + + ' + - 'event: response.reasoning_part.added + + ' + - 'data: {"type":"response.reasoning_part.added","sequence_number":3,"output_index":0,"content_index":0,"item_id":"b8d3e4f66be9a550","part":{"text":"","type":"reasoning_text"}} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":4,"output_index":0,"content_index":0,"delta":"The","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":5,"output_index":0,"content_index":0,"delta":" + user","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":6,"output_index":0,"content_index":0,"delta":" + wants","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":7,"output_index":0,"content_index":0,"delta":" + me","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":8,"output_index":0,"content_index":0,"delta":" + to","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":9,"output_index":0,"content_index":0,"delta":" + use","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":10,"output_index":0,"content_index":0,"delta":" + the","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":11,"output_index":0,"content_index":0,"delta":" + shell","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":12,"output_index":0,"content_index":0,"delta":" + tool","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":13,"output_index":0,"content_index":0,"delta":" + exactly","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":14,"output_index":0,"content_index":0,"delta":" + once","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":15,"output_index":0,"content_index":0,"delta":" + with","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":16,"output_index":0,"content_index":0,"delta":" + a","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":17,"output_index":0,"content_index":0,"delta":" + specific","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":18,"output_index":0,"content_index":0,"delta":" + action","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":19,"output_index":0,"content_index":0,"delta":".","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":20,"output_index":0,"content_index":0,"delta":" + They","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":21,"output_index":0,"content_index":0,"delta":"''ve","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":22,"output_index":0,"content_index":0,"delta":" + provided","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":23,"output_index":0,"content_index":0,"delta":" + the","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":24,"output_index":0,"content_index":0,"delta":" + exact","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":25,"output_index":0,"content_index":0,"delta":" + command","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":26,"output_index":0,"content_index":0,"delta":" + structure","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":27,"output_index":0,"content_index":0,"delta":" + I","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":28,"output_index":0,"content_index":0,"delta":" + need","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":29,"output_index":0,"content_index":0,"delta":" + to","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":30,"output_index":0,"content_index":0,"delta":" + use","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":31,"output_index":0,"content_index":0,"delta":".","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":32,"output_index":0,"content_index":0,"delta":" + Let","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":33,"output_index":0,"content_index":0,"delta":" + me","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":34,"output_index":0,"content_index":0,"delta":" + execute","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":35,"output_index":0,"content_index":0,"delta":" + this","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":36,"output_index":0,"content_index":0,"delta":":","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":37,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":38,"output_index":0,"content_index":0,"delta":"-","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":39,"output_index":0,"content_index":0,"delta":" + commands","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":40,"output_index":0,"content_index":0,"delta":":","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":41,"output_index":0,"content_index":0,"delta":" + [\"","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":42,"output_index":0,"content_index":0,"delta":"printf","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":43,"output_index":0,"content_index":0,"delta":" + ''","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":44,"output_index":0,"content_index":0,"delta":"S","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":45,"output_index":0,"content_index":0,"delta":"HELL","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":46,"output_index":0,"content_index":0,"delta":"_OK","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":47,"output_index":0,"content_index":0,"delta":"\\\\","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":48,"output_index":0,"content_index":0,"delta":"n","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":49,"output_index":0,"content_index":0,"delta":"''","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":50,"output_index":0,"content_index":0,"delta":"\"]","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":51,"output_index":0,"content_index":0,"delta":"\n","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":52,"output_index":0,"content_index":0,"delta":"-","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":53,"output_index":0,"content_index":0,"delta":" + timeout","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":54,"output_index":0,"content_index":0,"delta":"_ms","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":55,"output_index":0,"content_index":0,"delta":":","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":56,"output_index":0,"content_index":0,"delta":" + ","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":57,"output_index":0,"content_index":0,"delta":"1","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":58,"output_index":0,"content_index":0,"delta":"0","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":59,"output_index":0,"content_index":0,"delta":"0","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":60,"output_index":0,"content_index":0,"delta":"0","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":61,"output_index":0,"content_index":0,"delta":"\n","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":62,"output_index":0,"content_index":0,"delta":"-","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":63,"output_index":0,"content_index":0,"delta":" + max","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":64,"output_index":0,"content_index":0,"delta":"_output","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":65,"output_index":0,"content_index":0,"delta":"_length","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":66,"output_index":0,"content_index":0,"delta":":","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":67,"output_index":0,"content_index":0,"delta":" + ","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":68,"output_index":0,"content_index":0,"delta":"4","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":69,"output_index":0,"content_index":0,"delta":"0","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":70,"output_index":0,"content_index":0,"delta":"9","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":71,"output_index":0,"content_index":0,"delta":"6","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":72,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":73,"output_index":0,"content_index":0,"delta":"I","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":74,"output_index":0,"content_index":0,"delta":" + need","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":75,"output_index":0,"content_index":0,"delta":" + to","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":76,"output_index":0,"content_index":0,"delta":" + call","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":77,"output_index":0,"content_index":0,"delta":" + the","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":78,"output_index":0,"content_index":0,"delta":" + shell","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":79,"output_index":0,"content_index":0,"delta":" + function","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":80,"output_index":0,"content_index":0,"delta":" + with","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":81,"output_index":0,"content_index":0,"delta":" + these","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":82,"output_index":0,"content_index":0,"delta":" + exact","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":83,"output_index":0,"content_index":0,"delta":" + parameters","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":84,"output_index":0,"content_index":0,"delta":".","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":85,"output_index":0,"content_index":0,"delta":"\n","item_id":"b8d3e4f66be9a550"} + + ' + - ' + + ' + - 'event: response.reasoning_text.done + + ' + - 'data: {"type":"response.reasoning_text.done","sequence_number":86,"output_index":0,"content_index":0,"item_id":"b8d3e4f66be9a550","text":"The + user wants me to use the shell tool exactly once with a specific action. They''ve + provided the exact command structure I need to use. Let me execute this:\n\n- + commands: [\"printf ''SHELL_OK\\\\n''\"]\n- timeout_ms: 1000\n- max_output_length: + 4096\n\nI need to call the shell function with these exact parameters.\n"} + + ' + - ' + + ' + - 'event: response.reasoning_part.done + + ' + - 'data: {"type":"response.reasoning_part.done","sequence_number":87,"output_index":0,"content_index":0,"item_id":"b8d3e4f66be9a550","part":{"text":"The + user wants me to use the shell tool exactly once with a specific action. They''ve + provided the exact command structure I need to use. Let me execute this:\n\n- + commands: [\"printf ''SHELL_OK\\\\n''\"]\n- timeout_ms: 1000\n- max_output_length: + 4096\n\nI need to call the shell function with these exact parameters.\n","type":"reasoning_text"}} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":88,"output_index":0,"item":{"id":"b8d3e4f66be9a550","summary":[],"type":"reasoning","content":[{"text":"The + user wants me to use the shell tool exactly once with a specific action. They''ve + provided the exact command structure I need to use. Let me execute this:\n\n- + commands: [\"printf ''SHELL_OK\\\\n''\"]\n- timeout_ms: 1000\n- max_output_length: + 4096\n\nI need to call the shell function with these exact parameters.\n","type":"reasoning_text"}],"encrypted_content":null,"status":"completed"}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":89,"output_index":1,"item":{"type":"shell_call","id":"sh_dabe2750c3e9ff23","call_id":"call_bbbae3a0fe8e73a9","status":"in_progress","action":{"commands":[],"timeout_ms":null,"max_output_length":null}}} + + ' + - ' + + ' + - 'event: response.shell_call_command.added + + ' + - 'data: {"type":"response.shell_call_command.added","sequence_number":90,"output_index":1,"command_index":0,"command":""} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","sequence_number":91,"output_index":1,"command_index":0,"delta":"printf + ''SHELL_OK\\n''"} + + ' + - ' + + ' + - 'event: response.shell_call_command.done + + ' + - 'data: {"type":"response.shell_call_command.done","sequence_number":92,"output_index":1,"command_index":0,"command":"printf + ''SHELL_OK\\n''"} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":93,"output_index":1,"item":{"type":"shell_call","id":"sh_dabe2750c3e9ff23","call_id":"call_bbbae3a0fe8e73a9","action":{"commands":["printf + ''SHELL_OK\\n''"],"timeout_ms":1000,"max_output_length":4096},"status":"completed"}} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","sequence_number":94,"response":{"id":"resp_01a07fd9-d4a1-7330-b750-290afb5fdf0e","object":"response","created_at":1788851378,"model":"Qwen/Qwen3.5-35B-A3B-FP8","status":"completed","output":[{"type":"reasoning","id":"b8d3e4f66be9a550","content":[{"type":"reasoning_text","text":"The + user wants me to use the shell tool exactly once with a specific action. They''ve + provided the exact command structure I need to use. Let me execute this:\n\n- + commands: [\"printf ''SHELL_OK\\\\n''\"]\n- timeout_ms: 1000\n- max_output_length: + 4096\n\nI need to call the shell function with these exact parameters.\n"}],"summary":[],"encrypted_content":null,"status":"completed"},{"type":"shell_call","id":"sh_dabe2750c3e9ff23","call_id":"call_bbbae3a0fe8e73a9","action":{"commands":["printf + ''SHELL_OK\\n''"],"timeout_ms":1000,"max_output_length":4096},"status":"completed"}],"usage":{"input_tokens":485,"output_tokens":151,"total_tokens":636,"input_tokens_details":{"cached_tokens":0},"output_tokens_details":{"reasoning_tokens":0}},"incomplete_details":null,"error":null,"previous_response_id":null,"conversation_id":null,"instructions":null}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 +- filename: t2 + request: + body: + input: + - call_id: call_bbbae3a0fe8e73a9 + max_output_length: 4096 + output: + - outcome: + exit_code: 0 + type: exit + stderr: '' + stdout: 'SHELL_OK + + ' + type: shell_call_output + - content: Use the shell output above without calling any more tools. For each + command, report its stdout, stderr, and exit code or timeout outcome in + order. + role: user + type: message + max_output_tokens: 4096 + model: Qwen/Qwen3.5-35B-A3B-FP8 + previous_response_id: resp_01a07fd9-d4a1-7330-b750-290afb5fdf0e + store: true + stream: true + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + headers: + content-type: text/event-stream; charset=utf-8 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_01a07fd9-d8d1-7121-b9ba-0a331a6d94f0","created_at":1788851378,"incomplete_details":null,"instructions":null,"metadata":null,"model":"Qwen/Qwen3.5-35B-A3B-FP8","object":"response","output":[],"parallel_tool_calls":false,"temperature":1.0,"tool_choice":"auto","tools":[{"name":"shell","parameters":{"type":"object","properties":{"commands":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Commands + to execute in order."},"timeout_ms":{"type":"integer","minimum":0,"description":"Optional + timeout in milliseconds."},"max_output_length":{"type":"integer","minimum":0,"description":"Optional + maximum captured output length."}},"required":["commands"],"additionalProperties":false},"strict":false,"type":"function","allowed_callers":null,"defer_loading":null,"description":"Run + one or more commands in the caller-provided local shell environment. The caller + executes the commands and returns their outputs.","output_schema":null}],"top_p":0.95,"background":false,"max_output_tokens":4096,"max_tool_calls":null,"previous_response_id":"resp_01a07fd9-d4a1-7330-b750-290afb5fdf0e","prompt":null,"reasoning":null,"service_tier":"auto","status":"in_progress","text":null,"top_logprobs":null,"truncation":"disabled","usage":null,"user":null,"presence_penalty":0.0,"frequency_penalty":0.0,"kv_transfer_params":null,"ec_transfer_params":null,"input_messages":null,"output_messages":null}} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_01a07fd9-d8d1-7121-b9ba-0a331a6d94f0","created_at":1788851378,"incomplete_details":null,"instructions":null,"metadata":null,"model":"Qwen/Qwen3.5-35B-A3B-FP8","object":"response","output":[],"parallel_tool_calls":false,"temperature":1.0,"tool_choice":"auto","tools":[{"name":"shell","parameters":{"type":"object","properties":{"commands":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Commands + to execute in order."},"timeout_ms":{"type":"integer","minimum":0,"description":"Optional + timeout in milliseconds."},"max_output_length":{"type":"integer","minimum":0,"description":"Optional + maximum captured output length."}},"required":["commands"],"additionalProperties":false},"strict":false,"type":"function","allowed_callers":null,"defer_loading":null,"description":"Run + one or more commands in the caller-provided local shell environment. The caller + executes the commands and returns their outputs.","output_schema":null}],"top_p":0.95,"background":false,"max_output_tokens":4096,"max_tool_calls":null,"previous_response_id":"resp_01a07fd9-d4a1-7330-b750-290afb5fdf0e","prompt":null,"reasoning":null,"service_tier":"auto","status":"in_progress","text":null,"top_logprobs":null,"truncation":"disabled","usage":null,"user":null,"presence_penalty":0.0,"frequency_penalty":0.0,"kv_transfer_params":null,"ec_transfer_params":null,"input_messages":null,"output_messages":null}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"8e78183538ee7d93","summary":[],"type":"reasoning","content":null,"encrypted_content":null,"status":"in_progress"}} + + ' + - ' + + ' + - 'event: response.reasoning_part.added + + ' + - 'data: {"type":"response.reasoning_part.added","sequence_number":3,"output_index":0,"content_index":0,"item_id":"8e78183538ee7d93","part":{"text":"","type":"reasoning_text"}} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":4,"output_index":0,"content_index":0,"delta":"The","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":5,"output_index":0,"content_index":0,"delta":" + user","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":6,"output_index":0,"content_index":0,"delta":" + wants","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":7,"output_index":0,"content_index":0,"delta":" + me","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":8,"output_index":0,"content_index":0,"delta":" + to","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":9,"output_index":0,"content_index":0,"delta":" + report","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":10,"output_index":0,"content_index":0,"delta":" + the","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":11,"output_index":0,"content_index":0,"delta":" + shell","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":12,"output_index":0,"content_index":0,"delta":" + output","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":13,"output_index":0,"content_index":0,"delta":" + from","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":14,"output_index":0,"content_index":0,"delta":" + the","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":15,"output_index":0,"content_index":0,"delta":" + previous","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":16,"output_index":0,"content_index":0,"delta":" + tool","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":17,"output_index":0,"content_index":0,"delta":" + call","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":18,"output_index":0,"content_index":0,"delta":".","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":19,"output_index":0,"content_index":0,"delta":" + I","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":20,"output_index":0,"content_index":0,"delta":" + should","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":21,"output_index":0,"content_index":0,"delta":" + analyze","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":22,"output_index":0,"content_index":0,"delta":" + the","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":23,"output_index":0,"content_index":0,"delta":" + output","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":24,"output_index":0,"content_index":0,"delta":" + and","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":25,"output_index":0,"content_index":0,"delta":" + report","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":26,"output_index":0,"content_index":0,"delta":" + it","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":27,"output_index":0,"content_index":0,"delta":" + clearly","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":28,"output_index":0,"content_index":0,"delta":" + in","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":29,"output_index":0,"content_index":0,"delta":" + order","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":30,"output_index":0,"content_index":0,"delta":".","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":31,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":32,"output_index":0,"content_index":0,"delta":"From","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":33,"output_index":0,"content_index":0,"delta":" + the","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":34,"output_index":0,"content_index":0,"delta":" + shell","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":35,"output_index":0,"content_index":0,"delta":" + output","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":36,"output_index":0,"content_index":0,"delta":":","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":37,"output_index":0,"content_index":0,"delta":"\n","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":38,"output_index":0,"content_index":0,"delta":"-","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":39,"output_index":0,"content_index":0,"delta":" + stdout","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":40,"output_index":0,"content_index":0,"delta":":","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":41,"output_index":0,"content_index":0,"delta":" + \"","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":42,"output_index":0,"content_index":0,"delta":"S","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":43,"output_index":0,"content_index":0,"delta":"HELL","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":44,"output_index":0,"content_index":0,"delta":"_OK","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":45,"output_index":0,"content_index":0,"delta":"\\n","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":46,"output_index":0,"content_index":0,"delta":"\"","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":47,"output_index":0,"content_index":0,"delta":"\n","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":48,"output_index":0,"content_index":0,"delta":"-","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":49,"output_index":0,"content_index":0,"delta":" + stderr","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":50,"output_index":0,"content_index":0,"delta":":","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":51,"output_index":0,"content_index":0,"delta":" + \"\"","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":52,"output_index":0,"content_index":0,"delta":" + (","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":53,"output_index":0,"content_index":0,"delta":"empty","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":54,"output_index":0,"content_index":0,"delta":")","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":55,"output_index":0,"content_index":0,"delta":"\n","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":56,"output_index":0,"content_index":0,"delta":"-","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":57,"output_index":0,"content_index":0,"delta":" + outcome","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":58,"output_index":0,"content_index":0,"delta":":","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":59,"output_index":0,"content_index":0,"delta":" + {\"","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":60,"output_index":0,"content_index":0,"delta":"type","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":61,"output_index":0,"content_index":0,"delta":"\":\"","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":62,"output_index":0,"content_index":0,"delta":"exit","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":63,"output_index":0,"content_index":0,"delta":"\",\"","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":64,"output_index":0,"content_index":0,"delta":"exit","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":65,"output_index":0,"content_index":0,"delta":"_code","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":66,"output_index":0,"content_index":0,"delta":"\":","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":67,"output_index":0,"content_index":0,"delta":"0","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":68,"output_index":0,"content_index":0,"delta":"}","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":69,"output_index":0,"content_index":0,"delta":" + (","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":70,"output_index":0,"content_index":0,"delta":"exit","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":71,"output_index":0,"content_index":0,"delta":" + type","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":72,"output_index":0,"content_index":0,"delta":" + with","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":73,"output_index":0,"content_index":0,"delta":" + exit","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":74,"output_index":0,"content_index":0,"delta":" + code","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":75,"output_index":0,"content_index":0,"delta":" + ","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":76,"output_index":0,"content_index":0,"delta":"0","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":77,"output_index":0,"content_index":0,"delta":")","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":78,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":79,"output_index":0,"content_index":0,"delta":"I","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":80,"output_index":0,"content_index":0,"delta":" + need","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":81,"output_index":0,"content_index":0,"delta":" + to","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":82,"output_index":0,"content_index":0,"delta":" + report","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":83,"output_index":0,"content_index":0,"delta":" + this","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":84,"output_index":0,"content_index":0,"delta":" + information","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":85,"output_index":0,"content_index":0,"delta":" + for","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":86,"output_index":0,"content_index":0,"delta":" + each","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":87,"output_index":0,"content_index":0,"delta":" + command","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":88,"output_index":0,"content_index":0,"delta":" + (","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":89,"output_index":0,"content_index":0,"delta":"there","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":90,"output_index":0,"content_index":0,"delta":"''s","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":91,"output_index":0,"content_index":0,"delta":" + only","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":92,"output_index":0,"content_index":0,"delta":" + one","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":93,"output_index":0,"content_index":0,"delta":" + command","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":94,"output_index":0,"content_index":0,"delta":" + in","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":95,"output_index":0,"content_index":0,"delta":" + this","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":96,"output_index":0,"content_index":0,"delta":" + case","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":97,"output_index":0,"content_index":0,"delta":").","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":98,"output_index":0,"content_index":0,"delta":"\n","item_id":"8e78183538ee7d93"} + + ' + - ' + + ' + - 'event: response.reasoning_text.done + + ' + - 'data: {"type":"response.reasoning_text.done","sequence_number":99,"output_index":0,"content_index":0,"item_id":"8e78183538ee7d93","text":"The + user wants me to report the shell output from the previous tool call. I should + analyze the output and report it clearly in order.\n\nFrom the shell output:\n- + stdout: \"SHELL_OK\\n\"\n- stderr: \"\" (empty)\n- outcome: {\"type\":\"exit\",\"exit_code\":0} + (exit type with exit code 0)\n\nI need to report this information for each command + (there''s only one command in this case).\n"} + + ' + - ' + + ' + - 'event: response.reasoning_part.done + + ' + - 'data: {"type":"response.reasoning_part.done","sequence_number":100,"output_index":0,"content_index":0,"item_id":"8e78183538ee7d93","part":{"text":"The + user wants me to report the shell output from the previous tool call. I should + analyze the output and report it clearly in order.\n\nFrom the shell output:\n- + stdout: \"SHELL_OK\\n\"\n- stderr: \"\" (empty)\n- outcome: {\"type\":\"exit\",\"exit_code\":0} + (exit type with exit code 0)\n\nI need to report this information for each command + (there''s only one command in this case).\n","type":"reasoning_text"}} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":101,"output_index":0,"item":{"id":"8e78183538ee7d93","summary":[],"type":"reasoning","content":[{"text":"The + user wants me to report the shell output from the previous tool call. I should + analyze the output and report it clearly in order.\n\nFrom the shell output:\n- + stdout: \"SHELL_OK\\n\"\n- stderr: \"\" (empty)\n- outcome: {\"type\":\"exit\",\"exit_code\":0} + (exit type with exit code 0)\n\nI need to report this information for each command + (there''s only one command in this case).\n","type":"reasoning_text"}],"encrypted_content":null,"status":"completed"}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":102,"output_index":1,"item":{"id":"ac2057e7d8abbac1","content":[],"role":"assistant","status":"in_progress","type":"message","phase":null}} + + ' + - ' + + ' + - 'event: response.content_part.added + + ' + - 'data: {"type":"response.content_part.added","sequence_number":103,"output_index":1,"content_index":0,"item_id":"ac2057e7d8abbac1","part":{"annotations":[],"text":"","type":"output_text","logprobs":[]}} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":104,"output_index":1,"content_index":0,"delta":"\n\nBased","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":105,"output_index":1,"content_index":0,"delta":" + on","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":106,"output_index":1,"content_index":0,"delta":" + the","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":107,"output_index":1,"content_index":0,"delta":" + shell","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":108,"output_index":1,"content_index":0,"delta":" + output","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":109,"output_index":1,"content_index":0,"delta":":","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":110,"output_index":1,"content_index":0,"delta":"\n\n","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":111,"output_index":1,"content_index":0,"delta":"**","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":112,"output_index":1,"content_index":0,"delta":"Command","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":113,"output_index":1,"content_index":0,"delta":" + ","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":114,"output_index":1,"content_index":0,"delta":"1","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":115,"output_index":1,"content_index":0,"delta":":**","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":116,"output_index":1,"content_index":0,"delta":" + `","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":117,"output_index":1,"content_index":0,"delta":"printf","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":118,"output_index":1,"content_index":0,"delta":" + ''","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":119,"output_index":1,"content_index":0,"delta":"S","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":120,"output_index":1,"content_index":0,"delta":"HELL","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":121,"output_index":1,"content_index":0,"delta":"_OK","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":122,"output_index":1,"content_index":0,"delta":"\\\\","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":123,"output_index":1,"content_index":0,"delta":"n","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":124,"output_index":1,"content_index":0,"delta":"''","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":125,"output_index":1,"content_index":0,"delta":"`","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":126,"output_index":1,"content_index":0,"delta":"\n","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":127,"output_index":1,"content_index":0,"delta":"-","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":128,"output_index":1,"content_index":0,"delta":" + **","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":129,"output_index":1,"content_index":0,"delta":"stdout","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":130,"output_index":1,"content_index":0,"delta":":**","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":131,"output_index":1,"content_index":0,"delta":" + `","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":132,"output_index":1,"content_index":0,"delta":"S","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":133,"output_index":1,"content_index":0,"delta":"HELL","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":134,"output_index":1,"content_index":0,"delta":"_OK","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":135,"output_index":1,"content_index":0,"delta":"`","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":136,"output_index":1,"content_index":0,"delta":"\n","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":137,"output_index":1,"content_index":0,"delta":"-","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":138,"output_index":1,"content_index":0,"delta":" + **","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":139,"output_index":1,"content_index":0,"delta":"stderr","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":140,"output_index":1,"content_index":0,"delta":":**","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":141,"output_index":1,"content_index":0,"delta":" + (","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":142,"output_index":1,"content_index":0,"delta":"empty","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":143,"output_index":1,"content_index":0,"delta":")","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":144,"output_index":1,"content_index":0,"delta":"\n","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":145,"output_index":1,"content_index":0,"delta":"-","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":146,"output_index":1,"content_index":0,"delta":" + **","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":147,"output_index":1,"content_index":0,"delta":"outcome","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":148,"output_index":1,"content_index":0,"delta":":**","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":149,"output_index":1,"content_index":0,"delta":" + exit","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":150,"output_index":1,"content_index":0,"delta":" + with","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":151,"output_index":1,"content_index":0,"delta":" + code","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":152,"output_index":1,"content_index":0,"delta":" + ","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":153,"output_index":1,"content_index":0,"delta":"0","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":154,"output_index":1,"content_index":0,"delta":"\n\n","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":155,"output_index":1,"content_index":0,"delta":"The","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":156,"output_index":1,"content_index":0,"delta":" + command","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":157,"output_index":1,"content_index":0,"delta":" + executed","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":158,"output_index":1,"content_index":0,"delta":" + successfully","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":159,"output_index":1,"content_index":0,"delta":",","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":160,"output_index":1,"content_index":0,"delta":" + printing","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":161,"output_index":1,"content_index":0,"delta":" + \"","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":162,"output_index":1,"content_index":0,"delta":"S","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":163,"output_index":1,"content_index":0,"delta":"HELL","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":164,"output_index":1,"content_index":0,"delta":"_OK","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":165,"output_index":1,"content_index":0,"delta":"\"","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":166,"output_index":1,"content_index":0,"delta":" + to","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":167,"output_index":1,"content_index":0,"delta":" + standard","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":168,"output_index":1,"content_index":0,"delta":" + output","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":169,"output_index":1,"content_index":0,"delta":" + with","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":170,"output_index":1,"content_index":0,"delta":" + no","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":171,"output_index":1,"content_index":0,"delta":" + errors","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":172,"output_index":1,"content_index":0,"delta":" + and","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":173,"output_index":1,"content_index":0,"delta":" + an","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":174,"output_index":1,"content_index":0,"delta":" + exit","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":175,"output_index":1,"content_index":0,"delta":" + code","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":176,"output_index":1,"content_index":0,"delta":" + of","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":177,"output_index":1,"content_index":0,"delta":" + ","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":178,"output_index":1,"content_index":0,"delta":"0","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":179,"output_index":1,"content_index":0,"delta":".","item_id":"ac2057e7d8abbac1","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.done + + ' + - 'data: {"type":"response.output_text.done","sequence_number":180,"output_index":1,"content_index":0,"item_id":"ac2057e7d8abbac1","logprobs":[],"text":"\n\nBased + on the shell output:\n\n**Command 1:** `printf ''SHELL_OK\\\\n''`\n- **stdout:** + `SHELL_OK`\n- **stderr:** (empty)\n- **outcome:** exit with code 0\n\nThe command + executed successfully, printing \"SHELL_OK\" to standard output with no errors + and an exit code of 0."} + + ' + - ' + + ' + - 'event: response.content_part.done + + ' + - 'data: {"type":"response.content_part.done","sequence_number":181,"output_index":1,"content_index":0,"item_id":"ac2057e7d8abbac1","part":{"annotations":[],"text":"\n\nBased + on the shell output:\n\n**Command 1:** `printf ''SHELL_OK\\\\n''`\n- **stdout:** + `SHELL_OK`\n- **stderr:** (empty)\n- **outcome:** exit with code 0\n\nThe command + executed successfully, printing \"SHELL_OK\" to standard output with no errors + and an exit code of 0.","type":"output_text","logprobs":null}} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":182,"output_index":1,"item":{"id":"ac2057e7d8abbac1","content":[{"annotations":[],"text":"\n\nBased + on the shell output:\n\n**Command 1:** `printf ''SHELL_OK\\\\n''`\n- **stdout:** + `SHELL_OK`\n- **stderr:** (empty)\n- **outcome:** exit with code 0\n\nThe command + executed successfully, printing \"SHELL_OK\" to standard output with no errors + and an exit code of 0.","type":"output_text","logprobs":null}],"role":"assistant","status":"completed","type":"message","phase":null,"summary":[]}} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","sequence_number":183,"response":{"id":"resp_01a07fd9-d8d1-7121-b9ba-0a331a6d94f0","object":"response","created_at":1788851379,"model":"Qwen/Qwen3.5-35B-A3B-FP8","status":"completed","output":[{"type":"reasoning","id":"8e78183538ee7d93","content":[{"type":"reasoning_text","text":"The + user wants me to report the shell output from the previous tool call. I should + analyze the output and report it clearly in order.\n\nFrom the shell output:\n- + stdout: \"SHELL_OK\\n\"\n- stderr: \"\" (empty)\n- outcome: {\"type\":\"exit\",\"exit_code\":0} + (exit type with exit code 0)\n\nI need to report this information for each command + (there''s only one command in this case).\n"}],"summary":[],"encrypted_content":null,"status":"completed"},{"type":"message","id":"ac2057e7d8abbac1","role":"assistant","status":"completed","content":[{"type":"output_text","text":"\n\nBased + on the shell output:\n\n**Command 1:** `printf ''SHELL_OK\\\\n''`\n- **stdout:** + `SHELL_OK`\n- **stderr:** (empty)\n- **outcome:** exit with code 0\n\nThe command + executed successfully, printing \"SHELL_OK\" to standard output with no errors + and an exit code of 0.","annotations":[]}]}],"usage":{"input_tokens":623,"output_tokens":174,"total_tokens":797,"input_tokens_details":{"cached_tokens":0},"output_tokens_details":{"reasoning_tokens":0}},"incomplete_details":null,"error":null,"previous_response_id":"resp_01a07fd9-d4a1-7330-b750-290afb5fdf0e","conversation_id":null,"instructions":null}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 diff --git a/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-timeout-Qwen-Qwen3.5-35B-A3B-FP8-nonstreaming.yaml b/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-timeout-Qwen-Qwen3.5-35B-A3B-FP8-nonstreaming.yaml new file mode 100644 index 00000000..8de7782d --- /dev/null +++ b/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-timeout-Qwen-Qwen3.5-35B-A3B-FP8-nonstreaming.yaml @@ -0,0 +1,193 @@ +turns: +- filename: t1 + request: + body: + input: 'The local shell environment is Linux bash. Use the shell tool exactly + once with this exact action, preserving the commands array and its order: + {"commands": ["sleep 2"], "timeout_ms": 1000, "max_output_length": 4096}. + Keep semicolon-separated statements in the same command string. Wait for the + client to return shell_call_output before interpreting the results.' + max_output_tokens: 4096 + model: Qwen/Qwen3.5-35B-A3B-FP8 + store: true + stream: false + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + body: + conversation_id: null + created_at: 1788851397 + error: null + id: resp_01a07fda-1faf-70e1-8453-7a853ab296fc + incomplete_details: null + instructions: null + model: Qwen/Qwen3.5-35B-A3B-FP8 + object: response + output: + - content: + - text: 'The user wants me to use the shell tool exactly once with a specific + command. They''ve given me precise instructions: + + 1. Use the shell tool with "sleep 2" command + + 2. Set timeout_ms to 1000 + + 3. Set max_output_length to 4096 + + 4. Keep semicolon-separated statements in the same command string (though + there''s only one command here) + + 5. Wait for the client to return shell_call_output before interpreting + results + + + I need to make the function call with these exact parameters. + + ' + type: reasoning_text + encrypted_content: null + id: rs_a927fc2c744809bd + status: null + summary: [] + type: reasoning + - action: + commands: + - sleep 2 + max_output_length: 4096 + timeout_ms: 1000 + call_id: chatcmpl-tool-85a453f43d4e506f + id: sh_9ce59cda34d58b60 + status: completed + type: shell_call + previous_response_id: null + status: completed + usage: + input_tokens: 480 + input_tokens_details: + cached_tokens: 0 + output_tokens: 177 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 657 + headers: + content-type: application/json + status_code: 200 +- filename: t2 + request: + body: + input: + - call_id: chatcmpl-tool-85a453f43d4e506f + max_output_length: 4096 + output: + - outcome: + type: timeout + stderr: '' + stdout: '' + type: shell_call_output + - content: Use the shell output above without calling any more tools. For each + command, report its stdout, stderr, and exit code or timeout outcome in + order. + role: user + type: message + max_output_tokens: 4096 + model: Qwen/Qwen3.5-35B-A3B-FP8 + previous_response_id: resp_01a07fda-1faf-70e1-8453-7a853ab296fc + store: true + stream: false + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + body: + conversation_id: null + created_at: 1788851399 + error: null + id: resp_01a07fda-245b-79c0-b629-2efb5a884417 + incomplete_details: null + instructions: null + model: Qwen/Qwen3.5-35B-A3B-FP8 + object: response + output: + - content: + - text: 'The shell tool output shows that the command "sleep 2" timed out + because the timeout_ms was set to 1000 milliseconds (1 second), but the + sleep command was instructed to sleep for 2 seconds. + + + Let me report the output for this command: + + - stdout: "" (empty string) + + - stderr: "" (empty string) + + - outcome: timeout (type: "timeout") + + + Since this is a timeout, there won''t be a traditional exit code - the + timeout outcome indicates the command was terminated before completion. + + ' + type: reasoning_text + encrypted_content: null + id: rs_af255b5ecad811d2 + status: null + summary: [] + type: reasoning + - content: + - annotations: [] + text: ' + + + Based on the shell output provided: + + + **Command 1: `sleep 2`** + + - **stdout:** (empty) + + - **stderr:** (empty) + + - **Exit code/outcome:** **Timeout** (exceeded the 1000ms timeout limit) + + + The command timed out because it was instructed to sleep for 2 seconds, + but the timeout was set to only 1000ms (1 second). Since the timeout occurred + before the sleep could complete, no output was produced and the command + was terminated with a timeout outcome.' + type: output_text + id: msg_b192d821c53bef62 + role: assistant + status: completed + type: message + previous_response_id: resp_01a07fda-1faf-70e1-8453-7a853ab296fc + status: completed + usage: + input_tokens: 603 + input_tokens_details: + cached_tokens: 0 + output_tokens: 231 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 834 + headers: + content-type: application/json + status_code: 200 diff --git a/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-timeout-Qwen-Qwen3.5-35B-A3B-FP8-streaming.yaml b/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-timeout-Qwen-Qwen3.5-35B-A3B-FP8-streaming.yaml new file mode 100644 index 00000000..3e188d1b --- /dev/null +++ b/crates/agentic-server-core/tests/cassettes/shell/shell-gateway-timeout-Qwen-Qwen3.5-35B-A3B-FP8-streaming.yaml @@ -0,0 +1,3313 @@ +turns: +- filename: t1 + request: + body: + input: 'The local shell environment is Linux bash. Use the shell tool exactly + once with this exact action, preserving the commands array and its order: + {"commands": ["sleep 2"], "timeout_ms": 1000, "max_output_length": 4096}. + Keep semicolon-separated statements in the same command string. Wait for the + client to return shell_call_output before interpreting the results.' + max_output_tokens: 4096 + model: Qwen/Qwen3.5-35B-A3B-FP8 + store: true + stream: true + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + headers: + content-type: text/event-stream; charset=utf-8 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_01a07fda-0f70-7620-87d6-04115cb1d516","created_at":1788851392,"incomplete_details":null,"instructions":null,"metadata":null,"model":"Qwen/Qwen3.5-35B-A3B-FP8","object":"response","output":[],"parallel_tool_calls":false,"temperature":1.0,"tool_choice":"auto","tools":[{"name":"shell","parameters":{"type":"object","properties":{"commands":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Commands + to execute in order."},"timeout_ms":{"type":"integer","minimum":0,"description":"Optional + timeout in milliseconds."},"max_output_length":{"type":"integer","minimum":0,"description":"Optional + maximum captured output length."}},"required":["commands"],"additionalProperties":false},"strict":false,"type":"function","allowed_callers":null,"defer_loading":null,"description":"Run + one or more commands in the caller-provided local shell environment. The caller + executes the commands and returns their outputs.","output_schema":null}],"top_p":0.95,"background":false,"max_output_tokens":4096,"max_tool_calls":null,"previous_response_id":null,"prompt":null,"reasoning":null,"service_tier":"auto","status":"in_progress","text":null,"top_logprobs":null,"truncation":"disabled","usage":null,"user":null,"presence_penalty":0.0,"frequency_penalty":0.0,"kv_transfer_params":null,"ec_transfer_params":null,"input_messages":null,"output_messages":null}} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_01a07fda-0f70-7620-87d6-04115cb1d516","created_at":1788851392,"incomplete_details":null,"instructions":null,"metadata":null,"model":"Qwen/Qwen3.5-35B-A3B-FP8","object":"response","output":[],"parallel_tool_calls":false,"temperature":1.0,"tool_choice":"auto","tools":[{"name":"shell","parameters":{"type":"object","properties":{"commands":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Commands + to execute in order."},"timeout_ms":{"type":"integer","minimum":0,"description":"Optional + timeout in milliseconds."},"max_output_length":{"type":"integer","minimum":0,"description":"Optional + maximum captured output length."}},"required":["commands"],"additionalProperties":false},"strict":false,"type":"function","allowed_callers":null,"defer_loading":null,"description":"Run + one or more commands in the caller-provided local shell environment. The caller + executes the commands and returns their outputs.","output_schema":null}],"top_p":0.95,"background":false,"max_output_tokens":4096,"max_tool_calls":null,"previous_response_id":null,"prompt":null,"reasoning":null,"service_tier":"auto","status":"in_progress","text":null,"top_logprobs":null,"truncation":"disabled","usage":null,"user":null,"presence_penalty":0.0,"frequency_penalty":0.0,"kv_transfer_params":null,"ec_transfer_params":null,"input_messages":null,"output_messages":null}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"ae71796594e709a4","summary":[],"type":"reasoning","content":null,"encrypted_content":null,"status":"in_progress"}} + + ' + - ' + + ' + - 'event: response.reasoning_part.added + + ' + - 'data: {"type":"response.reasoning_part.added","sequence_number":3,"output_index":0,"content_index":0,"item_id":"ae71796594e709a4","part":{"text":"","type":"reasoning_text"}} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":4,"output_index":0,"content_index":0,"delta":"The","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":5,"output_index":0,"content_index":0,"delta":" + user","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":6,"output_index":0,"content_index":0,"delta":" + is","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":7,"output_index":0,"content_index":0,"delta":" + asking","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":8,"output_index":0,"content_index":0,"delta":" + me","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":9,"output_index":0,"content_index":0,"delta":" + to","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":10,"output_index":0,"content_index":0,"delta":" + use","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":11,"output_index":0,"content_index":0,"delta":" + the","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":12,"output_index":0,"content_index":0,"delta":" + shell","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":13,"output_index":0,"content_index":0,"delta":" + tool","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":14,"output_index":0,"content_index":0,"delta":" + exactly","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":15,"output_index":0,"content_index":0,"delta":" + once","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":16,"output_index":0,"content_index":0,"delta":" + with","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":17,"output_index":0,"content_index":0,"delta":" + specific","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":18,"output_index":0,"content_index":0,"delta":" + parameters","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":19,"output_index":0,"content_index":0,"delta":".","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":20,"output_index":0,"content_index":0,"delta":" + They","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":21,"output_index":0,"content_index":0,"delta":" + want","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":22,"output_index":0,"content_index":0,"delta":" + me","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":23,"output_index":0,"content_index":0,"delta":" + to","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":24,"output_index":0,"content_index":0,"delta":" + run","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":25,"output_index":0,"content_index":0,"delta":" + \"","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":26,"output_index":0,"content_index":0,"delta":"sleep","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":27,"output_index":0,"content_index":0,"delta":" + ","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":28,"output_index":0,"content_index":0,"delta":"2","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":29,"output_index":0,"content_index":0,"delta":"\"","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":30,"output_index":0,"content_index":0,"delta":" + command","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":31,"output_index":0,"content_index":0,"delta":" + with","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":32,"output_index":0,"content_index":0,"delta":" + a","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":33,"output_index":0,"content_index":0,"delta":" + timeout","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":34,"output_index":0,"content_index":0,"delta":" + of","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":35,"output_index":0,"content_index":0,"delta":" + ","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":36,"output_index":0,"content_index":0,"delta":"1","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":37,"output_index":0,"content_index":0,"delta":"0","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":38,"output_index":0,"content_index":0,"delta":"0","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":39,"output_index":0,"content_index":0,"delta":"0","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":40,"output_index":0,"content_index":0,"delta":"ms","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":41,"output_index":0,"content_index":0,"delta":" + and","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":42,"output_index":0,"content_index":0,"delta":" + max","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":43,"output_index":0,"content_index":0,"delta":" + output","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":44,"output_index":0,"content_index":0,"delta":" + length","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":45,"output_index":0,"content_index":0,"delta":" + of","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":46,"output_index":0,"content_index":0,"delta":" + ","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":47,"output_index":0,"content_index":0,"delta":"4","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":48,"output_index":0,"content_index":0,"delta":"0","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":49,"output_index":0,"content_index":0,"delta":"9","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":50,"output_index":0,"content_index":0,"delta":"6","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":51,"output_index":0,"content_index":0,"delta":".","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":52,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":53,"output_index":0,"content_index":0,"delta":"I","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":54,"output_index":0,"content_index":0,"delta":" + need","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":55,"output_index":0,"content_index":0,"delta":" + to","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":56,"output_index":0,"content_index":0,"delta":" + call","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":57,"output_index":0,"content_index":0,"delta":" + the","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":58,"output_index":0,"content_index":0,"delta":" + shell","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":59,"output_index":0,"content_index":0,"delta":" + function","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":60,"output_index":0,"content_index":0,"delta":" + with","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":61,"output_index":0,"content_index":0,"delta":" + these","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":62,"output_index":0,"content_index":0,"delta":" + exact","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":63,"output_index":0,"content_index":0,"delta":" + parameters","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":64,"output_index":0,"content_index":0,"delta":" + as","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":65,"output_index":0,"content_index":0,"delta":" + specified","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":66,"output_index":0,"content_index":0,"delta":".","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":67,"output_index":0,"content_index":0,"delta":" + Let","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":68,"output_index":0,"content_index":0,"delta":" + me","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":69,"output_index":0,"content_index":0,"delta":" + construct","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":70,"output_index":0,"content_index":0,"delta":" + the","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":71,"output_index":0,"content_index":0,"delta":" + function","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":72,"output_index":0,"content_index":0,"delta":" + call","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":73,"output_index":0,"content_index":0,"delta":" + properly","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":74,"output_index":0,"content_index":0,"delta":".","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":75,"output_index":0,"content_index":0,"delta":"\n","item_id":"ae71796594e709a4"} + + ' + - ' + + ' + - 'event: response.reasoning_text.done + + ' + - 'data: {"type":"response.reasoning_text.done","sequence_number":76,"output_index":0,"content_index":0,"item_id":"ae71796594e709a4","text":"The + user is asking me to use the shell tool exactly once with specific parameters. + They want me to run \"sleep 2\" command with a timeout of 1000ms and max output + length of 4096.\n\nI need to call the shell function with these exact parameters + as specified. Let me construct the function call properly.\n"} + + ' + - ' + + ' + - 'event: response.reasoning_part.done + + ' + - 'data: {"type":"response.reasoning_part.done","sequence_number":77,"output_index":0,"content_index":0,"item_id":"ae71796594e709a4","part":{"text":"The + user is asking me to use the shell tool exactly once with specific parameters. + They want me to run \"sleep 2\" command with a timeout of 1000ms and max output + length of 4096.\n\nI need to call the shell function with these exact parameters + as specified. Let me construct the function call properly.\n","type":"reasoning_text"}} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":78,"output_index":0,"item":{"id":"ae71796594e709a4","summary":[],"type":"reasoning","content":[{"text":"The + user is asking me to use the shell tool exactly once with specific parameters. + They want me to run \"sleep 2\" command with a timeout of 1000ms and max output + length of 4096.\n\nI need to call the shell function with these exact parameters + as specified. Let me construct the function call properly.\n","type":"reasoning_text"}],"encrypted_content":null,"status":"completed"}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":79,"output_index":1,"item":{"type":"shell_call","id":"sh_90791fa9118e5bee","call_id":"call_bde909f81aa2f107","status":"in_progress","action":{"commands":[],"timeout_ms":null,"max_output_length":null}}} + + ' + - ' + + ' + - 'event: response.shell_call_command.added + + ' + - 'data: {"type":"response.shell_call_command.added","sequence_number":80,"output_index":1,"command_index":0,"command":""} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","sequence_number":81,"output_index":1,"command_index":0,"delta":"sleep + 2"} + + ' + - ' + + ' + - 'event: response.shell_call_command.done + + ' + - 'data: {"type":"response.shell_call_command.done","sequence_number":82,"output_index":1,"command_index":0,"command":"sleep + 2"} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":83,"output_index":1,"item":{"type":"shell_call","id":"sh_90791fa9118e5bee","call_id":"call_bde909f81aa2f107","action":{"commands":["sleep + 2"],"timeout_ms":1000,"max_output_length":4096},"status":"completed"}} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","sequence_number":84,"response":{"id":"resp_01a07fda-0f70-7620-87d6-04115cb1d516","object":"response","created_at":1788851393,"model":"Qwen/Qwen3.5-35B-A3B-FP8","status":"completed","output":[{"type":"reasoning","id":"ae71796594e709a4","content":[{"type":"reasoning_text","text":"The + user is asking me to use the shell tool exactly once with specific parameters. + They want me to run \"sleep 2\" command with a timeout of 1000ms and max output + length of 4096.\n\nI need to call the shell function with these exact parameters + as specified. Let me construct the function call properly.\n"}],"summary":[],"encrypted_content":null,"status":"completed"},{"type":"shell_call","id":"sh_90791fa9118e5bee","call_id":"call_bde909f81aa2f107","action":{"commands":["sleep + 2"],"timeout_ms":1000,"max_output_length":4096},"status":"completed"}],"usage":{"input_tokens":480,"output_tokens":136,"total_tokens":616,"input_tokens_details":{"cached_tokens":0},"output_tokens_details":{"reasoning_tokens":0}},"incomplete_details":null,"error":null,"previous_response_id":null,"conversation_id":null,"instructions":null}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 +- filename: t2 + request: + body: + input: + - call_id: call_bde909f81aa2f107 + max_output_length: 4096 + output: + - outcome: + type: timeout + stderr: '' + stdout: '' + type: shell_call_output + - content: Use the shell output above without calling any more tools. For each + command, report its stdout, stderr, and exit code or timeout outcome in + order. + role: user + type: message + max_output_tokens: 4096 + model: Qwen/Qwen3.5-35B-A3B-FP8 + previous_response_id: resp_01a07fda-0f70-7620-87d6-04115cb1d516 + store: true + stream: true + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + headers: + content-type: text/event-stream; charset=utf-8 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_01a07fda-1337-7d43-80da-85f050936b91","created_at":1788851393,"incomplete_details":null,"instructions":null,"metadata":null,"model":"Qwen/Qwen3.5-35B-A3B-FP8","object":"response","output":[],"parallel_tool_calls":false,"temperature":1.0,"tool_choice":"auto","tools":[{"name":"shell","parameters":{"type":"object","properties":{"commands":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Commands + to execute in order."},"timeout_ms":{"type":"integer","minimum":0,"description":"Optional + timeout in milliseconds."},"max_output_length":{"type":"integer","minimum":0,"description":"Optional + maximum captured output length."}},"required":["commands"],"additionalProperties":false},"strict":false,"type":"function","allowed_callers":null,"defer_loading":null,"description":"Run + one or more commands in the caller-provided local shell environment. The caller + executes the commands and returns their outputs.","output_schema":null}],"top_p":0.95,"background":false,"max_output_tokens":4096,"max_tool_calls":null,"previous_response_id":"resp_01a07fda-0f70-7620-87d6-04115cb1d516","prompt":null,"reasoning":null,"service_tier":"auto","status":"in_progress","text":null,"top_logprobs":null,"truncation":"disabled","usage":null,"user":null,"presence_penalty":0.0,"frequency_penalty":0.0,"kv_transfer_params":null,"ec_transfer_params":null,"input_messages":null,"output_messages":null}} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","sequence_number":1,"response":{"id":"resp_01a07fda-1337-7d43-80da-85f050936b91","created_at":1788851393,"incomplete_details":null,"instructions":null,"metadata":null,"model":"Qwen/Qwen3.5-35B-A3B-FP8","object":"response","output":[],"parallel_tool_calls":false,"temperature":1.0,"tool_choice":"auto","tools":[{"name":"shell","parameters":{"type":"object","properties":{"commands":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Commands + to execute in order."},"timeout_ms":{"type":"integer","minimum":0,"description":"Optional + timeout in milliseconds."},"max_output_length":{"type":"integer","minimum":0,"description":"Optional + maximum captured output length."}},"required":["commands"],"additionalProperties":false},"strict":false,"type":"function","allowed_callers":null,"defer_loading":null,"description":"Run + one or more commands in the caller-provided local shell environment. The caller + executes the commands and returns their outputs.","output_schema":null}],"top_p":0.95,"background":false,"max_output_tokens":4096,"max_tool_calls":null,"previous_response_id":"resp_01a07fda-0f70-7620-87d6-04115cb1d516","prompt":null,"reasoning":null,"service_tier":"auto","status":"in_progress","text":null,"top_logprobs":null,"truncation":"disabled","usage":null,"user":null,"presence_penalty":0.0,"frequency_penalty":0.0,"kv_transfer_params":null,"ec_transfer_params":null,"input_messages":null,"output_messages":null}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":2,"output_index":0,"item":{"id":"a90d3c0a1b806346","summary":[],"type":"reasoning","content":null,"encrypted_content":null,"status":"in_progress"}} + + ' + - ' + + ' + - 'event: response.reasoning_part.added + + ' + - 'data: {"type":"response.reasoning_part.added","sequence_number":3,"output_index":0,"content_index":0,"item_id":"a90d3c0a1b806346","part":{"text":"","type":"reasoning_text"}} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":4,"output_index":0,"content_index":0,"delta":"The","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":5,"output_index":0,"content_index":0,"delta":" + shell","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":6,"output_index":0,"content_index":0,"delta":" + tool","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":7,"output_index":0,"content_index":0,"delta":" + output","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":8,"output_index":0,"content_index":0,"delta":" + shows","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":9,"output_index":0,"content_index":0,"delta":" + that","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":10,"output_index":0,"content_index":0,"delta":" + the","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":11,"output_index":0,"content_index":0,"delta":" + command","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":12,"output_index":0,"content_index":0,"delta":" + \"","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":13,"output_index":0,"content_index":0,"delta":"sleep","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":14,"output_index":0,"content_index":0,"delta":" + ","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":15,"output_index":0,"content_index":0,"delta":"2","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":16,"output_index":0,"content_index":0,"delta":"\"","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":17,"output_index":0,"content_index":0,"delta":" + resulted","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":18,"output_index":0,"content_index":0,"delta":" + in","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":19,"output_index":0,"content_index":0,"delta":" + a","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":20,"output_index":0,"content_index":0,"delta":" + timeout","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":21,"output_index":0,"content_index":0,"delta":" + outcome","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":22,"output_index":0,"content_index":0,"delta":".","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":23,"output_index":0,"content_index":0,"delta":" + Let","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":24,"output_index":0,"content_index":0,"delta":" + me","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":25,"output_index":0,"content_index":0,"delta":" + report","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":26,"output_index":0,"content_index":0,"delta":" + this","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":27,"output_index":0,"content_index":0,"delta":" + information","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":28,"output_index":0,"content_index":0,"delta":":","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":29,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":30,"output_index":0,"content_index":0,"delta":"1","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":31,"output_index":0,"content_index":0,"delta":".","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":32,"output_index":0,"content_index":0,"delta":" + The","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":33,"output_index":0,"content_index":0,"delta":" + command","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":34,"output_index":0,"content_index":0,"delta":" + was","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":35,"output_index":0,"content_index":0,"delta":" + \"","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":36,"output_index":0,"content_index":0,"delta":"sleep","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":37,"output_index":0,"content_index":0,"delta":" + ","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":38,"output_index":0,"content_index":0,"delta":"2","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":39,"output_index":0,"content_index":0,"delta":"\"","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":40,"output_index":0,"content_index":0,"delta":"\n","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":41,"output_index":0,"content_index":0,"delta":"2","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":42,"output_index":0,"content_index":0,"delta":".","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":43,"output_index":0,"content_index":0,"delta":" + stdout","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":44,"output_index":0,"content_index":0,"delta":":","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":45,"output_index":0,"content_index":0,"delta":" + \"\"","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":46,"output_index":0,"content_index":0,"delta":" + (","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":47,"output_index":0,"content_index":0,"delta":"empty","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":48,"output_index":0,"content_index":0,"delta":")","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":49,"output_index":0,"content_index":0,"delta":"\n","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":50,"output_index":0,"content_index":0,"delta":"3","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":51,"output_index":0,"content_index":0,"delta":".","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":52,"output_index":0,"content_index":0,"delta":" + stderr","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":53,"output_index":0,"content_index":0,"delta":":","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":54,"output_index":0,"content_index":0,"delta":" + \"\"","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":55,"output_index":0,"content_index":0,"delta":" + (","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":56,"output_index":0,"content_index":0,"delta":"empty","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":57,"output_index":0,"content_index":0,"delta":")","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":58,"output_index":0,"content_index":0,"delta":"\n","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":59,"output_index":0,"content_index":0,"delta":"4","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":60,"output_index":0,"content_index":0,"delta":".","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":61,"output_index":0,"content_index":0,"delta":" + outcome","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":62,"output_index":0,"content_index":0,"delta":":","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":63,"output_index":0,"content_index":0,"delta":" + {\"","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":64,"output_index":0,"content_index":0,"delta":"type","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":65,"output_index":0,"content_index":0,"delta":"\":\"","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":66,"output_index":0,"content_index":0,"delta":"timeout","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":67,"output_index":0,"content_index":0,"delta":"\"}","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":68,"output_index":0,"content_index":0,"delta":" + -","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":69,"output_index":0,"content_index":0,"delta":" + this","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":70,"output_index":0,"content_index":0,"delta":" + indicates","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":71,"output_index":0,"content_index":0,"delta":" + the","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":72,"output_index":0,"content_index":0,"delta":" + command","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":73,"output_index":0,"content_index":0,"delta":" + timed","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":74,"output_index":0,"content_index":0,"delta":" + out","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":75,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":76,"output_index":0,"content_index":0,"delta":"Since","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":77,"output_index":0,"content_index":0,"delta":" + timeout","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":78,"output_index":0,"content_index":0,"delta":"_ms","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":79,"output_index":0,"content_index":0,"delta":" + was","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":80,"output_index":0,"content_index":0,"delta":" + set","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":81,"output_index":0,"content_index":0,"delta":" + to","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":82,"output_index":0,"content_index":0,"delta":" + ","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":83,"output_index":0,"content_index":0,"delta":"1","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":84,"output_index":0,"content_index":0,"delta":"0","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":85,"output_index":0,"content_index":0,"delta":"0","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":86,"output_index":0,"content_index":0,"delta":"0","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":87,"output_index":0,"content_index":0,"delta":" + milliseconds","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":88,"output_index":0,"content_index":0,"delta":" + (","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":89,"output_index":0,"content_index":0,"delta":"1","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":90,"output_index":0,"content_index":0,"delta":" + second","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":91,"output_index":0,"content_index":0,"delta":")","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":92,"output_index":0,"content_index":0,"delta":" + and","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":93,"output_index":0,"content_index":0,"delta":" + the","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":94,"output_index":0,"content_index":0,"delta":" + command","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":95,"output_index":0,"content_index":0,"delta":" + was","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":96,"output_index":0,"content_index":0,"delta":" + \"","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":97,"output_index":0,"content_index":0,"delta":"sleep","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":98,"output_index":0,"content_index":0,"delta":" + ","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":99,"output_index":0,"content_index":0,"delta":"2","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":100,"output_index":0,"content_index":0,"delta":"\"","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":101,"output_index":0,"content_index":0,"delta":" + (","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":102,"output_index":0,"content_index":0,"delta":"which","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":103,"output_index":0,"content_index":0,"delta":" + sleeps","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":104,"output_index":0,"content_index":0,"delta":" + for","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":105,"output_index":0,"content_index":0,"delta":" + ","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":106,"output_index":0,"content_index":0,"delta":"2","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":107,"output_index":0,"content_index":0,"delta":" + seconds","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":108,"output_index":0,"content_index":0,"delta":"),","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":109,"output_index":0,"content_index":0,"delta":" + it","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":110,"output_index":0,"content_index":0,"delta":" + makes","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":111,"output_index":0,"content_index":0,"delta":" + sense","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":112,"output_index":0,"content_index":0,"delta":" + that","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":113,"output_index":0,"content_index":0,"delta":" + the","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":114,"output_index":0,"content_index":0,"delta":" + command","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":115,"output_index":0,"content_index":0,"delta":" + timed","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":116,"output_index":0,"content_index":0,"delta":" + out","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":117,"output_index":0,"content_index":0,"delta":".","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":118,"output_index":0,"content_index":0,"delta":"\n\n","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":119,"output_index":0,"content_index":0,"delta":"There","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":120,"output_index":0,"content_index":0,"delta":"''s","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":121,"output_index":0,"content_index":0,"delta":" + no","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":122,"output_index":0,"content_index":0,"delta":" + exit","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":123,"output_index":0,"content_index":0,"delta":" + code","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":124,"output_index":0,"content_index":0,"delta":" + since","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":125,"output_index":0,"content_index":0,"delta":" + it","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":126,"output_index":0,"content_index":0,"delta":" + timed","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":127,"output_index":0,"content_index":0,"delta":" + out","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":128,"output_index":0,"content_index":0,"delta":",","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":129,"output_index":0,"content_index":0,"delta":" + so","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":130,"output_index":0,"content_index":0,"delta":" + I","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":131,"output_index":0,"content_index":0,"delta":" + should","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":132,"output_index":0,"content_index":0,"delta":" + report","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":133,"output_index":0,"content_index":0,"delta":" + the","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":134,"output_index":0,"content_index":0,"delta":" + timeout","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":135,"output_index":0,"content_index":0,"delta":" + outcome","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":136,"output_index":0,"content_index":0,"delta":".","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.delta + + ' + - 'data: {"type":"response.reasoning_text.delta","sequence_number":137,"output_index":0,"content_index":0,"delta":"\n","item_id":"a90d3c0a1b806346"} + + ' + - ' + + ' + - 'event: response.reasoning_text.done + + ' + - 'data: {"type":"response.reasoning_text.done","sequence_number":138,"output_index":0,"content_index":0,"item_id":"a90d3c0a1b806346","text":"The + shell tool output shows that the command \"sleep 2\" resulted in a timeout outcome. + Let me report this information:\n\n1. The command was \"sleep 2\"\n2. stdout: + \"\" (empty)\n3. stderr: \"\" (empty)\n4. outcome: {\"type\":\"timeout\"} - + this indicates the command timed out\n\nSince timeout_ms was set to 1000 milliseconds + (1 second) and the command was \"sleep 2\" (which sleeps for 2 seconds), it + makes sense that the command timed out.\n\nThere''s no exit code since it timed + out, so I should report the timeout outcome.\n"} + + ' + - ' + + ' + - 'event: response.reasoning_part.done + + ' + - 'data: {"type":"response.reasoning_part.done","sequence_number":139,"output_index":0,"content_index":0,"item_id":"a90d3c0a1b806346","part":{"text":"The + shell tool output shows that the command \"sleep 2\" resulted in a timeout outcome. + Let me report this information:\n\n1. The command was \"sleep 2\"\n2. stdout: + \"\" (empty)\n3. stderr: \"\" (empty)\n4. outcome: {\"type\":\"timeout\"} - + this indicates the command timed out\n\nSince timeout_ms was set to 1000 milliseconds + (1 second) and the command was \"sleep 2\" (which sleeps for 2 seconds), it + makes sense that the command timed out.\n\nThere''s no exit code since it timed + out, so I should report the timeout outcome.\n","type":"reasoning_text"}} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":140,"output_index":0,"item":{"id":"a90d3c0a1b806346","summary":[],"type":"reasoning","content":[{"text":"The + shell tool output shows that the command \"sleep 2\" resulted in a timeout outcome. + Let me report this information:\n\n1. The command was \"sleep 2\"\n2. stdout: + \"\" (empty)\n3. stderr: \"\" (empty)\n4. outcome: {\"type\":\"timeout\"} - + this indicates the command timed out\n\nSince timeout_ms was set to 1000 milliseconds + (1 second) and the command was \"sleep 2\" (which sleeps for 2 seconds), it + makes sense that the command timed out.\n\nThere''s no exit code since it timed + out, so I should report the timeout outcome.\n","type":"reasoning_text"}],"encrypted_content":null,"status":"completed"}} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","sequence_number":141,"output_index":1,"item":{"id":"80952104c8482bbd","content":[],"role":"assistant","status":"in_progress","type":"message","phase":null}} + + ' + - ' + + ' + - 'event: response.content_part.added + + ' + - 'data: {"type":"response.content_part.added","sequence_number":142,"output_index":1,"content_index":0,"item_id":"80952104c8482bbd","part":{"annotations":[],"text":"","type":"output_text","logprobs":[]}} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":143,"output_index":1,"content_index":0,"delta":"\n\nBased","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":144,"output_index":1,"content_index":0,"delta":" + on","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":145,"output_index":1,"content_index":0,"delta":" + the","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":146,"output_index":1,"content_index":0,"delta":" + shell","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":147,"output_index":1,"content_index":0,"delta":" + output","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":148,"output_index":1,"content_index":0,"delta":":","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":149,"output_index":1,"content_index":0,"delta":"\n\n","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":150,"output_index":1,"content_index":0,"delta":"**","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":151,"output_index":1,"content_index":0,"delta":"Command","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":152,"output_index":1,"content_index":0,"delta":" + ","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":153,"output_index":1,"content_index":0,"delta":"1","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":154,"output_index":1,"content_index":0,"delta":":","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":155,"output_index":1,"content_index":0,"delta":" + \"","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":156,"output_index":1,"content_index":0,"delta":"sleep","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":157,"output_index":1,"content_index":0,"delta":" + ","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":158,"output_index":1,"content_index":0,"delta":"2","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":159,"output_index":1,"content_index":0,"delta":"\"**","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":160,"output_index":1,"content_index":0,"delta":"\n","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":161,"output_index":1,"content_index":0,"delta":"-","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":162,"output_index":1,"content_index":0,"delta":" + **","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":163,"output_index":1,"content_index":0,"delta":"stdout","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":164,"output_index":1,"content_index":0,"delta":"**:","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":165,"output_index":1,"content_index":0,"delta":" + (","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":166,"output_index":1,"content_index":0,"delta":"empty","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":167,"output_index":1,"content_index":0,"delta":")","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":168,"output_index":1,"content_index":0,"delta":"\n","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":169,"output_index":1,"content_index":0,"delta":"-","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":170,"output_index":1,"content_index":0,"delta":" + **","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":171,"output_index":1,"content_index":0,"delta":"stderr","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":172,"output_index":1,"content_index":0,"delta":"**:","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":173,"output_index":1,"content_index":0,"delta":" + (","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":174,"output_index":1,"content_index":0,"delta":"empty","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":175,"output_index":1,"content_index":0,"delta":")","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":176,"output_index":1,"content_index":0,"delta":" \n","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":177,"output_index":1,"content_index":0,"delta":"-","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":178,"output_index":1,"content_index":0,"delta":" + **","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":179,"output_index":1,"content_index":0,"delta":"Outcome","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":180,"output_index":1,"content_index":0,"delta":"**:","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":181,"output_index":1,"content_index":0,"delta":" + timeout","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":182,"output_index":1,"content_index":0,"delta":" + (","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":183,"output_index":1,"content_index":0,"delta":"the","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":184,"output_index":1,"content_index":0,"delta":" + command","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":185,"output_index":1,"content_index":0,"delta":" + exceeded","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":186,"output_index":1,"content_index":0,"delta":" + the","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":187,"output_index":1,"content_index":0,"delta":" + ","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":188,"output_index":1,"content_index":0,"delta":"1","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":189,"output_index":1,"content_index":0,"delta":"0","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":190,"output_index":1,"content_index":0,"delta":"0","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":191,"output_index":1,"content_index":0,"delta":"0","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":192,"output_index":1,"content_index":0,"delta":"ms","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":193,"output_index":1,"content_index":0,"delta":" + timeout","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":194,"output_index":1,"content_index":0,"delta":" + limit","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":195,"output_index":1,"content_index":0,"delta":")","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":196,"output_index":1,"content_index":0,"delta":"\n\n","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":197,"output_index":1,"content_index":0,"delta":"The","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":198,"output_index":1,"content_index":0,"delta":" + command","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":199,"output_index":1,"content_index":0,"delta":" + attempted","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":200,"output_index":1,"content_index":0,"delta":" + to","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":201,"output_index":1,"content_index":0,"delta":" + sleep","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":202,"output_index":1,"content_index":0,"delta":" + for","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":203,"output_index":1,"content_index":0,"delta":" + ","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":204,"output_index":1,"content_index":0,"delta":"2","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":205,"output_index":1,"content_index":0,"delta":" + seconds","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":206,"output_index":1,"content_index":0,"delta":",","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":207,"output_index":1,"content_index":0,"delta":" + but","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":208,"output_index":1,"content_index":0,"delta":" + the","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":209,"output_index":1,"content_index":0,"delta":" + timeout","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":210,"output_index":1,"content_index":0,"delta":" + was","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":211,"output_index":1,"content_index":0,"delta":" + set","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":212,"output_index":1,"content_index":0,"delta":" + to","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":213,"output_index":1,"content_index":0,"delta":" + ","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":214,"output_index":1,"content_index":0,"delta":"1","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":215,"output_index":1,"content_index":0,"delta":"0","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":216,"output_index":1,"content_index":0,"delta":"0","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":217,"output_index":1,"content_index":0,"delta":"0","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":218,"output_index":1,"content_index":0,"delta":"ms","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":219,"output_index":1,"content_index":0,"delta":" + (","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":220,"output_index":1,"content_index":0,"delta":"1","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":221,"output_index":1,"content_index":0,"delta":" + second","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":222,"output_index":1,"content_index":0,"delta":"),","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":223,"output_index":1,"content_index":0,"delta":" + causing","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":224,"output_index":1,"content_index":0,"delta":" + the","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":225,"output_index":1,"content_index":0,"delta":" + command","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":226,"output_index":1,"content_index":0,"delta":" + to","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":227,"output_index":1,"content_index":0,"delta":" + be","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":228,"output_index":1,"content_index":0,"delta":" + terminated","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":229,"output_index":1,"content_index":0,"delta":" + before","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":230,"output_index":1,"content_index":0,"delta":" + completion","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":231,"output_index":1,"content_index":0,"delta":".","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":232,"output_index":1,"content_index":0,"delta":" + No","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":233,"output_index":1,"content_index":0,"delta":" + stdout","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":234,"output_index":1,"content_index":0,"delta":" + or","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":235,"output_index":1,"content_index":0,"delta":" + stderr","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":236,"output_index":1,"content_index":0,"delta":" + output","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":237,"output_index":1,"content_index":0,"delta":" + was","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":238,"output_index":1,"content_index":0,"delta":" + generated","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","sequence_number":239,"output_index":1,"content_index":0,"delta":".","item_id":"80952104c8482bbd","logprobs":[]} + + ' + - ' + + ' + - 'event: response.output_text.done + + ' + - 'data: {"type":"response.output_text.done","sequence_number":240,"output_index":1,"content_index":0,"item_id":"80952104c8482bbd","logprobs":[],"text":"\n\nBased + on the shell output:\n\n**Command 1: \"sleep 2\"**\n- **stdout**: (empty)\n- + **stderr**: (empty) \n- **Outcome**: timeout (the command exceeded the 1000ms + timeout limit)\n\nThe command attempted to sleep for 2 seconds, but the timeout + was set to 1000ms (1 second), causing the command to be terminated before completion. + No stdout or stderr output was generated."} + + ' + - ' + + ' + - 'event: response.content_part.done + + ' + - 'data: {"type":"response.content_part.done","sequence_number":241,"output_index":1,"content_index":0,"item_id":"80952104c8482bbd","part":{"annotations":[],"text":"\n\nBased + on the shell output:\n\n**Command 1: \"sleep 2\"**\n- **stdout**: (empty)\n- + **stderr**: (empty) \n- **Outcome**: timeout (the command exceeded the 1000ms + timeout limit)\n\nThe command attempted to sleep for 2 seconds, but the timeout + was set to 1000ms (1 second), causing the command to be terminated before completion. + No stdout or stderr output was generated.","type":"output_text","logprobs":null}} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","sequence_number":242,"output_index":1,"item":{"id":"80952104c8482bbd","content":[{"annotations":[],"text":"\n\nBased + on the shell output:\n\n**Command 1: \"sleep 2\"**\n- **stdout**: (empty)\n- + **stderr**: (empty) \n- **Outcome**: timeout (the command exceeded the 1000ms + timeout limit)\n\nThe command attempted to sleep for 2 seconds, but the timeout + was set to 1000ms (1 second), causing the command to be terminated before completion. + No stdout or stderr output was generated.","type":"output_text","logprobs":null}],"role":"assistant","status":"completed","type":"message","phase":null,"summary":[]}} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","sequence_number":243,"response":{"id":"resp_01a07fda-1337-7d43-80da-85f050936b91","object":"response","created_at":1788851394,"model":"Qwen/Qwen3.5-35B-A3B-FP8","status":"completed","output":[{"type":"reasoning","id":"a90d3c0a1b806346","content":[{"type":"reasoning_text","text":"The + shell tool output shows that the command \"sleep 2\" resulted in a timeout outcome. + Let me report this information:\n\n1. The command was \"sleep 2\"\n2. stdout: + \"\" (empty)\n3. stderr: \"\" (empty)\n4. outcome: {\"type\":\"timeout\"} - + this indicates the command timed out\n\nSince timeout_ms was set to 1000 milliseconds + (1 second) and the command was \"sleep 2\" (which sleeps for 2 seconds), it + makes sense that the command timed out.\n\nThere''s no exit code since it timed + out, so I should report the timeout outcome.\n"}],"summary":[],"encrypted_content":null,"status":"completed"},{"type":"message","id":"80952104c8482bbd","role":"assistant","status":"completed","content":[{"type":"output_text","text":"\n\nBased + on the shell output:\n\n**Command 1: \"sleep 2\"**\n- **stdout**: (empty)\n- + **stderr**: (empty) \n- **Outcome**: timeout (the command exceeded the 1000ms + timeout limit)\n\nThe command attempted to sleep for 2 seconds, but the timeout + was set to 1000ms (1 second), causing the command to be terminated before completion. + No stdout or stderr output was generated.","annotations":[]}]}],"usage":{"input_tokens":603,"output_tokens":234,"total_tokens":837,"input_tokens_details":{"cached_tokens":0},"output_tokens_details":{"reasoning_tokens":0}},"incomplete_details":null,"error":null,"previous_response_id":"resp_01a07fda-0f70-7620-87d6-04115cb1d516","conversation_id":null,"instructions":null}} + + ' + - ' + + ' + - 'data: [DONE] + + ' + - ' + + ' + status_code: 200 diff --git a/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-multiple-commands-gpt-5.6-nonstreaming.yaml b/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-multiple-commands-gpt-5.6-nonstreaming.yaml new file mode 100644 index 00000000..7a62b0fa --- /dev/null +++ b/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-multiple-commands-gpt-5.6-nonstreaming.yaml @@ -0,0 +1,250 @@ +turns: +- filename: t1 + request: + body: + input: 'The local shell environment is Linux bash. Use the shell tool exactly + once with this exact action, preserving the commands array and its order: + {"commands": ["printf ''SHELL_OK\\n''", "printf ''SHELL_ERROR\\n'' >&2; exit + 7", "sleep 2"], "timeout_ms": 1000, "max_output_length": 4096}. Wait for the + client to return shell_call_output before interpreting the results.' + max_output_tokens: 4096 + model: gpt-5.6 + store: true + stream: false + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + authorization: Bearer *** + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + body: + background: false + billing: + payer: developer + completed_at: 1788843180 + created_at: 1788843176 + error: null + frequency_penalty: 0.0 + id: resp_01bfb8b1bfb88f94006a9f94a8a5a487d087b3b1dea277923e + incomplete_details: null + instructions: null + max_output_tokens: 4096 + max_tool_calls: null + metadata: {} + model: gpt-5.6-sol + moderation: null + object: response + output: + - content: [] + encrypted_content: gAAAAABqn5SsFPNwhZayQXgRzxmO1kaL8BBO4qr4JAEK8S1ji-YYrf4BKpKYsbFBXLwQSTgvoGd9CfyucMjQTNmjU6o7ZbkjKNArGElJaLVlrkL6TgDy54e_tCTqQVSIhQDn6M0Z73pHqew0UB9NLxsRnSoCHXgqrYuVMUquYSUe8O10t1k6U0TC2nyvmTXAC5NX9V9ocriFEdiVW08lN8p2ERnxBq2JRpOZ9VOmDi-Ml546ZJPZso8LKT8kQQ7iJrpuqzHK7fi8m-PCmbRyTxvZrLd7ravOiToj2ZVOPCegOlyGwg39fFzCuZCOQm7zWmFoE_u2UNuUnbHtGGLonzUZEBIPlEcQrzFWbe1qQjroA0V0uxwS1Dh5_NHB2-iTEqVj6b0Be5EKl7-Br6a0R3Dy4jLTCpJnYPw8b3f3rRUyypAIF3AV4Wgav2bGyE97mwMK4hMm_bob6lsarO2Y6-oC0SSDiLGsPlt2c6TKwpF1lminJDsAomhglFQ31jPDl8QrsfjfVVDUTNH2XPvdwQOziyUZiaHO5F5Vz2ocEJ-qFRiXhf1o_edciNZ6KMOLrLeH_RrSvfKidSLnZMjdWqCXN3VnxAPVAwUjiSZ1hkHctVJg-DyKWOCCyompuymwUjPOCC5wcKCIlMsVZyEr2-f7VFgq2SY9GPgM4MLkjz2S7tfbAV6-a7KSBCFt3KKKjdqhveLxzdWeAyn8c9_SAQ6maSKGY4L9v69x7eANoKUEznupOGusSN1HHsLVK3pbS0hvOHopeVQSAT3m_jrLYeRHG-NotxN8boZgC8WUQad_lBaHNchXH1j4BNM4AfzZ1PgaJGBgPAZ6CRErulDeneLrpnfEBPxPrz2ZASaBPO9TIfOkZT74XlfkY4NAyucOwz9c4tbbmpN9LVjKFUy3jEVnHjS7fRSKxPETlUNPeCXiqHYWnh-Gsryzv5L8sNDvycUHoxNTHMZc1Ue1XLCj-lpKgclWgaKe1BpwhAsdHLvfmRA8L7fNR4xsX8Q3sGA1l7jj-4baI3GFCxCWq3IMJPtdD2gN75Aw2YN08O06gbG6l__xuT5f3luLAbKf2xwkkzwWvBATo3gi9Ajo-l7Kx0E5GdcW7Zz8Hftg25u6XEeH6Tzf_gglcdRyOXzeJ1dxg3q8a9u6wlE8Xvk_14IX1Ok_b7eAaWSXLGCqHdzTlpm8IW7okj2rhiV7R6BdMqYBiA2sLPr2c3WWBqhUgaTtT5gbgvCMe0vOs2EKfhuWyivcYmueMbb8OUTom4N4OGuvmidWAew5S_3PCjItY4sHWoTc8SMxFfI0pAZp1qKzoYfdk8N4aa9m6tOOqvWtG_sWeCwftHO7St5l-8oCxOEoBPYi22CcRlqucAK4n_ruL22hhlE7MjcjtiLb7KyP3SEAw_2HGNKrQbQ44tQeGuApZSwauq81UzecLE0BOD8MrjLVWVAqs1YikNsJDNdgBAJP6DcRY-vHR8W-Hzcqkfmdwxvys9QrgxseWsEUOYEjl8-U-rQAVScMOxbPHmJKcusFzdsIa18Dtx1spt0zYFkvFVwf8HIIVeg6bzWNQBj3sQlZEtaiDs4afx6sSHgTdSguqdUf55vzo9tvX6JaLFPWjDlHaJccsJkfbq8zS71GuuSq-PhWY4Xq9vBxnLGM35mwlyYgXosqTEziobIlo69P5OZ8wzX-UakL-GMN7m1NriAp0TuBaMRqn4Mr26smVLf_8TC5Y4hgACHnk0Oi1Idu090RJP-BI4hIHWkB0GT-t3QMEEd2rirrXnA5p8j5PfbYhlf7d0vSiddGgMd8sZDOu_hHuXDudRLPJbSDyM2wRGm7yjsuL-EjXxE0qjj1AdNDMq4wzr7Hh3Tvyxod8ZxaQKw-yvYJ6nllWVyap1HLkK1knKHlcAJ0ULBG7ch1neherP7ROUt5R9c6ipUOJl_74Te2O6bkQA5M8KPUfc0Q8MDUgbY-BVyNG2heANlmQbL2_dWotXyC3fLO + id: rs_01bfb8b1bfb88f94006a9f94a9326c87d08c7dcf1d060f7119 + summary: [] + type: reasoning + - action: + commands: + - printf 'SHELL_OK\n' + - printf 'SHELL_ERROR\n' >&2; exit 7 + - sleep 2 + max_output_length: 4096 + timeout_ms: 1000 + call_id: call_iMwxL7LfpPkNSSfoFVqEBPxr + environment: null + id: sh_01bfb8b1bfb88f94006a9f94abb66c87d086bfd8e9b884a33a + status: completed + type: shell_call + parallel_tool_calls: true + presence_penalty: 0.0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_retention: 24h + reasoning: + context: all_turns + effort: medium + mode: standard + summary: null + safety_identifier: null + service_tier: default + status: completed + store: true + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: auto + tool_usage: + image_gen: + input_tokens: 0 + input_tokens_details: + image_tokens: 0 + text_tokens: 0 + output_tokens: 0 + output_tokens_details: + image_tokens: 0 + text_tokens: 0 + total_tokens: 0 + web_search: + num_requests: 0 + tools: + - environment: + type: local + type: shell + top_logprobs: 0 + top_p: 0.98 + truncation: disabled + usage: + input_tokens: 334 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 0 + output_tokens: 173 + output_tokens_details: + reasoning_tokens: 114 + total_tokens: 507 + user: null + headers: + content-type: application/json + status_code: 200 +- filename: t2 + request: + body: + input: + - call_id: call_iMwxL7LfpPkNSSfoFVqEBPxr + max_output_length: 4096 + output: + - outcome: + exit_code: 0 + type: exit + stderr: '' + stdout: 'SHELL_OK + + ' + - outcome: + exit_code: 7 + type: exit + stderr: 'SHELL_ERROR + + ' + stdout: '' + - outcome: + type: timeout + stderr: '' + stdout: '' + type: shell_call_output + - content: Use the shell output above without calling any more tools. For each + command, report its stdout, stderr, and exit code or timeout outcome in + order. + role: user + type: message + max_output_tokens: 4096 + model: gpt-5.6 + previous_response_id: resp_01bfb8b1bfb88f94006a9f94a8a5a487d087b3b1dea277923e + store: true + stream: false + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + authorization: Bearer *** + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + body: + background: false + billing: + payer: developer + completed_at: 1788843182 + created_at: 1788843181 + error: null + frequency_penalty: 0.0 + id: resp_01bfb8b1bfb88f94006a9f94acdfdc87d09031666ab2730507 + incomplete_details: null + instructions: null + max_output_tokens: 4096 + max_tool_calls: null + metadata: {} + model: gpt-5.6-sol + moderation: null + object: response + output: + - content: + - annotations: [] + logprobs: [] + text: "1. `printf 'SHELL_OK\\n'`\n - stdout: `SHELL_OK\\n`\n - stderr:\ + \ empty\n - exit code: `0`\n\n2. `printf 'SHELL_ERROR\\n' >&2; exit\ + \ 7`\n - stdout: empty\n - stderr: `SHELL_ERROR\\n`\n - exit code:\ + \ `7`\n\n3. `sleep 2`\n - stdout: empty\n - stderr: empty\n - outcome:\ + \ timed out (no exit code reported)" + type: output_text + id: msg_01bfb8b1bfb88f94006a9f94ada22c87d09015c00e7dc34f3e + phase: final_answer + role: assistant + status: completed + type: message + parallel_tool_calls: true + presence_penalty: 0.0 + previous_response_id: resp_01bfb8b1bfb88f94006a9f94a8a5a487d087b3b1dea277923e + prompt_cache_key: null + prompt_cache_retention: 24h + reasoning: + context: all_turns + effort: medium + mode: standard + summary: null + safety_identifier: null + service_tier: default + status: completed + store: true + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: auto + tool_usage: + image_gen: + input_tokens: 0 + input_tokens_details: + image_tokens: 0 + text_tokens: 0 + output_tokens: 0 + output_tokens_details: + image_tokens: 0 + text_tokens: 0 + total_tokens: 0 + web_search: + num_requests: 0 + tools: + - environment: + type: local + type: shell + top_logprobs: 0 + top_p: 0.98 + truncation: disabled + usage: + input_tokens: 615 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 0 + output_tokens: 111 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 726 + user: null + headers: + content-type: application/json + status_code: 200 diff --git a/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-multiple-commands-gpt-5.6-streaming.yaml b/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-multiple-commands-gpt-5.6-streaming.yaml new file mode 100644 index 00000000..e03146dc --- /dev/null +++ b/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-multiple-commands-gpt-5.6-streaming.yaml @@ -0,0 +1,1460 @@ +turns: +- filename: t1 + request: + body: + input: 'The local shell environment is Linux bash. Use the shell tool exactly + once with this exact action, preserving the commands array and its order: + {"commands": ["printf ''SHELL_OK\\n''", "printf ''SHELL_ERROR\\n'' >&2; exit + 7", "sleep 2"], "timeout_ms": 1000, "max_output_length": 4096}. Wait for the + client to return shell_call_output before interpreting the results.' + max_output_tokens: 4096 + model: gpt-5.6 + store: true + stream: true + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + authorization: Bearer *** + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + headers: + content-type: text/event-stream; charset=utf-8 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","response":{"id":"resp_0981cc6ee8008f0d006a9f94a0d5c487d0b6e0434a07c9ee46","object":"response","created_at":1788843168,"status":"in_progress","background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":0} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","response":{"id":"resp_0981cc6ee8008f0d006a9f94a0d5c487d0b6e0434a07c9ee46","object":"response","created_at":1788843168,"status":"in_progress","background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":1} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","item":{"id":"rs_0981cc6ee8008f0d006a9f94a189c487d09d0f8ce673934ff2","type":"reasoning","content":[],"encrypted_content":"gAAAAABqn5Sh381kGsqx9CLxcfIsi55QiLS-S__zYAVNKZoZ-0_w2TLB_4vb-4Jm_Nw5auqy7l5Kg1GuFpOXpvhCXSwCdsW5qGQH2J7depYXJvlPICr2qBmfY_f4p9bbKiEmC0vkFPwxDAehfWBLHxB5O4Bmm2eb6ko9YT3XfE4gucD0SdIoYZMypf4IG4vPU37p0tv1vdD_1w63_vN-FGkXpC2iKpvZxQzM9e6eyLFtS1Mklu3XlwjrjDfjvcX7CIZUvb3aQWo6ONcsbpmSJU5eUN-dOuYlu7eC3usnnFSopPzoyYromKTy2eUmrstWoht9d4JpX6ig8zi2aQx7JlexAFONlPEUE-0TMc6SJloCC7h84Mo3Fbv4rlXZyXKxy5QYa-KSKNpIiANMidEl8ckCVdfi7_eVav_-_docOBOyPbfhh0W-WsC-rHNJbzGKKzKEy_ogaf72gyoWlQRl7IkMcMFay0KueRi-92vDbUpJmexkLx2WoDC3pVoku5jxAxZ_PYfLKfFjtJvZpVYQcZR9cWe6MBfVOxfK4shNq3Rt5Kt-wxJV0mcyrVUbgAp-1fGA-XYsP2tDvv9LvYAZe6zDwISjKeEgMwrEsXGB7yOlTWGRlCipfeA8H45vBczIEEMqVkqCUBwUj3F1oLGLhHBojNt3rxo1j_C1PlkPTHEyBcnPgTgOrn9lOOjjzPx27-43jwFT-aOqRIvjP-cShIurzLMQurfOZpb7tSI0S9vg5A4-2kcFUCYWhSk0nR3HfF1Wz_hdbMjnDryvDlTuzZeH1VX486bOmy5U_2jxSN-L3g299GqUgjqRwA2p2v2CYcR7lCk8cPl1zcdM5NtqGnSSknPFyxH9Ul2OCQPhx-8eGhbpKr71GEZwoBjm7cNsoy37FPRwLuy_HLKhefgXrjmRb0VLdcHA0XhmaDVjYiAvDDBJn3n_oYOQFKUmY0UkBat8yzoL_LRXbUfPQ7oBVAUF1eTNIDiC4idResGCgo5GbPM_cAKSRx4VGbOtYz0yyyf93TjAZ4JhfX40g0CwW0Vil4tfr2ZI6TIoXDEeC_DYC6vECl--Lqgiplo7C5C0v5xkrJ_T6WLm_-eQgJ6O7DH9MJqSBhEpUbe2BQC1wCPCNyhSmxDAfOk8x-wshU93Z4kRNZNheIAfL5gLfne5KY-CKF0AMUYV-w==","summary":[]},"output_index":0,"sequence_number":2} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","item":{"id":"rs_0981cc6ee8008f0d006a9f94a189c487d09d0f8ce673934ff2","type":"reasoning","content":[],"encrypted_content":"gAAAAABqn5Sj2E4Tpbq_MfkISn8wHUz9QCfCB-4jimSFLRLmOtc8249Hu-DRa2uqGkXPKxVba9EcoVX_uXj02YKrcqHpCkWiLpRe23CqnvdoArYvytAl4ZZW2MKEzw1M0YQZVrfwLrNL2r3g6AkKROvG6SzZwJ_D8TXY3eDOB6jiUrhAdGlAWTgV_XBqJ4-XP7vE73AZ1DsVayDNIz9ekivUZqt5pDXZFALzqQBFhBO2tDXQ1K3bGP_kPttDx7FUof86oB-kgr2wGARYrld2wlvbQub685iu7sDWbtqxF-Go21LNGi6EJokGd5dU767szr6izlR6ZCFM0nSoxzoaUIdOsAZafdIBojGcKkoqahQ5d3YpJ7lIm7L_p-fHSTY-zrztUKJjoOnzzaydPo00H0QvJHK8vp4AN3IAG2r_2Jdqbq0yPjIoPQzOSS0_-GsTC2asErWluy8ZSotihrpOXUpbsoe475AeQ-UERWcw0SHDjCDJLVa33J-8WdqfZr6niIEJRYuMlNeNTUOOHHhEwZnQZxhPgCYd3LNbC3q2pu-Vm2qq9M0bJRb8sMKXGW68gGcQ43dIJAiUYGSEnfUUpQzinCPW3q0NWHuBJA6XgxQawSU4EHMS8O8y6WbeCWvT6OXCQAT8sfuoumOZBJgtk-Xkm8-4Q9afsqdas2hCWVgWIVbXoVYGdj4e3G2tTgj63okx1RoJKbrtxMA64KE5penTS0--Lw8u0oQqiBZ3l5xex9d8LywzPRwhsEwaDMzgyhoOUI1sdsUc1Eh7bXVRPD2Q8TH8xXQcWk_c2YkApDllgMIzOHnugA8MMjNalJ-V5l5tWDPVxAjZpZEUL0lHg8CnqHTkMx5nT6IupapAMctmRHbi8FbAPxXOHhJqpt7m_fBR3Tw9ehJ65DYFmpQk4Wcjyv_pie6M24TJKCUL7T3XZtA36oStUD-scw9pGOz6MhwgPEMvnMQ-Uk0uT_cNb83_JCbrlqwaz7r-ePtrwP35l6sTV2YEBiGzcI4SE8EkM07wDYSXyBiQvgjE_cbVWcXAYyJK_uodp3OQFOf1hZW5nwumCcjRc7NXEicxzIDQf81-9YfDzhZqVnuhtQnQrdpJgyHuK_k47S_yk5wCad-HgCG8Sba_yuuZWH_AA5xCtW5rEOfS-LMp8YN6RYiRNeg8MfTa7ZAolOxvfWJnRlt3JDGzXl7qg4qzhd0xfUQSM7n7MswS63ORn8btEtVx2GiO9FV1Y-ecDGWkEj1izrBY6i6tnfOa8GTi7iLA_ogoJ5Qt9wESWLARoww2ALNeyXtV0EsJmRPfiU1iGyfQX5IfR45V30xcguE2ENwFV82tQFyXqypTr30Za-pGDZViQlrUsnF2P5JtDAiCxdpKpo11qravUjJ0C7uCwZ6ULCc0DFLLVS-SyzawEu021XDECr9NdXMxnf842J8JC5gsayioDcqFcJQOFfj-cQkYN-Nh8t0_C0MmDaYcvzu6lMZKbRKjurmrug-rIypJZ4N9lsz0u7j3Hl4GGp0UIWIpkFM5oDeR8btjn8mPZ2-ObxPPh_86ZhfTzIsI4r8bl_Klq4H2Pcu0y12kfrWAQUbjlsk-fqIhPx5SWa7AXYf3veDcJlV28RJU-GKshNRSEXuqAJ5bbfcyU0IcTj6d2ABephcsj2iqRVlYRq6BuM8BetrD1QVMIFdn3jBxCJayU9bfYMvh9CAoHq8QNXefkIfpvQtolDdL1XgYZvTpqbJ58742LBxFZQ3F6sqWs3XWmOWhe5DHyYmFDOOrSmAg76_UiXujwEV1Yuv_-3JeyUTMP5uiUqazMSirneMHzDA9qUXmFmyhS1ihTCqjvwk=","summary":[]},"output_index":0,"sequence_number":3} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","item":{"id":"sh_0981cc6ee8008f0d006a9f94a3882087d098124dda97abb986","type":"shell_call","status":"in_progress","action":{"commands":[],"max_output_length":null,"timeout_ms":null},"call_id":"call_rN3CtqHIoOs1Btor5rrDjutR","environment":null},"output_index":1,"sequence_number":4} + + ' + - ' + + ' + - 'event: response.shell_call_command.added + + ' + - 'data: {"type":"response.shell_call_command.added","command":"","command_index":0,"output_index":1,"sequence_number":5} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"printf","obfuscation":"DS0q2oxylM","output_index":1,"sequence_number":6} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":" + ''","obfuscation":"5YR2s9d8eg5lr0","output_index":1,"sequence_number":7} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"S","obfuscation":"yhmLXsY3urOeZ5K","output_index":1,"sequence_number":8} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"HELL","obfuscation":"cGvVmLg4JLXp","output_index":1,"sequence_number":9} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"_OK","obfuscation":"RpdUsjH2f6z6P","output_index":1,"sequence_number":10} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"\\","obfuscation":"3WcUUYFm655GMW8","output_index":1,"sequence_number":11} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"n","obfuscation":"CzabpNjVFkfkKKY","output_index":1,"sequence_number":12} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"''","obfuscation":"ZsgAoDosgoxdqYY","output_index":1,"sequence_number":13} + + ' + - ' + + ' + - 'event: response.shell_call_command.done + + ' + - 'data: {"type":"response.shell_call_command.done","command":"printf ''SHELL_OK\\n''","command_index":0,"output_index":1,"sequence_number":14} + + ' + - ' + + ' + - 'event: response.shell_call_command.added + + ' + - 'data: {"type":"response.shell_call_command.added","command":"","command_index":1,"output_index":1,"sequence_number":15} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":1,"delta":"printf","obfuscation":"FQWcXpFHDx","output_index":1,"sequence_number":16} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":1,"delta":" + ''","obfuscation":"Pld1sBVeHLtaxt","output_index":1,"sequence_number":17} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":1,"delta":"S","obfuscation":"bjAUiBGCydErp2R","output_index":1,"sequence_number":18} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":1,"delta":"HELL","obfuscation":"veZD1YyjsML6","output_index":1,"sequence_number":19} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":1,"delta":"_ERROR","obfuscation":"7p8Moi64N9","output_index":1,"sequence_number":20} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":1,"delta":"\\","obfuscation":"bb16WnvIpMeyBSg","output_index":1,"sequence_number":21} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":1,"delta":"n","obfuscation":"C3Pii1kqUl6F5v1","output_index":1,"sequence_number":22} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":1,"delta":"''","obfuscation":"oGc2vU553aRQDrO","output_index":1,"sequence_number":23} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":1,"delta":" + >&","obfuscation":"eVo6RZWj16NOZ","output_index":1,"sequence_number":24} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":1,"delta":"2","obfuscation":"LXTTBDRJpoJOB6u","output_index":1,"sequence_number":25} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":1,"delta":";","obfuscation":"nUP8n6SsWhG9DBm","output_index":1,"sequence_number":26} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":1,"delta":" + exit","obfuscation":"o9xG5gqqniy","output_index":1,"sequence_number":27} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":1,"delta":" + ","obfuscation":"FpJINzKSW6TzDC7","output_index":1,"sequence_number":28} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":1,"delta":"7","obfuscation":"g5nv58ALy13kTDM","output_index":1,"sequence_number":29} + + ' + - ' + + ' + - 'event: response.shell_call_command.done + + ' + - 'data: {"type":"response.shell_call_command.done","command":"printf ''SHELL_ERROR\\n'' + >&2; exit 7","command_index":1,"output_index":1,"sequence_number":30} + + ' + - ' + + ' + - 'event: response.shell_call_command.added + + ' + - 'data: {"type":"response.shell_call_command.added","command":"","command_index":2,"output_index":1,"sequence_number":31} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":2,"delta":"sleep","obfuscation":"w6Lbj2q5QKh","output_index":1,"sequence_number":32} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":2,"delta":" + ","obfuscation":"LX0J5lvpu8nWYep","output_index":1,"sequence_number":33} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":2,"delta":"2","obfuscation":"1xHZ4DVx7NTuCle","output_index":1,"sequence_number":34} + + ' + - ' + + ' + - 'event: response.shell_call_command.done + + ' + - 'data: {"type":"response.shell_call_command.done","command":"sleep 2","command_index":2,"output_index":1,"sequence_number":35} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","item":{"id":"sh_0981cc6ee8008f0d006a9f94a3882087d098124dda97abb986","type":"shell_call","status":"completed","action":{"commands":["printf + ''SHELL_OK\\n''","printf ''SHELL_ERROR\\n'' >&2; exit 7","sleep 2"],"max_output_length":4096,"timeout_ms":1000},"call_id":"call_rN3CtqHIoOs1Btor5rrDjutR","environment":null},"output_index":1,"sequence_number":36} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","response":{"id":"resp_0981cc6ee8008f0d006a9f94a0d5c487d0b6e0434a07c9ee46","object":"response","created_at":1788843168,"status":"completed","background":false,"completed_at":1788843172,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[{"id":"rs_0981cc6ee8008f0d006a9f94a189c487d09d0f8ce673934ff2","type":"reasoning","content":[],"encrypted_content":"gAAAAABqn5SkWrq6LahGx0SPxFvvwJvjBvRYvr4E3bMqDPyw1OZ8V22uO1f5_wcUY_1Ov-4BLun0LrwECmJfjaFGaVCc56nsG0rDNuINtB6nvRzcVpp9NH8gPiDYTXd95UB6oTfwTihW3hHSXYhQBbTaN5Rj8Hy1JBkAdHZEvipDw-CSfKruJP8HKvxdFKjwJNiGW81-aiHRSfQ-9Eeetcu_AvqTg1RFRdOBDt5HktPJT0rtMqTUObx2H8gBaBhlvFt9RFgSkYHKV3UDaXaWhiuoRzcJTOsGjjZ05jbUkc5Z93AUh1pyglwoX1Ht5qUsWEph58t9iHCa7_6nLO3ieoNXUGJ7IkGwav90NoEIIzOsElLqqGu6GYCGpcwHZJar4BYO2KIGf_UuRWtLb6HbyJZE2uQ86l1qxjvnYK3iRpXAWXoCXkyXHVxN4qYrCSex7T_zaOvjllec4sJh5w4s015jv-E-T2b9TtvQb_ZnbfIF84q7TviFnQtqZKWbjp8fer9JBUbpHQYH0MPWss-4tcm7S3SOcJeGos8tSMc7AcLWoWjvAO3GbzqP2TJjwDXY_IDFKg822MXmfjt1_H0sQhvXL9_UH99C36xH7BsdGDz5cHZ8Z3LsYShX_L_42oU_0oqcUH_H3voZmJRYkZKTSY0hn8xWyUWpgfRNRyL2RPMl_Sm35ztbODHv0llR1UNvu3Eq2T8bCX7EGIPb3ldkoA5a9yIv4DoHlUE0AG4dh8QVztwu3xVrZD3YA9QjiipioHw5k6nHNOPqc572BVSzZDYojQo9PJnUiLVF9qMAf8Uqi7gw6_4WtqA91TQwEQew9P3B0bV1nOYCh9DrVUGlkW6Ag9v4Sts-2XCJi0ZOvrCE3TABH24HvM-Nmjw2Jq9iqZc1prbKmaGHI037yQL0gnzKW0ceWSO_wlI9cJrx4tSLvaRlNYL8ahy_SIslCBSLKvFp5tfQiuS1bbtenReNpyBCHHk1PA_9WLjeXST2Ky1LTfnOLMOTHYmAW6s_X2T9Osb-4eUQx-IAEpZMOp37Z3ce6ftmfWi4DerD4cZ80devrhxbxWYg_yQUIov5HwiHFYhkIyDssyN9conltR6lSEtZjJVy7cB8q3LWh0oaRYsm5Kb7d1puyA17YUxW0VwKA-dLtwRbmCd8tY-5qz0_NwLyBlXQpu7Jc-DdmtRXkCu7X3OMBOrWaBFk9Oy5hFvOA1ME27VKc6Gpcy5Ir_aneoTZNFV9FNXAqIgQNTHEn57n3b0o-tLkUz9pkL5vsoz7SfLVafUbZS23Yt2YiOqGbIMzcmM2TfZiisKoOhyHYludXzVbI1zKuZ_mnYGX9ygVON2Np5pmO4REmPcARpeI2t8Ap7TlMS8BAhhLdsEOjBDe4dgWTvLFIt1-2lGHTB256v3TfTjmZjjrCCJsBQIc5_WXej-_Hjrnel6dTYHeHNpTHbnLx277QeGNjNvlhOTqI-kg0vR3tNfgk6-OoGoYvCxaAIBt7Zb07Cj5bqL2LFOLJf0zySfCw5KQegWxulTSJG4s0Q495Wi1ZOS4YnIOv3pey_THllcU1BGTaf0DhTxQ7jcYJrSiYIjJ-DTKIl47gGSon-3KAAChXyZxM4c317wgLZZ8fdjV-3FIRi3E5Dn3tqHcEwofdwFA6NQ-tais2pz3bJXBpjJnWOXm4332DoTNiRkaYF3mQL266277s7GzwXjT9VHznFQf-41ihh76ugIUY9XOfwaIvKux8IsJyg4jzHKuAH3NxDG9T0DePsHeMIRAoeV-6j0s8eA0hql-_JvWrEgvuAQig4DqgYE49oYbPPSMCWGbIj_ev35rNN47BUiqfCpT0UE=","summary":[]},{"id":"sh_0981cc6ee8008f0d006a9f94a3882087d098124dda97abb986","type":"shell_call","status":"completed","action":{"commands":["printf + ''SHELL_OK\\n''","printf ''SHELL_ERROR\\n'' >&2; exit 7","sleep 2"],"max_output_length":4096,"timeout_ms":1000},"call_id":"call_rN3CtqHIoOs1Btor5rrDjutR","environment":null}],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"default","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":{"input_tokens":334,"input_tokens_details":{"cache_write_tokens":0,"cached_tokens":0},"output_tokens":159,"output_tokens_details":{"reasoning_tokens":100},"total_tokens":493},"user":null,"metadata":{}},"sequence_number":37} + + ' + - ' + + ' + status_code: 200 +- filename: t2 + request: + body: + input: + - call_id: call_rN3CtqHIoOs1Btor5rrDjutR + max_output_length: 4096 + output: + - outcome: + exit_code: 0 + type: exit + stderr: '' + stdout: 'SHELL_OK + + ' + - outcome: + exit_code: 7 + type: exit + stderr: 'SHELL_ERROR + + ' + stdout: '' + - outcome: + type: timeout + stderr: '' + stdout: '' + type: shell_call_output + - content: Use the shell output above without calling any more tools. For each + command, report its stdout, stderr, and exit code or timeout outcome in + order. + role: user + type: message + max_output_tokens: 4096 + model: gpt-5.6 + previous_response_id: resp_0981cc6ee8008f0d006a9f94a0d5c487d0b6e0434a07c9ee46 + store: true + stream: true + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + authorization: Bearer *** + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + headers: + content-type: text/event-stream; charset=utf-8 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","response":{"id":"resp_0981cc6ee8008f0d006a9f94a4a8e087d0b3efdba5807a46bc","object":"response","created_at":1788843172,"status":"in_progress","background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":"resp_0981cc6ee8008f0d006a9f94a0d5c487d0b6e0434a07c9ee46","prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":0} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","response":{"id":"resp_0981cc6ee8008f0d006a9f94a4a8e087d0b3efdba5807a46bc","object":"response","created_at":1788843172,"status":"in_progress","background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":"resp_0981cc6ee8008f0d006a9f94a0d5c487d0b6e0434a07c9ee46","prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":1} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","item":{"id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","type":"message","status":"in_progress","content":[],"phase":"final_answer","role":"assistant"},"output_index":0,"sequence_number":2} + + ' + - ' + + ' + - 'event: response.content_part.added + + ' + - 'data: {"type":"response.content_part.added","content_index":0,"item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","output_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""},"sequence_number":3} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"1","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"nwOqfourIh89r03","output_index":0,"sequence_number":4} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":".","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"kQmPyDvZYRTcYWb","output_index":0,"sequence_number":5} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" `","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"ZCOj2OT74knXTa","output_index":0,"sequence_number":6} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"printf","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"hH1nnHn6eX","output_index":0,"sequence_number":7} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ''","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"9T79lm6yfmynkI","output_index":0,"sequence_number":8} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"S","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"8LWhAh2OFa5q6X9","output_index":0,"sequence_number":9} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"HELL","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"020LO15TaOVZ","output_index":0,"sequence_number":10} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"_OK","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"Njr3rsLqBbDCy","output_index":0,"sequence_number":11} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"\\n","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"tPnzLDzyDJPWOi","output_index":0,"sequence_number":12} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"''","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"EiTjLsmfrcP2RqK","output_index":0,"sequence_number":13} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"`\n","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"7mHbzkpbp3f1Un","output_index":0,"sequence_number":14} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"9iIqouKKUewDAr","output_index":0,"sequence_number":15} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" -","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"uCBhKhqHO953mz","output_index":0,"sequence_number":16} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" stdout","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"gYGBVRWJ8","output_index":0,"sequence_number":17} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":":","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"EYUppuL2lrxOl8C","output_index":0,"sequence_number":18} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" `","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"QQpgyeY50WdHOz","output_index":0,"sequence_number":19} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"S","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"N1RUQOq2U7rliDv","output_index":0,"sequence_number":20} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"HELL","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"CTI5h1rKEr5k","output_index":0,"sequence_number":21} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"_OK","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"fmHZ48nFt9Zan","output_index":0,"sequence_number":22} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"`\n","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"B0onoeXa3GvI9m","output_index":0,"sequence_number":23} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"gH2qp55o7zwOIf","output_index":0,"sequence_number":24} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" -","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"yRVPlLB48hIi1Q","output_index":0,"sequence_number":25} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" stderr","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"Nv6eicPkw","output_index":0,"sequence_number":26} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":":","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"WXIwOexJGBXdVLQ","output_index":0,"sequence_number":27} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" empty","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"CF5g2ZDo69","output_index":0,"sequence_number":28} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"\n","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"mTnh8MflruCHPt3","output_index":0,"sequence_number":29} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"WqFaiG9XAXcLeA","output_index":0,"sequence_number":30} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" -","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"fArOEssvTFphnS","output_index":0,"sequence_number":31} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" exit","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"LByMDrS06LW","output_index":0,"sequence_number":32} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" code","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"XCjdWHghOE1","output_index":0,"sequence_number":33} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":":","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"jRUXKl1AeN0eQO4","output_index":0,"sequence_number":34} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" `","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"4aWGciIQOhByP8","output_index":0,"sequence_number":35} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"0","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"wkIDyENeQom2IyF","output_index":0,"sequence_number":36} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"`\n\n","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"UOF5D8mT415mR","output_index":0,"sequence_number":37} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"2","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"iKAJjpDyJgBanjp","output_index":0,"sequence_number":38} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":".","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"A9tgHro0fjqcf4L","output_index":0,"sequence_number":39} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" `","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"76EvNnzaHbftEY","output_index":0,"sequence_number":40} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"printf","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"lPRXnijzJ9","output_index":0,"sequence_number":41} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ''","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"xiG0SWPCVXSoYA","output_index":0,"sequence_number":42} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"S","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"3I70bhCaMkWjaC5","output_index":0,"sequence_number":43} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"HELL","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"WezU7ZrqZFMc","output_index":0,"sequence_number":44} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"_ERROR","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"UFEDkBWnjs","output_index":0,"sequence_number":45} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"\\n","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"6IWKqr7dBvsLfO","output_index":0,"sequence_number":46} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"''","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"q8ltb9qnGjeihst","output_index":0,"sequence_number":47} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" >&","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"O9fhpOj4Ks4n4","output_index":0,"sequence_number":48} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"2","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"0YyfVGo7k3MmDFO","output_index":0,"sequence_number":49} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":";","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"SYits3LwXvqlGER","output_index":0,"sequence_number":50} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" exit","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"35qaftJsG1G","output_index":0,"sequence_number":51} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"eIj68mYyenikwJ1","output_index":0,"sequence_number":52} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"7","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"78cmN3ILXCoEYQY","output_index":0,"sequence_number":53} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"`\n","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"cDH1hpJUVWaA7T","output_index":0,"sequence_number":54} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"f4Jv05MANqbJTe","output_index":0,"sequence_number":55} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" -","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"bmNpJmDrjwOcue","output_index":0,"sequence_number":56} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" stdout","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"1PP4oQSF3","output_index":0,"sequence_number":57} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":":","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"GXOgMa0vsZjFW84","output_index":0,"sequence_number":58} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" empty","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"9kjn1OXrzf","output_index":0,"sequence_number":59} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"\n","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"pBFl6VFGwSgHng5","output_index":0,"sequence_number":60} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"XLCR6ZXNCD0YZz","output_index":0,"sequence_number":61} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" -","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"h9CelmTgdRIlLG","output_index":0,"sequence_number":62} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" stderr","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"E9E79ujwy","output_index":0,"sequence_number":63} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":":","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"cVh5by803wWG1Ua","output_index":0,"sequence_number":64} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" `","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"Cd5KXnqrexT1Eo","output_index":0,"sequence_number":65} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"S","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"UGpjfu1zZ8nUKoP","output_index":0,"sequence_number":66} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"HELL","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"AazaMmDfoe6C","output_index":0,"sequence_number":67} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"_ERROR","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"YDURwPPZZP","output_index":0,"sequence_number":68} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"`\n","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"3MRsFTpzWNAyqW","output_index":0,"sequence_number":69} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"WPV5ixwFWOTfar","output_index":0,"sequence_number":70} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" -","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"MsVXnXnamM1qoC","output_index":0,"sequence_number":71} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" exit","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"GTAw166x6SN","output_index":0,"sequence_number":72} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" code","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"vvmfH9yK6XR","output_index":0,"sequence_number":73} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":":","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"sJXBuHJvsVN8w8K","output_index":0,"sequence_number":74} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" `","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"nsCRq5ggFPB0RZ","output_index":0,"sequence_number":75} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"7","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"Nm7z9WGLRsBDvcN","output_index":0,"sequence_number":76} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"`\n\n","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"ABRW5v4KMH9zS","output_index":0,"sequence_number":77} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"3","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"BnyRLx84GmWA4qP","output_index":0,"sequence_number":78} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":".","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"NJ1k2CZ40Ie2ukI","output_index":0,"sequence_number":79} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" `","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"3p3R0mw8ofZqHF","output_index":0,"sequence_number":80} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"sleep","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"atYXLZvID7A","output_index":0,"sequence_number":81} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"oPS7goGk5Sz0CvS","output_index":0,"sequence_number":82} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"2","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"iqvJhm1ZwTubgIq","output_index":0,"sequence_number":83} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"`\n","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"dwt2pkztqJdU5C","output_index":0,"sequence_number":84} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"8gCcFZmYu80z0m","output_index":0,"sequence_number":85} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" -","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"cUiPY2OvZzPBCW","output_index":0,"sequence_number":86} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" stdout","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"iibLlGRCg","output_index":0,"sequence_number":87} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":":","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"k8EkFi0stXHZQkV","output_index":0,"sequence_number":88} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" empty","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"fnd8ODrsvR","output_index":0,"sequence_number":89} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"\n","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"gWyLJGkvVjU6bya","output_index":0,"sequence_number":90} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"gfH7pVnEeWtWcS","output_index":0,"sequence_number":91} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" -","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"yhoUTsydWsFWdv","output_index":0,"sequence_number":92} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" stderr","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"5ppNpSFfQ","output_index":0,"sequence_number":93} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":":","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"HnqkfZBKYZYrMYQ","output_index":0,"sequence_number":94} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" empty","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"1WBtY4nJoI","output_index":0,"sequence_number":95} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"\n","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"lgRmi5YrefW2Tcn","output_index":0,"sequence_number":96} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"16Jlc7eYhDwtG0","output_index":0,"sequence_number":97} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" -","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"46wmEneXqDuSRb","output_index":0,"sequence_number":98} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" outcome","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"PwLxTD54","output_index":0,"sequence_number":99} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":":","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"fIo7DkRVdB5tEWl","output_index":0,"sequence_number":100} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" timed","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"6eQL2f5fHA","output_index":0,"sequence_number":101} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" out","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"Qrwi3rGAPEKB","output_index":0,"sequence_number":102} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" after","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"mV9U7C6xXh","output_index":0,"sequence_number":103} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"0tIE8HTJu6hIlGJ","output_index":0,"sequence_number":104} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"100","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"XSuAPD5bAzegB","output_index":0,"sequence_number":105} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"0","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"2DrtvX870drGOIC","output_index":0,"sequence_number":106} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ms","item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"obfuscation":"0LuClzrMQMwnr","output_index":0,"sequence_number":107} + + ' + - ' + + ' + - 'event: response.output_text.done + + ' + - 'data: {"type":"response.output_text.done","content_index":0,"item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","logprobs":[],"output_index":0,"sequence_number":108,"text":"1. + `printf ''SHELL_OK\\n''`\n - stdout: `SHELL_OK`\n - stderr: empty\n - + exit code: `0`\n\n2. `printf ''SHELL_ERROR\\n'' >&2; exit 7`\n - stdout: empty\n - + stderr: `SHELL_ERROR`\n - exit code: `7`\n\n3. `sleep 2`\n - stdout: empty\n - + stderr: empty\n - outcome: timed out after 1000 ms"} + + ' + - ' + + ' + - 'event: response.content_part.done + + ' + - 'data: {"type":"response.content_part.done","content_index":0,"item_id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","output_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":"1. + `printf ''SHELL_OK\\n''`\n - stdout: `SHELL_OK`\n - stderr: empty\n - + exit code: `0`\n\n2. `printf ''SHELL_ERROR\\n'' >&2; exit 7`\n - stdout: empty\n - + stderr: `SHELL_ERROR`\n - exit code: `7`\n\n3. `sleep 2`\n - stdout: empty\n - + stderr: empty\n - outcome: timed out after 1000 ms"},"sequence_number":109} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","item":{"id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"1. + `printf ''SHELL_OK\\n''`\n - stdout: `SHELL_OK`\n - stderr: empty\n - + exit code: `0`\n\n2. `printf ''SHELL_ERROR\\n'' >&2; exit 7`\n - stdout: empty\n - + stderr: `SHELL_ERROR`\n - exit code: `7`\n\n3. `sleep 2`\n - stdout: empty\n - + stderr: empty\n - outcome: timed out after 1000 ms"}],"phase":"final_answer","role":"assistant"},"output_index":0,"sequence_number":110} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","response":{"id":"resp_0981cc6ee8008f0d006a9f94a4a8e087d0b3efdba5807a46bc","object":"response","created_at":1788843172,"status":"completed","background":false,"completed_at":1788843174,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[{"id":"msg_0981cc6ee8008f0d006a9f94a567c487d0b6c4c1ca5018c353","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"1. + `printf ''SHELL_OK\\n''`\n - stdout: `SHELL_OK`\n - stderr: empty\n - + exit code: `0`\n\n2. `printf ''SHELL_ERROR\\n'' >&2; exit 7`\n - stdout: empty\n - + stderr: `SHELL_ERROR`\n - exit code: `7`\n\n3. `sleep 2`\n - stdout: empty\n - + stderr: empty\n - outcome: timed out after 1000 ms"}],"phase":"final_answer","role":"assistant"}],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":"resp_0981cc6ee8008f0d006a9f94a0d5c487d0b6e0434a07c9ee46","prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"default","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":{"input_tokens":601,"input_tokens_details":{"cache_write_tokens":0,"cached_tokens":0},"output_tokens":108,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":709},"user":null,"metadata":{}},"sequence_number":111} + + ' + - ' + + ' + status_code: 200 diff --git a/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-nonzero-exit-gpt-5.6-nonstreaming.yaml b/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-nonzero-exit-gpt-5.6-nonstreaming.yaml new file mode 100644 index 00000000..5c16385e --- /dev/null +++ b/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-nonzero-exit-gpt-5.6-nonstreaming.yaml @@ -0,0 +1,234 @@ +turns: +- filename: t1 + request: + body: + input: 'The local shell environment is Linux bash. Use the shell tool exactly + once with this exact action, preserving the commands array and its order: + {"commands": ["printf ''SHELL_ERROR\\n'' >&2; exit 7"], "timeout_ms": 1000, + "max_output_length": 4096}. Wait for the client to return shell_call_output + before interpreting the results.' + max_output_tokens: 4096 + model: gpt-5.6 + store: true + stream: false + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + authorization: Bearer *** + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + body: + background: false + billing: + payer: developer + completed_at: 1788843147 + created_at: 1788843144 + error: null + frequency_penalty: 0.0 + id: resp_0bca03545c6c1187006a9f9488a4a487d0bf23d9ab2df7652f + incomplete_details: null + instructions: null + max_output_tokens: 4096 + max_tool_calls: null + metadata: {} + model: gpt-5.6-sol + moderation: null + object: response + output: + - content: [] + encrypted_content: gAAAAABqn5SLCADHwnwwQthuOO17s5ie00Zr3G7p_dwFEQdvpHovdrRho8bFbj9E28U8EzFahtEWW4RNvhz1UFTdB5H0ERWyy-UFpSwg4gfoRPVpS_GCO102-nexQG3PbHRjNvICNkBk_kNVY7eN8aTezU2lNHGMsYRZFZDLBZBJovXJZ378S4_Lk1RXejb_2ZpidQvRDpASKL6vNITDA93PcbF9G3uyg6_gDqnVazyTbU3sKzzuZ_ejIcKAH7zbc0lqFuyEx2ybwNp6eog9lYoyb4DSJOQBKdfIGNtHe2OpRl4Z9TQXTISxx0pjebQkiO741sKvYv8-xkm4_shn83x409riL0xIO33FUMpD1fGLus8PQcfgYAwjxEemsB-HMtpaGZUC29K-tahcL2vvelk6Teh2pa2-6ploVF8vtS8FiOAnGqZUP0cerZH1oWfIVUQq-XeO7XzS0DHzbTdTOFJnuSmZbE1IXudKWo3S04LyrU_Q_NVcMtUh75yXeij6T-Dw6dcfrKCjcAoNZW0ZQSnWE-QhezkFfUPpxHEB_Rg_6Sgj-CWptfGhwUcHlmRCs1jbVTp2F-sXb30ZrxDe7p73Q1msapswS2xXhgfGZlr6mPvA8P0tJVQ3uS1nbRcH07o_AmR6GkPcd9uk7lmiEbJaPfQg9mTRS5Ukbq0SrGdBR90S8AFoALTwNpOlnn2WhZUH0d99DMYWE2MOBVf9YI1JF5pmDJKowNdavLggCzZVyu7rcD3okURqs7UgGwbksM858o_oOKyRVKs5QtTA-hSomyBNjP7h4x6wn2_PKqkKIZWERPG58shmCjzZPqO8TQUUbXTkkKRivuz1_gJqelCoKixUkcnIuh9Gw-YYdlsFkgh0UcpdiYw0igmXxBMhpfOaCJiC5UmCghtrdVucAnrvagLhYtdWzbvC_urqobQfNaNVw5dvNb4_PmB6do69OGF-2yNIccW6xNVBY1bb0KkaCxgFqmZ5H5JCDPgXLeWYinUABCMs-CurcOsSTMV6mLzqc6RKsYtDF0vgFc_fPaWlG7dWSjbvGwYbe0gwH2eIwwA8CMJvP6l8V9h61OLmouaWiRJKngjpOKQEUvTm7pxAxZfjmzcxPxGYafAcSlucpNBq8npCqaxX9AJjVUohruWaZI37TnEwx2x4xES_9hGuk5YbDJNz42qiSgtUYY0PFsx7GHuc5LvvtC5q1M8ypHJB1fJdKQ1t-B9vf7vtDD5COji4Fvo3o_4Hcv1yAYIemMrth4GIEMChNeKyOA32OUPzTZ3MUDCB8L6KKDeCn3uBiBEd_DKFDzN6G5g6qecIIOoYxZibqHhQaaldwmSou3qMF18dMJHJqNKZQeQaZYwDNTpzC6T8VpRHic65VvmRIYE_PkvU_PjXzw8-e1TDwEx01pgLYU0OgHD0V0kBmrHLqDm6CPkKlwuqUwjjscv1QUrG-Z-qvYQafqaG2zhfln6q3Cq0KZw7AAwD24UyQkbyDRPay02-z0wiRhrNBcv19eVWBVjqKR8l-2LM7oiSSZ2hZibZLiOtml1bdJozxrnQgoI7CjltdszOep7FZFsmIKJTVL7VLPfnk5IlFcTerx7wc4PRLA0-rvcOoXomtuGq-hAhHAOgwS9bHQb9CPXLrX3KD6T8mIQk8CHk0NCtPDjRUhVV1u5_hxLpwxRfQfH8NK_tziLedp1IMhpzN5fgtAsSagYcY6vmZ5ubhBLZvTYBcOOAAPfbt0N7ACfj4mDWzm8i6OsXbkuJ5966XUL7Tc34kRCXR84XnolgwzUPvz3yn-lxpI1le1l7k4lmlt36ySxDSB0-nfWP4RoQL7ICmZcVvgS5wfHh1GSeMY1pl1dDOn1m3z3r + id: rs_0bca03545c6c1187006a9f94895cc887d0b05b9e21b5ff730e + summary: [] + type: reasoning + - action: + commands: + - printf 'SHELL_ERROR\n' >&2; exit 7 + max_output_length: 4096 + timeout_ms: 1000 + call_id: call_Q3Oy92kgM83HSwSUtQk1tYxP + environment: null + id: sh_0bca03545c6c1187006a9f948b008087d081ceba5f4c1bb962 + status: completed + type: shell_call + parallel_tool_calls: true + presence_penalty: 0.0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_retention: 24h + reasoning: + context: all_turns + effort: medium + mode: standard + summary: null + safety_identifier: null + service_tier: default + status: completed + store: true + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: auto + tool_usage: + image_gen: + input_tokens: 0 + input_tokens_details: + image_tokens: 0 + text_tokens: 0 + output_tokens: 0 + output_tokens_details: + image_tokens: 0 + text_tokens: 0 + total_tokens: 0 + web_search: + num_requests: 0 + tools: + - environment: + type: local + type: shell + top_logprobs: 0 + top_p: 0.98 + truncation: disabled + usage: + input_tokens: 320 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 0 + output_tokens: 136 + output_tokens_details: + reasoning_tokens: 91 + total_tokens: 456 + user: null + headers: + content-type: application/json + status_code: 200 +- filename: t2 + request: + body: + input: + - call_id: call_Q3Oy92kgM83HSwSUtQk1tYxP + max_output_length: 4096 + output: + - outcome: + exit_code: 7 + type: exit + stderr: 'SHELL_ERROR + + ' + stdout: '' + type: shell_call_output + - content: Use the shell output above without calling any more tools. For each + command, report its stdout, stderr, and exit code or timeout outcome in + order. + role: user + type: message + max_output_tokens: 4096 + model: gpt-5.6 + previous_response_id: resp_0bca03545c6c1187006a9f9488a4a487d0bf23d9ab2df7652f + store: true + stream: false + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + authorization: Bearer *** + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + body: + background: false + billing: + payer: developer + completed_at: 1788843151 + created_at: 1788843148 + error: null + frequency_penalty: 0.0 + id: resp_0bca03545c6c1187006a9f948be7a087d0a49d937b93b2dd73 + incomplete_details: null + instructions: null + max_output_tokens: 4096 + max_tool_calls: null + metadata: {} + model: gpt-5.6-sol + moderation: null + object: response + output: + - content: + - annotations: [] + logprobs: [] + text: "1. `printf 'SHELL_ERROR\\n' >&2; exit 7`\n - **stdout:** *(empty)*\n\ + \ - **stderr:** `SHELL_ERROR`\n - **exit code:** `7`" + type: output_text + id: msg_0bca03545c6c1187006a9f948e5ab487d0839553d9e64b85fa + phase: final_answer + role: assistant + status: completed + type: message + parallel_tool_calls: true + presence_penalty: 0.0 + previous_response_id: resp_0bca03545c6c1187006a9f9488a4a487d0bf23d9ab2df7652f + prompt_cache_key: null + prompt_cache_retention: 24h + reasoning: + context: all_turns + effort: medium + mode: standard + summary: null + safety_identifier: null + service_tier: default + status: completed + store: true + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: auto + tool_usage: + image_gen: + input_tokens: 0 + input_tokens_details: + image_tokens: 0 + text_tokens: 0 + output_tokens: 0 + output_tokens_details: + image_tokens: 0 + text_tokens: 0 + total_tokens: 0 + web_search: + num_requests: 0 + tools: + - environment: + type: local + type: shell + top_logprobs: 0 + top_p: 0.98 + truncation: disabled + usage: + input_tokens: 519 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 0 + output_tokens: 49 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 568 + user: null + headers: + content-type: application/json + status_code: 200 diff --git a/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-nonzero-exit-gpt-5.6-streaming.yaml b/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-nonzero-exit-gpt-5.6-streaming.yaml new file mode 100644 index 00000000..6eda5d55 --- /dev/null +++ b/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-nonzero-exit-gpt-5.6-streaming.yaml @@ -0,0 +1,764 @@ +turns: +- filename: t1 + request: + body: + input: 'The local shell environment is Linux bash. Use the shell tool exactly + once with this exact action, preserving the commands array and its order: + {"commands": ["printf ''SHELL_ERROR\\n'' >&2; exit 7"], "timeout_ms": 1000, + "max_output_length": 4096}. Wait for the client to return shell_call_output + before interpreting the results.' + max_output_tokens: 4096 + model: gpt-5.6 + store: true + stream: true + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + authorization: Bearer *** + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + headers: + content-type: text/event-stream; charset=utf-8 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","response":{"id":"resp_0a08ff17c829b401006a9f9481cde487d0a42a7c94564763c4","object":"response","created_at":1788843137,"status":"in_progress","background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":0} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","response":{"id":"resp_0a08ff17c829b401006a9f9481cde487d0a42a7c94564763c4","object":"response","created_at":1788843137,"status":"in_progress","background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":1} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","item":{"id":"rs_0a08ff17c829b401006a9f9482775487d0ae24c5748f011721","type":"reasoning","content":[],"encrypted_content":"gAAAAABqn5SCiLvMvfrSrzUse7hvMvRgdD2DlEEIDkUGkxwOW1pxCYxzrb2bDYzQBOew-w1Fhpg_8MrPaJ6MW6WuGTbbsldMgIXH9Uo8uV6Rd8AvWMHD2Vz51Qj1lUAF8xv_HigQAH0A_Jq9rkg865CxSrbd9Ubz0Fp66RhO_uPPIh8iFHim-jn_V0tDfCg6ZG85f_vQ-tNohKA2GUJkKw-UqPjbmVMmJbvGPqG259mTO424a594zp2efxEUPLLt2TXfnx45Li89RrgmCj2IQDk3cv2xLfCKRAd8MF6x1QNIQpvLUga2f3vYt2mjLY3Ar94gm0dpEcmsclQoJmFb5DzIam4pwsWNtp80yjyw4qCOJvEGr_M4cItKavAFPKD9K6eDjkeqKHAwGkZJ6XbOeyJIHuoIjElnWk6hvXpj_hbGkw64dzXEeu59bj14yxuELHt_B5EehACL2B7koLZyC8Vokigh6gTdiITLwUCcP4p6e1S04vV5xnDchEP8gnIc6J8nOomdzUwITwTSFx2KsG6Bq5BkVak4e8chxj4JTQ1VYMDdTxP6I2cQcqQiXQiygG_piM7KOALsvh29ZsZ_T0CT3gf4gxZxrVBJzw2BaEtAYk6ZTuDrtQDUDLJWVowfJ2aLR08MiJRuZVMBguaLGt1igF4AZom4tN56UjccMBdPa61RDq8nCKjlxh-Uolki7vdvBlwpM4uc2p2pOrj1eQWlCWGOwPf8DxC9Gk9ugS4tCW8QWBWWMkura0TgyE7EUcztrSxI2OGK2csyMLEJNdfaXPChed2uFjfI6nW1SsTbXuC-93DN8CaMQ37tqSqBLT035BF9_YVh0Wc6hEv51MrJnF0Kd_eR4Kez9ehUJBeTQ10lenoLAPqvjDNQicjg0emnqNFmx3qVMDQSnoLs0esyh6pgx5E6qKoLcI6NIPi1csjuIVFrUIR2pKptca7hs7F9XRA2xA6C4-stkE05bt7DRuYJEgnmAwre-Fu_rCfn3Uv8p2wdgv8dZ_IR8dgxIrP8iagT_hTGYmmpfySjcUovK6MzNOliJrNjFsNKgI0S5tE6OmyARXjRSVb_CWNKADk4FRXdqWsn-FdCvQJi8EciL-S7twSgdzWurQQ8mCaVw-KVFUa2CMfbCTZQWTHjLF0DhT44_7QpSl1jgPJDG6oS6RA8IreSqQ==","summary":[]},"output_index":0,"sequence_number":2} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","item":{"id":"rs_0a08ff17c829b401006a9f9482775487d0ae24c5748f011721","type":"reasoning","content":[],"encrypted_content":"gAAAAABqn5SD7u4juOLqrtnIc1T1529YyQZrLHakYwnzuYKfcOg2F444_0LezF-r509Lwe1-f032SxWkUvOUZfOuCtMHVYguTxLk7AD6k1X5Q-NEvdnuwS8TFrXGhQ2rN_nuJ4vgWKNhofjWBZIzTyRrxGEGztBJWL6c2fdwItXoJDMFKVSp2p0Lxr1ND0oRMYO0aSBh8xJcxq2SEmKFHC2vrtvNqb15PAfA5C3PpYy8h7cHtmeIcm6NxWcxmuf_IXc6DbOOxbBFJNfqiMppgtAaLXKI3xaVH3WSIbvpE3C8O3XpiN2lZgZW2LXRXJ8NFOuttr0LFZtTQN0Wj4oSMs9vxF6mWNFvMHODvHw-bLQCuUT6JQAFTJ2IRsI-myp1DpecIzEw_vr88ObL5ysuFTHGBt5IfmG95BahuZVAwtUpyYhsU6RjPHIH60ECxmsPrtXnUGIXwYJJ3t2A0JTYDDZ6B_mK1eqYG3ohS1Ov-2jb46EhGvoDHEPpJ7aS6IyebDuh4_0WE9zlPvhCuC3L2uDN6p8Tj4z5P7zCxfUIY-mlHItYz4bDnWqEyJXkz6pUAwAV7k0oiNsyIbgkrst1QIG6l1A45cedppM2UaBxWsTzaVwEQuQ1SA1oBYFZvhQo-d1LWS7IGnW49H5ZxOUuvW9k0Bk-BwUcDTfCt8dy5EmZE603QeP-ZUu_jN84o76zivyfH816NNoDcisGLQASzDc6QAFjXRtsRTq1vKp5oZYGNmugnZvi7YCCz7Lm_1xAUK__CB0tsoQg_fVqWpq6K-qXH4ie8DspcYawsARc6uA6VipbKBNh8YenK-iq1DzL-mXfVU-ItG_pSWJBfS1BqBNK0GI-wpU0yrMqMWy58zu3yY8Xtn2_Z7vSco43-VaLnB15TsXLLvS6hvt9-jmhyhWLu3VcSa6tygHGIgcvBjxfKOP-e7pcaMEa55o8pfSb7zduUraDEUDgH2ZREaCefltlI_8Ce89NfKnCI4hVNeKC4myQqR7DLTmVjFawVDAbLM_CCnUKkPgMS3UQsZsUuEbfgNJANP5PziSPYtHye1ezSuaFMJD0D7IIDlAUDOKoJHjqVkNLARbi-_dYr3s4XC-SyED8bkngrMh6lcGYfAUWYJHrNAIDD-qrj4t3vWY0MiBagvWZj-JgfkxRRhACNOsDoJOW1zdD81ZBBkhQhDGd4q4CNGAxEupGp0zxee1kvgYEjBM5O8iLiuzpenpHfhLDNWQQs1MXkkgPUx8m0WqTiMhAjQ_Cl4RaeF4vkrHCReM4VGFAerZiW9GXvjThutkhBYvw-XLM0T3ZD5eJT7gk2TiZTSizd6kAp5EF8dz89PpNYhz4TpPvpOSymPmNSs_EakrVby-vYAsl6pxx45zMRyDxcB9-bY5QTzNzgOk4fekTqiexkBLTApaPab1yIjtLcCTITTNID1onKMEk6bpPndY0UpmLBHoonZ8RY4rgBGNl0Ui3Wl34zkYqwuXAlPtxj2pHvekvGcfwDjKgHYAl7e507TPvOn8f1VqCW61issuceUaK3TvTlzQnNv0U7XPlRCch3Hob9L_hF_VpgTT-n2sneClHXuVIhYUAF80CMi2H73CbsCgjLn7jGpiWcNQmBnFt_sy5IE0zEXWEJB6yJ-ZXrolsQd6raCZdeYu0NQL8ngLAa5KRaI51caOrk5Aev-ySAFfhjQ==","summary":[]},"output_index":0,"sequence_number":3} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","item":{"id":"sh_0a08ff17c829b401006a9f9483abfc87d09631269c2f91d8e6","type":"shell_call","status":"in_progress","action":{"commands":[],"max_output_length":null,"timeout_ms":null},"call_id":"call_xxq4oFRq9G2BMMwAxgJi4woV","environment":null},"output_index":1,"sequence_number":4} + + ' + - ' + + ' + - 'event: response.shell_call_command.added + + ' + - 'data: {"type":"response.shell_call_command.added","command":"","command_index":0,"output_index":1,"sequence_number":5} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"printf","obfuscation":"rRvlrD6C0U","output_index":1,"sequence_number":6} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":" + ''","obfuscation":"lQMYTwapzpqStc","output_index":1,"sequence_number":7} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"S","obfuscation":"SqDK28MADAv2nGk","output_index":1,"sequence_number":8} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"HELL","obfuscation":"oHJsdaPJuAJu","output_index":1,"sequence_number":9} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"_ERROR","obfuscation":"9HC2HgdjFR","output_index":1,"sequence_number":10} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"\\","obfuscation":"N7eFXQex8GBsd4d","output_index":1,"sequence_number":11} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"n","obfuscation":"0ENztGWRvlKqSUA","output_index":1,"sequence_number":12} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"''","obfuscation":"AQsGVywnpMOc9UG","output_index":1,"sequence_number":13} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":" + >&","obfuscation":"IzP1BQdO6ABxE","output_index":1,"sequence_number":14} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"2","obfuscation":"gw64RzVuXB1ms1n","output_index":1,"sequence_number":15} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":";","obfuscation":"ZUK63Ywv1MI1mwY","output_index":1,"sequence_number":16} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":" + exit","obfuscation":"wQZUozWoiK5","output_index":1,"sequence_number":17} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":" + ","obfuscation":"Uq9bvzimywG8SdN","output_index":1,"sequence_number":18} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"7","obfuscation":"3wSAO29WPi9gnPI","output_index":1,"sequence_number":19} + + ' + - ' + + ' + - 'event: response.shell_call_command.done + + ' + - 'data: {"type":"response.shell_call_command.done","command":"printf ''SHELL_ERROR\\n'' + >&2; exit 7","command_index":0,"output_index":1,"sequence_number":20} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","item":{"id":"sh_0a08ff17c829b401006a9f9483abfc87d09631269c2f91d8e6","type":"shell_call","status":"completed","action":{"commands":["printf + ''SHELL_ERROR\\n'' >&2; exit 7"],"max_output_length":4096,"timeout_ms":1000},"call_id":"call_xxq4oFRq9G2BMMwAxgJi4woV","environment":null},"output_index":1,"sequence_number":21} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","response":{"id":"resp_0a08ff17c829b401006a9f9481cde487d0a42a7c94564763c4","object":"response","created_at":1788843137,"status":"completed","background":false,"completed_at":1788843139,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[{"id":"rs_0a08ff17c829b401006a9f9482775487d0ae24c5748f011721","type":"reasoning","content":[],"encrypted_content":"gAAAAABqn5SDLUXqQ6PXqfqm7u6NJhyeC0cSbv4pr2AicAvXTLTHDUMIc21Rlud9uSMrKCeUkHCctUOeEtmdXT_QDf816dql8O9D_unA_DC95T7LUff84-y4-SMcX4I-O3AZXfNivw55D8IjSqvemYFE4qrzpMbV1Yn3MJ2Gbgw07YbWsX7eetgAmpZhJwbT2SZAYtZllWtzf5uTl25SkkV6OlEWtmg9PW19bRWnDA236NModYU5_s5t3uC8zonj3EHbQyJBmKditWCDl1gtuPIu0f02-ulzxL3cnRfsaeNYuvU7GrKE9KLejfhvLXR93-UvdENnzSBMuyB1QDcDrckYVrA-e6krIdDxWnK5QI672wK2_KjbiTY5W4Ms4rIwKCPL0qesw_YVpTXcB-IyqoU3hdCz2NQ82jJ93wl9qw5dSfw_RLykGV0CJD2DMi4zjcmeKAVnn4-DF3EU-KnV8uIXE7J_VXnQR9DXBfacgqJph7BDpYShUzM3YRgPJ9Honuafz6HaGk8kewGGwXgSzsyWjK1nivsk_b5gkIm62jPQcE2GxKXXWCZKW6hUISECJd30y3AIMEJ3jfk1drqosidmV_F8fXGRS4pQOu6LCFKf0pBz96tVxdS57aDsj8rasfuZ70JXx9P5fZBDOSDvPvcMTkwJvtwM4t3xwo9jcG7kERwUkv6HPXNA3YCFxR70qD68ieT9synhkgSQvMwFwx6UvDK1V0g77L4UatPMgcerzgDZfKDWUbYIjP6cioC3Tq6ash9ac-St3Dh3FnvWY_wPfKbZv_9QCyka-A2lli6tSmR3hotjydXW_6TaO5H-HTGu0QKBuTR0R0pEqDQoqv6SMPHV46fVofj3QwZTeBju3KjB-gIwdZ_WnIVj10oYmkXhZZL4UO_TAWhspE3pSt3W_ub_HJyMS5xBS0nhJJQO4ddqcFB-ldBNBAItqU9ivI6lGzYEiLya5l8oti4-nrJPH-zPLwUOzYA62zintxWct59Ob8aMSQe3aIGPVRH32sqP9u9luLVTQ0zWDLaUuDMfA97azAr8YSwPM43Ww2AgNEBgmFNLLa2cvIkPJIeBmT4vbGTkOfBAfaXdQjPnO33sF9NauE5wpBGS0-OhkSAiTEWB2xjV_Onp9Z_QSwJJX0zKjsjpn74QJthZO6-w0f9HM6dnpEmvvKWvm5kHnJoUzbHg-6PTmiGnb7pY3OSwg-uVZ0gb5vqgXxvYg8aLMBrrPdWv2HYVzsn2yeyTPH_I-8Zi1Nz_JDyUyLwphwgYWpoGZRVwjOS0lhxE-zVG_y-AO-Hz6OYrMpA_3-p8XLQzohbhXQPida_-GU-8tyZM1khOSvQwdtcr8v7pcqsj4hkdjZU315M3mQwbWZGyaB2_A3w2c2piNwE204dchIOhuKdDJajn1PhnR8AUhTKGps_PrCjzLyhX2FBphBRlt7ErurnFq8Q3lIKaVAVSLnjZ0pwB58TcWjh3pr6O_EV7gSaOOuGoEP1uyyVVXrikLtDgiUl7lfWw4em5Ne5-G2lHnyubBHAncF7WroTYLc0b7KJiAPT_6zEmiviKtfp2zaVmoudFc5U6RkU4WtQ_BboRgZ6ZQs70NgwuW3USYXIi-F_EF6ZxVyzjQDNmcu0EZw2CUt-IeidaGHCeLl1EybeCJ2ht2rEdr_megcZAz1-HexT5-8tOC0OE4A==","summary":[]},{"id":"sh_0a08ff17c829b401006a9f9483abfc87d09631269c2f91d8e6","type":"shell_call","status":"completed","action":{"commands":["printf + ''SHELL_ERROR\\n'' >&2; exit 7"],"max_output_length":4096,"timeout_ms":1000},"call_id":"call_xxq4oFRq9G2BMMwAxgJi4woV","environment":null}],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"default","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":{"input_tokens":320,"input_tokens_details":{"cache_write_tokens":0,"cached_tokens":0},"output_tokens":114,"output_tokens_details":{"reasoning_tokens":69},"total_tokens":434},"user":null,"metadata":{}},"sequence_number":22} + + ' + - ' + + ' + status_code: 200 +- filename: t2 + request: + body: + input: + - call_id: call_xxq4oFRq9G2BMMwAxgJi4woV + max_output_length: 4096 + output: + - outcome: + exit_code: 7 + type: exit + stderr: 'SHELL_ERROR + + ' + stdout: '' + type: shell_call_output + - content: Use the shell output above without calling any more tools. For each + command, report its stdout, stderr, and exit code or timeout outcome in + order. + role: user + type: message + max_output_tokens: 4096 + model: gpt-5.6 + previous_response_id: resp_0a08ff17c829b401006a9f9481cde487d0a42a7c94564763c4 + store: true + stream: true + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + authorization: Bearer *** + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + headers: + content-type: text/event-stream; charset=utf-8 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","response":{"id":"resp_0a08ff17c829b401006a9f94848ba487d0a3e13667eb1c6d1a","object":"response","created_at":1788843140,"status":"in_progress","background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":"resp_0a08ff17c829b401006a9f9481cde487d0a42a7c94564763c4","prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":0} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","response":{"id":"resp_0a08ff17c829b401006a9f94848ba487d0a3e13667eb1c6d1a","object":"response","created_at":1788843140,"status":"in_progress","background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":"resp_0a08ff17c829b401006a9f9481cde487d0a42a7c94564763c4","prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":1} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","item":{"id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","type":"message","status":"in_progress","content":[],"phase":"final_answer","role":"assistant"},"output_index":0,"sequence_number":2} + + ' + - ' + + ' + - 'event: response.content_part.added + + ' + - 'data: {"type":"response.content_part.added","content_index":0,"item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","output_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""},"sequence_number":3} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"Command","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"haOIUT8Hs","output_index":0,"sequence_number":4} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"8yPZ2bK3jnMJ83M","output_index":0,"sequence_number":5} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"1","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"fqY1alPDT7sT6kA","output_index":0,"sequence_number":6} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":":","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"0L4pzTq2ihtJLH6","output_index":0,"sequence_number":7} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" `","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"Q1WRUzP226klBH","output_index":0,"sequence_number":8} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"printf","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"jX98ZgesTJ","output_index":0,"sequence_number":9} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ''","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"ubksCtYkYuKMQn","output_index":0,"sequence_number":10} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"S","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"cSoQxZ1Jgnz0RPc","output_index":0,"sequence_number":11} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"HELL","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"0PXRVSnCLEbL","output_index":0,"sequence_number":12} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"_ERROR","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"kpt936fcin","output_index":0,"sequence_number":13} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"\\n","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"i5CNjAPl39Wptt","output_index":0,"sequence_number":14} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"''","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"g9tL0J1jOPzfxva","output_index":0,"sequence_number":15} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" >&","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"lUTp4ohJtCZPd","output_index":0,"sequence_number":16} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"2","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"j53offAb4x31xEW","output_index":0,"sequence_number":17} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":";","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"agqrHr0Jl3PUDNt","output_index":0,"sequence_number":18} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" exit","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"u5yxTgzE44w","output_index":0,"sequence_number":19} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"sfuMV6BmXPaNWGT","output_index":0,"sequence_number":20} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"7","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"kr3MmEhcNGgXM4x","output_index":0,"sequence_number":21} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"`\n\n","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"5K4PdFoA0Y55L","output_index":0,"sequence_number":22} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"-","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"O573zrhOMgbJw1H","output_index":0,"sequence_number":23} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" **","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"yWCNDPCDg4FCE","output_index":0,"sequence_number":24} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"stdout","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"VnsnRWs1Xx","output_index":0,"sequence_number":25} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":":**","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"DCjdKhRtoaX4t","output_index":0,"sequence_number":26} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" *(","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"5uveL9d1KLvqg","output_index":0,"sequence_number":27} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"empty","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"cgiVFMpiZrT","output_index":0,"sequence_number":28} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":")","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"YW76N5cI3WTZFt6","output_index":0,"sequence_number":29} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"*\n","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"1IcWD8RgcchljI","output_index":0,"sequence_number":30} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"-","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"xfEdo09KgPwp8bC","output_index":0,"sequence_number":31} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" **","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"tDhs5LEcb8T38","output_index":0,"sequence_number":32} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"stderr","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"Upi1y8FYwQ","output_index":0,"sequence_number":33} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":":**","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"7wLFbOTOI18FX","output_index":0,"sequence_number":34} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" `","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"qa6FTZPfeZxhcr","output_index":0,"sequence_number":35} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"S","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"vYC0u5kftliFm0P","output_index":0,"sequence_number":36} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"HELL","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"TrnkQtanI9xN","output_index":0,"sequence_number":37} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"_ERROR","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"1I4FJ59c2x","output_index":0,"sequence_number":38} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"`\n","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"R5F5qpQfgMxQb9","output_index":0,"sequence_number":39} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"-","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"zzt2uqiWEV52iPe","output_index":0,"sequence_number":40} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" **","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"QUUvI35fS8U6q","output_index":0,"sequence_number":41} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"exit","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"fAHzRTPVcvYO","output_index":0,"sequence_number":42} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" code","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"wkvQWqPAObX","output_index":0,"sequence_number":43} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":":**","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"BwvcjX4PHsf3Y","output_index":0,"sequence_number":44} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" `","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"Vm74Wt0iV3i0rU","output_index":0,"sequence_number":45} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"7","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"ssfLIW8PgWYR0sZ","output_index":0,"sequence_number":46} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"`","item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"obfuscation":"mBnZwuzIg03pubm","output_index":0,"sequence_number":47} + + ' + - ' + + ' + - 'event: response.output_text.done + + ' + - 'data: {"type":"response.output_text.done","content_index":0,"item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","logprobs":[],"output_index":0,"sequence_number":48,"text":"Command + 1: `printf ''SHELL_ERROR\\n'' >&2; exit 7`\n\n- **stdout:** *(empty)*\n- **stderr:** + `SHELL_ERROR`\n- **exit code:** `7`"} + + ' + - ' + + ' + - 'event: response.content_part.done + + ' + - 'data: {"type":"response.content_part.done","content_index":0,"item_id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","output_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":"Command + 1: `printf ''SHELL_ERROR\\n'' >&2; exit 7`\n\n- **stdout:** *(empty)*\n- **stderr:** + `SHELL_ERROR`\n- **exit code:** `7`"},"sequence_number":49} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","item":{"id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"Command + 1: `printf ''SHELL_ERROR\\n'' >&2; exit 7`\n\n- **stdout:** *(empty)*\n- **stderr:** + `SHELL_ERROR`\n- **exit code:** `7`"}],"phase":"final_answer","role":"assistant"},"output_index":0,"sequence_number":50} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","response":{"id":"resp_0a08ff17c829b401006a9f94848ba487d0a3e13667eb1c6d1a","object":"response","created_at":1788843140,"status":"completed","background":false,"completed_at":1788843142,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[{"id":"msg_0a08ff17c829b401006a9f9485e4ec87d08491ea5e78e0af3e","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"Command + 1: `printf ''SHELL_ERROR\\n'' >&2; exit 7`\n\n- **stdout:** *(empty)*\n- **stderr:** + `SHELL_ERROR`\n- **exit code:** `7`"}],"phase":"final_answer","role":"assistant"}],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":"resp_0a08ff17c829b401006a9f9481cde487d0a42a7c94564763c4","prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"default","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":{"input_tokens":497,"input_tokens_details":{"cache_write_tokens":0,"cached_tokens":0},"output_tokens":48,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":545},"user":null,"metadata":{}},"sequence_number":51} + + ' + - ' + + ' + status_code: 200 diff --git a/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-success-gpt-5.6-nonstreaming.yaml b/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-success-gpt-5.6-nonstreaming.yaml new file mode 100644 index 00000000..cc06ace5 --- /dev/null +++ b/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-success-gpt-5.6-nonstreaming.yaml @@ -0,0 +1,234 @@ +turns: +- filename: t1 + request: + body: + input: 'The local shell environment is Linux bash. Use the shell tool exactly + once with this exact action, preserving the commands array and its order: + {"commands": ["printf ''SHELL_OK\\n''"], "timeout_ms": 1000, "max_output_length": + 4096}. Wait for the client to return shell_call_output before interpreting + the results.' + max_output_tokens: 4096 + model: gpt-5.6 + store: true + stream: false + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + authorization: Bearer *** + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + body: + background: false + billing: + payer: developer + completed_at: 1788843134 + created_at: 1788843131 + error: null + frequency_penalty: 0.0 + id: resp_0d2fb655988faaf0006a9f947b240087d08c68a9537f3f3e15 + incomplete_details: null + instructions: null + max_output_tokens: 4096 + max_tool_calls: null + metadata: {} + model: gpt-5.6-sol + moderation: null + object: response + output: + - content: [] + encrypted_content: gAAAAABqn5R-qMzrhpfY55yyGL_98KwKb54soVWwMvEcVuzUxeLAGaxmxNMZ7qtzDWHmWx1WHDxR8qhZHt7FnPZJqgJaT7GkkDihHYAFGBzLvtRmt5XKSyvBkHpfHloYXXCHOIkgmOVBXuDghceosCIQT7FRjVBSOQBrEwfE9byvQWzoF2W8CpgIgWhFB_4CZ4ENoXJpVdl-ucaIEUqfFlqDnxIfjEI7ktZDf9nBDfGxHXBsYVrlyJ_XCZ5PyZ_keVi5daXuwMeps9-qDjzQmIg6PqIPBIeNDqTnyE5KZxLJTa1liAxOt6UvijBCg-tmbbMEqI19AE-L12-mvKCFzbmRx1ZHhqzaafmDSz5zIdJ4EGXYS-O1_PLRQgMus5Dd2ffQT9BBsHaIoTseZlftGiQ_AFk_Inf3lOgSKdCQ95_a2-KpVd8OntZgfpIlNcI3miJSOAE9LB9BcZ7MeOChEDN5nBhcWVooLaY8WGBhJN2KaGbxVfTgPcZnKVHEd8DeYgZS0P3iJktA6IXKo7qyicPadQsSZeq6rIuErbI_a_S-AJdKNhouRB1UF1R-Vxa7p5ZaifLNIHohOmq_TaYpS_KzFAOgZt2gxLr1dP7s3g-DSCTimQuN5H0wHQ2kEPWAmjc8nHTQUqvjsi9jvWoLxMHPkxXRjmupSaoSt3GS5Zm97J3Sv2UFtMIgblOisWchozi6C_7-rxn9L9LnUPoe83Cp6loAnmt21mGQ17JNj-OGjIIq95_PSuoDO05VNUKYUKwPFaMhha-0KxpNKBEIl7PN4XJT51PEkm4KRo6xKXr2WgkEk9vi8kO5cOs1HcQZ90dHicWEOEcDe4rwUMefbfxbrBto9u-C1GFWOWb9DihjwpasYkJ7jPAdVkFWqbNmYsTs5j-PSXUE-zE5bjSQ-eP-ozhqhITQlUnOUvkLn3ozAoiDr48a16JI-7OsWGj-Cs7iTFPxhGqQ9KhsoBlOkryx8alUfFqfMOK5zJY4TCxsmxxB_PQF7eFzjkstBRyxdNMukZFFd1o5LyIsCoN7nUKCgetuSefmq3NixbGOF8ylQTsTnzL8N6oXC_aG0m_TWqC9LE1otg2WiVwfg4cdhVbZq_RSA77jT1SBz9VZ8RLf9rZLYw5OOr6O0tfQuRH9tsROcFasYphDG0sZPAViJmUMQX270pR-1A5JtZheZOTbD98iu_g1tyyjpXYEGxHYXEruEyNw3FwtZ8craAvDhgBGyswM8Vy_U3Bqmg_Mh0QTAIWh0AVXRlFblx10Xm7rimxG1iwaQ-_GVzQriK2h53-Qj-i2YRcDBuqiGaoZ27aLVlKCsH0x795nadIPgLm9IDQq8e1jk5zyPfSvmAzLun2CXju88XU4wQ3iND4mvXpVo0Gyu63_pOeaowHZqH1oB8G6Kf7lsY-FUFTLsYfFTT_RB_07CITmyNthyIAE0fgUgofmVlPlRLQpq2GSMWvwJ12pmBRQHAyR1C4FcOCdid9iU3c4ToZaToOTdWh_aufHk7bZad14Do8S0c54lgqQC6N58H-1M9ZzR7cVET5_OnE_LSAAKNVrImGkGuh2CbJElSnYKRXOgP9NNOy0c-lDH1HkE7EwQUiPOfbB2Ca1FQF6Rb2IU4de-CNm8sA2bltAeMbaybn8KOsgMC8osnZI_xEgZAAulq2WeOzfihip0gBc_32r3NOcJg440LieuQdRxCVeDEMzwFJ7yamzuXygNR13eF0ytGm5yEH_dV7zb0c0SgAJC8VIskSFmFE3XuP4QKU5Ik6kWFb-TAeYeF-O3c39_ABg-9cmtMnuYF1miScU6vjFgDiTaAqt8sMRfVr-Zm18fBmCPQLV938-crLhPi5tscP1PH4q + id: rs_0d2fb655988faaf0006a9f947c071c87d0add00f0d0c6155f6 + summary: [] + type: reasoning + - action: + commands: + - printf 'SHELL_OK\n' + max_output_length: 4096 + timeout_ms: 1000 + call_id: call_oA7WtsxOcHnQE7xCPKcFmO23 + environment: null + id: sh_0d2fb655988faaf0006a9f947dbf0087d09b831815734fc46a + status: completed + type: shell_call + parallel_tool_calls: true + presence_penalty: 0.0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_retention: 24h + reasoning: + context: all_turns + effort: medium + mode: standard + summary: null + safety_identifier: null + service_tier: default + status: completed + store: true + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: auto + tool_usage: + image_gen: + input_tokens: 0 + input_tokens_details: + image_tokens: 0 + text_tokens: 0 + output_tokens: 0 + output_tokens_details: + image_tokens: 0 + text_tokens: 0 + total_tokens: 0 + web_search: + num_requests: 0 + tools: + - environment: + type: local + type: shell + top_logprobs: 0 + top_p: 0.98 + truncation: disabled + usage: + input_tokens: 314 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 0 + output_tokens: 141 + output_tokens_details: + reasoning_tokens: 102 + total_tokens: 455 + user: null + headers: + content-type: application/json + status_code: 200 +- filename: t2 + request: + body: + input: + - call_id: call_oA7WtsxOcHnQE7xCPKcFmO23 + max_output_length: 4096 + output: + - outcome: + exit_code: 0 + type: exit + stderr: '' + stdout: 'SHELL_OK + + ' + type: shell_call_output + - content: Use the shell output above without calling any more tools. For each + command, report its stdout, stderr, and exit code or timeout outcome in + order. + role: user + type: message + max_output_tokens: 4096 + model: gpt-5.6 + previous_response_id: resp_0d2fb655988faaf0006a9f947b240087d08c68a9537f3f3e15 + store: true + stream: false + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + authorization: Bearer *** + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + body: + background: false + billing: + payer: developer + completed_at: 1788843135 + created_at: 1788843134 + error: null + frequency_penalty: 0.0 + id: resp_0d2fb655988faaf0006a9f947ec4b887d0beab7b2312b99c97 + incomplete_details: null + instructions: null + max_output_tokens: 4096 + max_tool_calls: null + metadata: {} + model: gpt-5.6-sol + moderation: null + object: response + output: + - content: + - annotations: [] + logprobs: [] + text: "1. `printf 'SHELL_OK\\n'`\n - **stdout:** `SHELL_OK`\n - **stderr:**\ + \ *(empty)*\n - **exit code:** `0`" + type: output_text + id: msg_0d2fb655988faaf0006a9f947f64b887d092916891b8f7c083 + phase: final_answer + role: assistant + status: completed + type: message + parallel_tool_calls: true + presence_penalty: 0.0 + previous_response_id: resp_0d2fb655988faaf0006a9f947b240087d08c68a9537f3f3e15 + prompt_cache_key: null + prompt_cache_retention: 24h + reasoning: + context: all_turns + effort: medium + mode: standard + summary: null + safety_identifier: null + service_tier: default + status: completed + store: true + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: auto + tool_usage: + image_gen: + input_tokens: 0 + input_tokens_details: + image_tokens: 0 + text_tokens: 0 + output_tokens: 0 + output_tokens_details: + image_tokens: 0 + text_tokens: 0 + total_tokens: 0 + web_search: + num_requests: 0 + tools: + - environment: + type: local + type: shell + top_logprobs: 0 + top_p: 0.98 + truncation: disabled + usage: + input_tokens: 518 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 0 + output_tokens: 43 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 561 + user: null + headers: + content-type: application/json + status_code: 200 diff --git a/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-success-gpt-5.6-streaming.yaml b/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-success-gpt-5.6-streaming.yaml new file mode 100644 index 00000000..6bf4558f --- /dev/null +++ b/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-success-gpt-5.6-streaming.yaml @@ -0,0 +1,661 @@ +turns: +- filename: t1 + request: + body: + input: 'The local shell environment is Linux bash. Use the shell tool exactly + once with this exact action, preserving the commands array and its order: + {"commands": ["printf ''SHELL_OK\\n''"], "timeout_ms": 1000, "max_output_length": + 4096}. Wait for the client to return shell_call_output before interpreting + the results.' + max_output_tokens: 4096 + model: gpt-5.6 + store: true + stream: true + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + authorization: Bearer *** + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + headers: + content-type: text/event-stream; charset=utf-8 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","response":{"id":"resp_07d7a498ae5b0a3a006a9f947258d087d08e7f99302296db01","object":"response","created_at":1788843122,"status":"in_progress","background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":0} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","response":{"id":"resp_07d7a498ae5b0a3a006a9f947258d087d08e7f99302296db01","object":"response","created_at":1788843122,"status":"in_progress","background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":1} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","item":{"id":"rs_07d7a498ae5b0a3a006a9f94738e4087d0977c7991f30c1844","type":"reasoning","content":[],"encrypted_content":"gAAAAABqn5RzdbCMDj4gRJ4kkZ3R7yHCfOal3OvQDhSsQsZV4fI66Wd1VeVNfxcaYIyqtRzIg63MdkqZj8V8xukpguvnWyWlVBb0eFSFTehed0d3nioeOaTfN1nyEA10ouJV23XTcWu2pEGL7JOsB77-TDUoRGqemJxKIbZv3Zj59n156bBceknCSZ431C3byYF3m27WPor-Rm1SDzbc0MRDvhqOelapPHp6RiynKKyuci1-i6ViKYhLcJL3J6eff5dZ5rUw4wHlvBrSrHFA717wlJrLP6w6QHmyn5fqE7AT4D9Kl38bLEZIV_5m5uBkS-BIGM0U8aE_miY1HW7iFa2J8l3Efh4FkWDmpoFJv1J_19R2y9KSZZi6n1OXNlYOQE2kXehQTgab_8azkFMqwDTl_xCPn9UNN-yDYpyEj_v6e0oQF9D3fBNvsUC5ppwyFzdiEY5Oyp1CuFWKpB1RUhR1G_37D_jNX-lNYfpciJJafz_1l_1E8js9BjGdCRVpSkhB0jSu-XAefYr2xXfZJFcTPPuBIIf7-UKvC1G7cJb72RO3EG3DNhsvEJMmtpYEaR9L6YqVq0Pcumi8X5ycs_sTkvsPvupO1ara_3hIEfXAx1h002Gqg2qS5PFd_SKEFJ6WLJDw3V9GQ8v0xScIxZVTcct3CzqUyEzBgQX3K9OYi1UK2GNgbTgX7W-s9ozVpcyyLJF1pcIRULtKNfNhZ2OTjAR_RW6bPnyXpnwhKQn-VyE3GXqcMvcr839Hn144-A8_GpRtmHOruV9QEOSg4weMdb6PwVWANWssq9oFmYq1r6g_4UdKKttzjza-ghWjbRpP-U1ecIchX1tS1UQavcy_c6L5yuW9X_OjzJwlLMxATmLjP0B38fn-idslY5yEEArhLtkpPLupRQ_eK5bET8nAmrBT5-NaUBbKyvcejgMU9VSFb_O13tQtvjk_SX0JresRzglVexxmbjPfKktG3OpYNGORTNX501szBgTdBbfP9Ma5yyKtSAguIXWjb-q_JTPdWzWzEP3Le0k-Q0GjbT9nVy1gDwZsOhaGa4xMkQodN_X8o0D5XuBVUchU6MTf4i6uCMtVf0szdEu1dHGipUCoU47mb8aKrKKsWOFHvkwFzFN5Wjibgl7qhrqsP8LEzw1Qohslw7WixwvESoMSPNyvK0gKlHP5-w==","summary":[]},"output_index":0,"sequence_number":2} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","item":{"id":"rs_07d7a498ae5b0a3a006a9f94738e4087d0977c7991f30c1844","type":"reasoning","content":[],"encrypted_content":"gAAAAABqn5R26MTNnhT7AZ3yJr3DFaB5q7-eYKutBmr_xaYSEDExttDW6DARVzlHRA_mjrN_-kakTQiP7v0RC64oUnHDYk_kAvD3t4xyqqCfJzHaEHfIvkMCE1VCj3B4_xjnl-i0B8zD-6D9RtGUkUfhEW5FgiM67hSkPKT44MTcdAcYNuBFe_ZINCpyoboP0kXBBKhcnUcZOUml8ofQS98pNHA4nczMNrF8ZKqxsbnr-VKNJAoEWw4vjlMYVJLAED4SbD3tmO5mO0aplaNoadsv_bOAGNNLORa_dDg25FhnjLsygy0_SGr5b2AIPoz2-_uFBKsl0FSIjxAaNMGDQc-F3n6D0PiwVCEVaOSHQmoKMAQHDDSrJxZa3lfbHiGKyE9pXdVcUjdrAnJEobj1AO14Nc1Dqb6totCP-rWssCPeI4xzl7mVrkIglDc5MBkNXcQyhFfPeg89Il_A2mBMK-SAYqvLQ-VEXcSBHxhuX8Lm72sFW0Ao5iITL3Drif5ygQWgkvylNkgXYRTPS-oeVG-Ug-tIfA4ghTjtSsCbPvJc685iL5YwCBvKNrHe9aI__DhOeZc8NqwA5OKHaIthy97iJfpk1V5KVtb_eWP_D6_Q-_14s0vL5EroBTHSqjo316MOf0q4sJ0uc1zP6d1SeIWFYpHl-foV3-j6B36TIiBUkTru2R4xRul-RBOZfmrxYMxEv3JTuHAjBxzW0kExaqaEhozUEngnFNE3gIJP888vwWQj5OBeCxZncotxPAkEXB95eyrfrn3TT91aa6nOP8Pl0nopggMXzKsIBQp3JnMyQXp-aecneP0g5W1eq7HVNf2ILE8P-7V_LoRuwHmmafx2AdoyqHWrqoyD84qWvkM2HnYuOpqJmChMPnMY8L9s1Jz_2OBvcnjPERGH3Qr-mo1JtpCL0ZBnqqKfd41r4DnCgNFrmX0XA_yi9wOIX4CY6MZX3n50WHfCI5JTG9R2ia3Vji2A80-0MIzhV8CNZn4dxJ0CXxe0IvCRXvlbXMO8yFVgpCt-Aiv0nYvcnFkT5zTRh3EEhugrmLdE_qc_D4hM12G7rCsf_Fa0c5lFot2t24IF4-ivFyUNsrBjbolrnG2Jlo_SXotPbfJQ0ir48U2_Nqm6ysRRcRieR8deDLbB0cjZbDFFBJSb6AGmIh2Xj4aDmub9dK4wuGsqbJv5lV8rMxGQgxoZxej_8AK1Rsu3c_7ps-rCmWQkpyvm3wiVJHoJQwhfV3KKLnt4TxsTSmV82N3ndPcvtawJ7KBSFOCN69xUem_0cilXES_UISctgFmBQIdiwEOb52Y2gcEmTbQ2QWOU3mpNJak9cDSDyJHK8zmN8_30UdmJjI1EhDVfdvfyGdn8qHct6Clk5MJad1hwrHxAkBjyDkbegy_pO7MBu1-43SWM_llALkYAODFwrBL5j3uuDfOwMimbPqzXvTcxiu6J4AD5pCKVAkuU8hmiVoWQaJ88L7S-Z9PMSIiyaI_dtMy1KVQlDvRjtqdzAw3odYY0SoKoxVF-d70yx8yREmWpltToBoAyIMKBpk5BfTymg2cSkzE1YdL-oAPbY2SlKXB_WBm6WBhPmM1rhcrI2JUY6dfNrUAvI7KiT0PviATgs2biR_fZXy3Nt5xiCamAd-bJZNp237veIx-yQ5n1tg6zAb47sivwJsD_6aky8ThGwQYZec5y_1UJ60hpF1veCm_Cvjv5ofeRsaoQNPiirz6KexRsV1cvXwvYeN9Rc-Cc3glPG294Nm0z-NDT4FLQRii82AL_uKNJt2C24AG6joRoyEGOAF0hye5skgdME9g9RiSwjX3K_1y2vH9QHtRC_jOk36b02aoKlPs4dyuiZcEnTYHdQL9FG14SJWRiTrFjMZeMm3cq8Mew2nTntV29aowPWjMKLlKhawKFE4V026DOjmRtPBCpaEvNFwhNZrPtVOTRq9ui5TmwyCtQgH9b5UA2yE6k3w8RStZthGwbd_7Srlgtel-WVFc1YI1ItyRhLdWGp7IJrApzoEVNsaxAkWOjJr411p4yseo1gDh9c1ARANkrjY_9g4bGJVaaSeK5S_jrZDWZAQSDZkDZF0IVAo2ZIQbxTCB75IKvpso8wqXWYkB5XRrHmIgNdcucSsPCG_tnRiuhNQ==","summary":[]},"output_index":0,"sequence_number":3} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","item":{"id":"sh_07d7a498ae5b0a3a006a9f9476478c87d098506879a91087cd","type":"shell_call","status":"in_progress","action":{"commands":[],"max_output_length":null,"timeout_ms":null},"call_id":"call_bhQOvdPlmOUN5CMSCRJ502lY","environment":null},"output_index":1,"sequence_number":4} + + ' + - ' + + ' + - 'event: response.shell_call_command.added + + ' + - 'data: {"type":"response.shell_call_command.added","command":"","command_index":0,"output_index":1,"sequence_number":5} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"printf","obfuscation":"3OoQBjLXsD","output_index":1,"sequence_number":6} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":" + ''","obfuscation":"KHk1Yw5UwB7sbX","output_index":1,"sequence_number":7} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"S","obfuscation":"6GNMAOr9EWfuxwJ","output_index":1,"sequence_number":8} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"HELL","obfuscation":"jGOcyaUD8I0t","output_index":1,"sequence_number":9} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"_OK","obfuscation":"rXiKsXkhVmETL","output_index":1,"sequence_number":10} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"\\","obfuscation":"DOZQcoP3dgcmXvR","output_index":1,"sequence_number":11} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"n","obfuscation":"R7JCnbCKPkV7Ydp","output_index":1,"sequence_number":12} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"''","obfuscation":"QQmEKiKAxBwP31s","output_index":1,"sequence_number":13} + + ' + - ' + + ' + - 'event: response.shell_call_command.done + + ' + - 'data: {"type":"response.shell_call_command.done","command":"printf ''SHELL_OK\\n''","command_index":0,"output_index":1,"sequence_number":14} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","item":{"id":"sh_07d7a498ae5b0a3a006a9f9476478c87d098506879a91087cd","type":"shell_call","status":"completed","action":{"commands":["printf + ''SHELL_OK\\n''"],"max_output_length":4096,"timeout_ms":1000},"call_id":"call_bhQOvdPlmOUN5CMSCRJ502lY","environment":null},"output_index":1,"sequence_number":15} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","response":{"id":"resp_07d7a498ae5b0a3a006a9f947258d087d08e7f99302296db01","object":"response","created_at":1788843122,"status":"completed","background":false,"completed_at":1788843126,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[{"id":"rs_07d7a498ae5b0a3a006a9f94738e4087d0977c7991f30c1844","type":"reasoning","content":[],"encrypted_content":"gAAAAABqn5R2bV0u2Ze4NrS9vTKchdsRerQBa1s967I9ZGNWuMJsJc105vqafZQ8woYCP2bl7fSn_ddwbOufbYDbSjqFwEc1Qm19TBewDWHYV0KsbQRTyRUmQWc1PrMWGTII48UMHVOhc5RhHB3jmi6yXlWyMpT1JOx3H8ShPBbLbUKJuqySutbdr5MMBKClhbKf7Ic8N5xx1fE9A30dkbWsKBEg41gEYphHJ9llKrNMUOw7pwf2RE7-L7jH7njiynD0cQyIeBShMe4PQMRgENutsVbq6XfpDGzrtyP_bpZzwidOh-7SFx04Jdqc49waCX3wJ9NtVo_KD1UjAOZLJirm1WSaPYrlNL7YxJI2sPFlo5KcfqXj1jsVyr-2Bz4xkWBAyytgeu4ntj5p9ZbjaIobPp4R8QNprYYCzaOFjH9IeXHTETIP0ep5J6IL_UrtBhvLS0CPEtAaIkJNPLN7aFVY-sixZ7yC7Ic6zfltg6Yu9WuitgfLUg7gERTAnhKuOOKFLnRmhjI9Ap_w4bVG3xTkUujUjDchHwVAWRqStYq0BXsVoem2WlX2J2ygdSPOhzifvIpEBbZcrFiNg36oruVKbRd9yPRj_ZcAyUKpjJevTiMqQYHAU1gxxPgKY99nZ0chbsWnS8iD5bqJhK-Q40Z4FuEUHvm-_IEEnN-TE5oqegkqXkeFXr7vxyT1LRmfMhGWwEu5z1LE0ZFenFIl6D5bOub-IWya8wTqbJRLm4iAM8toy8RM-s6C9V-kGAzCmjWIDP3Xy5HpvY6gspbH1dZl_Gx8CRBp9zGgAKVyLWGMsVAJFa6vh2n6HVF-coJwFMFD9t0jqxWhNtJDTOY7wlEXaS_AiJLZHQiMh3JOH4HZaTP2dj3mRcNXQW6kUoHw5zkiMsel5cVeJieYjA0L8uUIOCBIXkvKmz57baLgnK_4dplrR6FP1pj-eTUMLDc9ZVXzcHRc5TbXPMm0PptYlkkj8NhYRnhy-0J1HgVxpm4g26XctrpbRsgOnRqaIO_PahLt065nRe6dOrtZM2NeO5BdR0gIUW_tKDnq-h4831bR5H9-pTsIwO_yu-hBkTZS_Vfjj7w_AAjECBiLL79B_IFuTKy7V5tk8LdTsB8x4isOqT2pAa1OuLows_ZLxBtKiqEAgG1mGU-bcNGgVPeOLIKLBfjM9BiWspES1uCQMdPYsafTuK9vRW5zaBZ_VmVpSdlYHnGXNMndqSzBkAoEmJuovrAzILPe7DhYgNvROUXddqvqHV-b_8NquOQ9Oa7C7jvb89pAZJOlZP637RUFsyf6dafT7aqxs1VzIG5_qg1eUSkH5LsQJPeaCoqQ9fEO-mezhNaWjSfC105mRDtAgXF6o-2VlhZFz9fEcm8eddzYXozoxxzeOMkzart7ttz7ja63LpQPebNVs-ir9HOpsLRo2TmP9EyLhdc3byt4gNUxYgZmk8xXWteSiCBHXAvqcmVpWPv4pF32607jHauiRXD2KEZD-44J1Gh_5tDpHLThd0TNGU5GSKUxMw9k9aSbguNfglQgaW9pP1jXBuWs8v9XCcqbVhiwRdvYDsHjqTxCek1hBiQMyMTMTZORIybCuKPfrbHwkdX2YMfoDLSnYz8_-sIjcXHrqFO0kuGSl2zNraAgtlFZLvyP_ZuVBiylrWu21TG4fkhUC_ZajMYHfCbT545TYviSLc1ePCNHha8Ia-ONl3FZErhTQwJw8lzZC9SHKkVyLhH_Cy3tGpyj0PfQ2p8ajZQFlZ3wrEgYihq59_PxpD7e5qfr2Et8oO-gay6SuKkgW6QTxcQqPACLu_B5p2hWp7-uI8e0SLw_ZoYTyHci4QFGruIaKFYyn_hVMVajybdzWu5C0eFY09b7D95Xt94fbo0ktbwU6lOAxxXw34RIagT0-0SGQKnqe0GVDPKqI-3gug2ERpTll84O8DlJJ_Wq8176RX2QCPW88ZKYzRW2YxTASTrskBvxVxDvc-5VDmSCv9KKAmUVzBg622xxwvoIWwPrHed6dchI_u50P7BZ98lWCQX9IimQYRF085LUKU4jXx9FN9yPr__SpKck9GIlglcLlYaJ5PkXYsnG96C5T9oQaxP0yxjZmeyjgSY9PQEAMidKO15yloOjGRySnzWHvWgsgQ==","summary":[]},{"id":"sh_07d7a498ae5b0a3a006a9f9476478c87d098506879a91087cd","type":"shell_call","status":"completed","action":{"commands":["printf + ''SHELL_OK\\n''"],"max_output_length":4096,"timeout_ms":1000},"call_id":"call_bhQOvdPlmOUN5CMSCRJ502lY","environment":null}],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"default","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":{"input_tokens":314,"input_tokens_details":{"cache_write_tokens":0,"cached_tokens":0},"output_tokens":183,"output_tokens_details":{"reasoning_tokens":143},"total_tokens":497},"user":null,"metadata":{}},"sequence_number":16} + + ' + - ' + + ' + status_code: 200 +- filename: t2 + request: + body: + input: + - call_id: call_bhQOvdPlmOUN5CMSCRJ502lY + max_output_length: 4096 + output: + - outcome: + exit_code: 0 + type: exit + stderr: '' + stdout: 'SHELL_OK + + ' + type: shell_call_output + - content: Use the shell output above without calling any more tools. For each + command, report its stdout, stderr, and exit code or timeout outcome in + order. + role: user + type: message + max_output_tokens: 4096 + model: gpt-5.6 + previous_response_id: resp_07d7a498ae5b0a3a006a9f947258d087d08e7f99302296db01 + store: true + stream: true + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + authorization: Bearer *** + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + headers: + content-type: text/event-stream; charset=utf-8 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","response":{"id":"resp_07d7a498ae5b0a3a006a9f947722e087d09506da37cfbf0160","object":"response","created_at":1788843127,"status":"in_progress","background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":"resp_07d7a498ae5b0a3a006a9f947258d087d08e7f99302296db01","prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":0} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","response":{"id":"resp_07d7a498ae5b0a3a006a9f947722e087d09506da37cfbf0160","object":"response","created_at":1788843127,"status":"in_progress","background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":"resp_07d7a498ae5b0a3a006a9f947258d087d08e7f99302296db01","prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":1} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","item":{"id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","type":"message","status":"in_progress","content":[],"phase":"final_answer","role":"assistant"},"output_index":0,"sequence_number":2} + + ' + - ' + + ' + - 'event: response.content_part.added + + ' + - 'data: {"type":"response.content_part.added","content_index":0,"item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","output_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""},"sequence_number":3} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"1","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"wIwBQWpaMsR5fZW","output_index":0,"sequence_number":4} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":".","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"vgUr4eshGCLi71r","output_index":0,"sequence_number":5} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" `","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"sSvMW2nZ26hqY7","output_index":0,"sequence_number":6} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"printf","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"MqB5NJkx6D","output_index":0,"sequence_number":7} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ''","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"J3KsN7RcyM4Q3c","output_index":0,"sequence_number":8} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"S","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"Bjd4ZEqbYyADtOX","output_index":0,"sequence_number":9} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"HELL","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"sZrpgwL2m1Zk","output_index":0,"sequence_number":10} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"_OK","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"x9jcorBtB7yR3","output_index":0,"sequence_number":11} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"\\n","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"0sP77oWSXttWVW","output_index":0,"sequence_number":12} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"''","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"RJgK3HpcNRsMtq5","output_index":0,"sequence_number":13} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"`\n","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"ZDfbyjlwysTrWF","output_index":0,"sequence_number":14} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"bpx3C3UyxgfD2l","output_index":0,"sequence_number":15} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" -","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"osrptijr2mghHI","output_index":0,"sequence_number":16} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" **","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"1JFBiht7tznUe","output_index":0,"sequence_number":17} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"stdout","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"Zj3UfOJb61","output_index":0,"sequence_number":18} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":":**","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"dN9y6ObKp610N","output_index":0,"sequence_number":19} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" `","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"ZMX9dpxwqcE0Zr","output_index":0,"sequence_number":20} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"S","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"23zKt5Kn1Tyrs8Z","output_index":0,"sequence_number":21} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"HELL","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"TnKxBfnqto7s","output_index":0,"sequence_number":22} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"_OK","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"mimME1ShSkukH","output_index":0,"sequence_number":23} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"`\n","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"IhD95HrUnB5EJR","output_index":0,"sequence_number":24} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"iNDIkPJsd9ISTz","output_index":0,"sequence_number":25} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" -","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"q84aq1mTw2j76n","output_index":0,"sequence_number":26} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" **","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"U15aG27Ulnpla","output_index":0,"sequence_number":27} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"stderr","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"tdu5Hl0ILp","output_index":0,"sequence_number":28} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":":**","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"eBpVC6PEpZUq4","output_index":0,"sequence_number":29} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" *(","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"dlsgY2Tw0VfzQ","output_index":0,"sequence_number":30} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"empty","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"OnGFfQ25kig","output_index":0,"sequence_number":31} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":")","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"NeLZlJCdTElGzFI","output_index":0,"sequence_number":32} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"*\n","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"Hccnujav0WxrIo","output_index":0,"sequence_number":33} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"WsnOFI2COk1LDD","output_index":0,"sequence_number":34} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" -","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"PJaw8yCwFWfX4y","output_index":0,"sequence_number":35} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" **","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"chxxC6jroqanT","output_index":0,"sequence_number":36} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"exit","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"Nl96ye0IkMni","output_index":0,"sequence_number":37} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" code","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"TIxTAFLN5bp","output_index":0,"sequence_number":38} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":":**","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"RiYlmuRxMiOpC","output_index":0,"sequence_number":39} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" `","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"32cdlhORl7qTlt","output_index":0,"sequence_number":40} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"0","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"U5Uko59L6VGTiC7","output_index":0,"sequence_number":41} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"`","item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"obfuscation":"gZrfiqZQyH5DkvF","output_index":0,"sequence_number":42} + + ' + - ' + + ' + - 'event: response.output_text.done + + ' + - 'data: {"type":"response.output_text.done","content_index":0,"item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","logprobs":[],"output_index":0,"sequence_number":43,"text":"1. + `printf ''SHELL_OK\\n''`\n - **stdout:** `SHELL_OK`\n - **stderr:** *(empty)*\n - + **exit code:** `0`"} + + ' + - ' + + ' + - 'event: response.content_part.done + + ' + - 'data: {"type":"response.content_part.done","content_index":0,"item_id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","output_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":"1. + `printf ''SHELL_OK\\n''`\n - **stdout:** `SHELL_OK`\n - **stderr:** *(empty)*\n - + **exit code:** `0`"},"sequence_number":44} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","item":{"id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"1. + `printf ''SHELL_OK\\n''`\n - **stdout:** `SHELL_OK`\n - **stderr:** *(empty)*\n - + **exit code:** `0`"}],"phase":"final_answer","role":"assistant"},"output_index":0,"sequence_number":45} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","response":{"id":"resp_07d7a498ae5b0a3a006a9f947722e087d09506da37cfbf0160","object":"response","created_at":1788843127,"status":"completed","background":false,"completed_at":1788843128,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[{"id":"msg_07d7a498ae5b0a3a006a9f94789f1887d0a8f0c4e77ba3a75a","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"1. + `printf ''SHELL_OK\\n''`\n - **stdout:** `SHELL_OK`\n - **stderr:** *(empty)*\n - + **exit code:** `0`"}],"phase":"final_answer","role":"assistant"}],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":"resp_07d7a498ae5b0a3a006a9f947258d087d08e7f99302296db01","prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"default","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":{"input_tokens":559,"input_tokens_details":{"cache_write_tokens":0,"cached_tokens":0},"output_tokens":43,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":602},"user":null,"metadata":{}},"sequence_number":46} + + ' + - ' + + ' + status_code: 200 diff --git a/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-timeout-gpt-5.6-nonstreaming.yaml b/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-timeout-gpt-5.6-nonstreaming.yaml new file mode 100644 index 00000000..f98db2ba --- /dev/null +++ b/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-timeout-gpt-5.6-nonstreaming.yaml @@ -0,0 +1,230 @@ +turns: +- filename: t1 + request: + body: + input: 'The local shell environment is Linux bash. Use the shell tool exactly + once with this exact action, preserving the commands array and its order: + {"commands": ["sleep 2"], "timeout_ms": 1000, "max_output_length": 4096}. + Wait for the client to return shell_call_output before interpreting the results.' + max_output_tokens: 4096 + model: gpt-5.6 + store: true + stream: false + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + authorization: Bearer *** + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + body: + background: false + billing: + payer: developer + completed_at: 1788843164 + created_at: 1788843159 + error: null + frequency_penalty: 0.0 + id: resp_0259cb43815e378a006a9f9497c3c887d0ace172acb518580c + incomplete_details: null + instructions: null + max_output_tokens: 4096 + max_tool_calls: null + metadata: {} + model: gpt-5.6-sol + moderation: null + object: response + output: + - content: [] + encrypted_content: gAAAAABqn5ScO7ZOeFb8DdarapETwHFsT16ky6pvNx8bAyfXfNyRiqJnAao4cJnEwSiPrObNlZuz1_dAMdqiLW4uzU62jZ-eLJRwHeIAbeG2FRdAldwJ-pXU7pj6TDrEHxiwL-vpCDJhfJC7kRnGHtGkJ4XQqchKQ6zMPz5JljIQxg7AtywOsuzSZAUC-YoK2ZVdAOZg03nueL4nBsf0LrcitciDxlaLU7Eh5v510kCqBmUYbrG08702z1kx2aDDa4zDNJrHP7D7d43YCUalNT3NsiJmTJ_bl2OTrcNy0Dzi-mmiPRzuFr8frwLyOK6HEeaf4P7sSNYOjrORcowYxXOishrEd1uZ2NP7URFkl-JFhsP6CfG0GxQ277PZERAIfTxCKHNL1lRvxgUsu27P72DPmM0rimLF7z2ftaGSCb01E4k-R2qqQCb7PUt94dbhqyWKRif8Aaas2JHXV61kLBAHSOcngQ8FJteXa4oIZ3DpKFPVby0p5x7yPbRN6U8N_GHCqqEvGWdmTRpYfZmSLRN7nlyXjm0NwYoO6M9E-SwO_5IuBDqpdGG-L8RY15rE2cIRgnrLxKxKNCiTpkk57uENSEG4RDGxRke0taIoUyHY-j2S6DsLfeLeeggO1Y8npS6AMxqqWGGJ9nWO2bPZb9N0wb4rLiEQgQXIUVss4dBHI_sVuW-Id-OylEnTkpwm9r1JE-Q68P8sLrK5ODHpAFbLYN3VF1WxxURHAjl3wldPv0MpEtWLw9IyhbTQGfOVlySs6v14t17aZ3_qP7TlDiaTMHAp65HG0d-fiisI735qnPFZv8filaif8tmfFcd-qaPZlzm2IGGo-N9cUsHOzcQg5OyLy-Y8-Wl6binfd8sF8F5hD0o64jxmTDzanEwBVtGEdfoqa64aNoZTUhP8O1hXM8wu01mVUIPvubvQ7dkN4ueClBL0uQk2j6JfLhpuNJNb6WBGlTu-3n2YdbKjlUnq7zuuNh_6NZA3VfgrWgH4Xi34NOkxU3ctxLHHjeh4pSJlAnXeTGt1Nb9heMYkgC06FdTxI1UenGE8qterbrexKE7GMolvSt9P_TWaC6wtuHQO3uiDgJ3aKy9Ilf6OXlXQ0BtY0RSxxDvOHXayypX0aYZFPFR_lMhf9s_GRMIHcPjCSgE3AVI31tWZvgE6ptxtuG5eBJg3_o9ln3NvzP-dbNhljQkPSbERTcC00WId3QtH8wUOS1_7xyA0b4E8O2fPJWjnKjZ9c65Fy3DuEDKNnVBxyErOITd07MRshgBOhoYv9UHWvBkBLam2-Q1gsXQIDjSq5pJDCwvJ8UnydybE_nu3yQ0uwCMANjW6kgF1POSa6Jmv6A_yCZ3vojmLUMTAEAhm0YZGss-1APTLYRP7iteOTTzYzO4D04PZah4ML9MAn4Vub8oTQRMtNqJzP8xx3DFvhydPjrhqrW3diScscYOGbXi_aWFi8fzWWoTNmsGFhzZzI_tNfgqnknpi0rcEYLKpEhmqNLg00HNBrRR_CxOvx_LmVIXWkYFFyYiM_bTouyj4OXgTgltCw3yc9mfEhtY36wU70cQg_Hx6r_oMI0-e1lbGbEYe5HFxLt_no_P-ywt3JkSs43aph0wPkBo3RvETQZGB1TgzLzfCaIUjXAJaeyQc27ON44sQUJtb-meW154Bz5vHDkUN-6C6Y3Lgzj879iZE0EzpF3d_SQWbCB6t6SgrfVSSixBdUPzKYoWd3UMuYJyPXCwHxca4FPeSs4Gy6Keq1dHKTgTz1vwdQ1fOK_5r9Xk9KYsurEdn5zqY08XnMVdkocy-vqOIQBSWJuc7HnDQRmNJNLc3fJJw3Wvm00CC3-dcsxxYq_R2t_96nYf6JzhFLb6v6qRGqFcZg75X2H98wJ1F-sVUAitdI2aJEkcQjH3QqWuq44Q6VDTSgaO0RbxpA9FajOlMAMohbohyXEEvgkKIamiBSxW08Vept_3BVgmGSacBuuUCBwrjjz5iMohvFWj2RZ31EMXCvudlWiVl0NHJISTS10-OvcE7odYUjJIleOvAPO4M6udvaTp9vFtTUr9VY5zCV-aTFE2_QhvD_Q== + id: rs_0259cb43815e378a006a9f94988c9087d0a5b7b3272ca557f2 + summary: [] + type: reasoning + - action: + commands: + - sleep 2 + max_output_length: 4096 + timeout_ms: 1000 + call_id: call_ybyWU3DANUnWih0yV5b3mhK1 + environment: null + id: sh_0259cb43815e378a006a9f949be30487d0b470a2c59f94aa23 + status: completed + type: shell_call + parallel_tool_calls: true + presence_penalty: 0.0 + previous_response_id: null + prompt_cache_key: null + prompt_cache_retention: 24h + reasoning: + context: all_turns + effort: medium + mode: standard + summary: null + safety_identifier: null + service_tier: default + status: completed + store: true + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: auto + tool_usage: + image_gen: + input_tokens: 0 + input_tokens_details: + image_tokens: 0 + text_tokens: 0 + output_tokens: 0 + output_tokens_details: + image_tokens: 0 + text_tokens: 0 + total_tokens: 0 + web_search: + num_requests: 0 + tools: + - environment: + type: local + type: shell + top_logprobs: 0 + top_p: 0.98 + truncation: disabled + usage: + input_tokens: 309 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 0 + output_tokens: 158 + output_tokens_details: + reasoning_tokens: 123 + total_tokens: 467 + user: null + headers: + content-type: application/json + status_code: 200 +- filename: t2 + request: + body: + input: + - call_id: call_ybyWU3DANUnWih0yV5b3mhK1 + max_output_length: 4096 + output: + - outcome: + type: timeout + stderr: '' + stdout: '' + type: shell_call_output + - content: Use the shell output above without calling any more tools. For each + command, report its stdout, stderr, and exit code or timeout outcome in + order. + role: user + type: message + max_output_tokens: 4096 + model: gpt-5.6 + previous_response_id: resp_0259cb43815e378a006a9f9497c3c887d0ace172acb518580c + store: true + stream: false + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + authorization: Bearer *** + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + body: + background: false + billing: + payer: developer + completed_at: 1788843166 + created_at: 1788843165 + error: null + frequency_penalty: 0.0 + id: resp_0259cb43815e378a006a9f949cee4487d090a56faf0da3a0d0 + incomplete_details: null + instructions: null + max_output_tokens: 4096 + max_tool_calls: null + metadata: {} + model: gpt-5.6-sol + moderation: null + object: response + output: + - content: + - annotations: [] + logprobs: [] + text: "1. `sleep 2`\n - **stdout:** *(empty)*\n - **stderr:** *(empty)*\n\ + \ - **outcome:** Timed out after 1000 ms." + type: output_text + id: msg_0259cb43815e378a006a9f949dd91c87d0b49249c2c56ddbbd + phase: final_answer + role: assistant + status: completed + type: message + parallel_tool_calls: true + presence_penalty: 0.0 + previous_response_id: resp_0259cb43815e378a006a9f9497c3c887d0ace172acb518580c + prompt_cache_key: null + prompt_cache_retention: 24h + reasoning: + context: all_turns + effort: medium + mode: standard + summary: null + safety_identifier: null + service_tier: default + status: completed + store: true + temperature: 1.0 + text: + format: + type: text + verbosity: medium + tool_choice: auto + tool_usage: + image_gen: + input_tokens: 0 + input_tokens_details: + image_tokens: 0 + text_tokens: 0 + output_tokens: 0 + output_tokens_details: + image_tokens: 0 + text_tokens: 0 + total_tokens: 0 + web_search: + num_requests: 0 + tools: + - environment: + type: local + type: shell + top_logprobs: 0 + top_p: 0.98 + truncation: disabled + usage: + input_tokens: 522 + input_tokens_details: + cache_write_tokens: 0 + cached_tokens: 0 + output_tokens: 44 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 566 + user: null + headers: + content-type: application/json + status_code: 200 diff --git a/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-timeout-gpt-5.6-streaming.yaml b/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-timeout-gpt-5.6-streaming.yaml new file mode 100644 index 00000000..f5c18437 --- /dev/null +++ b/crates/agentic-server-core/tests/cassettes/shell/shell-openai-reference-timeout-gpt-5.6-streaming.yaml @@ -0,0 +1,576 @@ +turns: +- filename: t1 + request: + body: + input: 'The local shell environment is Linux bash. Use the shell tool exactly + once with this exact action, preserving the commands array and its order: + {"commands": ["sleep 2"], "timeout_ms": 1000, "max_output_length": 4096}. + Wait for the client to return shell_call_output before interpreting the results.' + max_output_tokens: 4096 + model: gpt-5.6 + store: true + stream: true + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + authorization: Bearer *** + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + headers: + content-type: text/event-stream; charset=utf-8 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","response":{"id":"resp_0b9b92b07af80391006a9f94911b8c87d0819c29aa782a35db","object":"response","created_at":1788843153,"status":"in_progress","background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":0} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","response":{"id":"resp_0b9b92b07af80391006a9f94911b8c87d0819c29aa782a35db","object":"response","created_at":1788843153,"status":"in_progress","background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":1} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","item":{"id":"rs_0b9b92b07af80391006a9f9491f85487d0bcf85a53b2fb4bfb","type":"reasoning","content":[],"encrypted_content":"gAAAAABqn5SRnI_Td4AE_YYMCC2tSEkx76Vmkun6ZiVUbbApqRtPsoIcZNc_hk2xCupraWSU_HL7Ps9yFuaR6zBDSdmv_nO5x55k7dajFer8e0VeOSBhB7VHt17nDru-hBRZ4YVTpVFJQMAZsvle4ewWA2rZrTIOxrQQ-LQ3Kowqj_LH30bG6nl6652FAo8h5V_wgnS1pztmZxpUGkMgAVyfnN2_ZLEp_csjeoX8gWBDw2HrV-K3Kj3ghNWoHvXN5OsBfpqkYOy9t7XF-8Okn84MKNH2FTVC1LXDFKtCNnezzOA1ULXDUzdRzmqMFaywZQRzFJEyDGBfdThfdZRmyMv_bRLnTZ8lD6Zrg60OkrVzlsgVT4HdeqLDR8U0Qv-bNs98DzdP5dq0XjNjvjP_FkfSD3UFzq8U9vPeiN_bbQGNPNtrYxuBdblVDUR9njWvI301lE8FC3XQ_HMgHRNwBCCeJJFdqg5zc-VMvSPUiJ5YkCD8KNgH6kFgHRl8owRw3Q0qmaVTNvgMKW4LSaN7xr8I03UOiueH9fOG2jrhzIKvgugWAHCdAaN_U1olHMrgM-QEl7xWHzi6qO5GnXrhPNuyvVCvcZ8gC9nwlm2FRgKkmp43vnXG73VYCifZV7bsN_uF_OhFPhY8F0fxPJ-npdiFwxqobuIXkBiWBt58M6yD2_ygtafPaecb3pS42GpzWVnbLBTQ9Ef_w2x1s5JzyJLj7g5A2ntoQl3RXHceGCK_XqZ6BET53d0RyEAS6uEGK85OpEqGPqOQaEc1IpEsAtObByfqLJjx5HuWrarjlxoo2lWcVI6KzFEVLuqq0-r0aE3sH78wbtnIBY3Xhbm5boN-VE9H4Zwntqp8X-lTHkKj0xJyRrKjxTDWYOO_L3B9b0TVprjRegrWZ2t9FYG6GtZFLlfbPGyeJe8NSRVWyuQNixEVLDsC8wS367idWkw24SJyfIh7qIkEYrkz9N0Hnkc_7bY8mhWaQT3j5Mycnmsh4lfGuANiH4ixdS6dyMjpg9O4hHgCCaY_2PqiVfPTpS5nMiu7lOpErR_uYsK0zVgUuHVImuRlgHu0iYjlA0sxS3TxbGbuvALWi-q2BFmaQkB2M-r799edsZe04y5N0hPJ50zp5qEEip6qaYLipt4dN0-QHSSeupKCX0XUc6UfChSQntgh7VDfPA==","summary":[]},"output_index":0,"sequence_number":2} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","item":{"id":"rs_0b9b92b07af80391006a9f9491f85487d0bcf85a53b2fb4bfb","type":"reasoning","content":[],"encrypted_content":"gAAAAABqn5STd20cTOvYFtqJa28hMulL4inW9HI8VLpvaWsttUTAV9Dmo0MFC7VTVu7zy68GqQlBzt5foNzN89v0xNCsPwr-tWL7kcW9OjCBNeIzBSrvFNooShhVkOtWCXM0oU-d08fQveEnrm0CTXMyoOTzm5nJNbYlvDsa8r8wZOPfpfS3fcPc6UUoN9bnyEnqBBdAUiq2JbGut_fvw4_hx4Pf4BOiliLqBfh-fOXB0otzHpnk8uYdC-yGaiO__w4_qpphIWVwKg_DXtpXkLGlKCEs-UYlB_L5d0HlsnavgQymt2ltB3TP5qaKCBMwURascioWbVA_oM_hrBuMCbrteMOIqB74tpa3MQMBk4vAvckkkKOTDbq2rxDo3GbB8nU9B20N4hGOoycURVBjW3lFMV84hrXNNIs_6EKE2mwYAX8T2tTb0bqEHOR-SsoR-wDPiK4xIY9ZroKv4E6iNJGTtnbgBkiekT1AS51vZEM6YlcP_w1rIN7KxDeiCqx67NNh6aAIN5Z_L37Hyx2bao6AR2gFgpRC6I7Zx2PzIrftNX8yPr8b68Za4hk2Hfyq02aymdo6J-5CSwhmL1MBgRys4p36CZLm0AbU6ki5qVYpcgmsg-UIEwP6-oyTT6X_Vw9K_yUn6blV0zMwn_WbGZv62k6v6MRnX4eu9YpY2YZ48rQfkReR8ToiQ6W1Gw0_RZytXYODE7VBTyJKLW5yI_Cp1sjHfoo7js0sy5d_CtQnFfWGgxCSY0X_NmYK4EMmR3m_ewNyewXTctG_AeNzhOK8KesyQCZW3ZOG7CS3JS8iDy0CSgjEncYgMLq9sMxbyLMxa8ixLBCmOIQk9skgC7KbhU0PHattlCK86le5y8_2RuAW_fwVexFoi4K3eO6eQzwr4txHUesxhVC9OxmpWvBxDRwmbC-RxYS4wrC1YVmj8aG8ZG8hsF4mNI71qcBkOVGh-eTddHX1Ddycp_47wNtBP-vkNeAISyujBBcyWjivdH0mdMDgu1x-AKGLB9e6bhHisaTg97BnVkfrHvF9DW-xPQ0mf3yQ1EtMUD4BxpMN2_QIVUzVgDiLZk0q7vqYN00cck6B2Mshg2Wa_qPfcriBO8TooMWfM3ZtXJpdPjf-4rTtZu8ZbOyiG80tNzdgQqxupvsbpTlNMq_1G2P04hD9jkb2kB2aOrbGN1OMIhKSiEODMr3-C3E7EyhBWSBaCxaZnvuQn7nAfaxiy2qzTQS9gPc4EYH_rNRRxntP-zGo57GTYpMHYjIDrXRE0SboaDS-tkJiVs29eAh5YiBPR_NfUhxfgjc0SACPB6dZwvVm4ZCpanwv7xN7cMkG-gznNxVchCbmthFF2mwibhFyoDuD1cA0zt6Ifi1SWYIOq-V0_nPW5Hpkbo_FQWZhHcDrGRHnbOvKQuEPWwVg3WD7YQugNQMesPLW-URQgk7QRlfsH8z097GLLqAxEysiGlJouMqxg2g4smblU3KxBcnG8dUZd_eOKsxAlEUP97uId3pNkx7fYctbqYr39MN2CHfBwyjWZWSO_gQxEJaUap2n3m1Fb7n3Qe4LwclVM81-mI61VoGZzXOcEWIQJTVa6fo2AlTS0w0ONgWUCteCR0cUyIHhGw-y7G9AKvxOp7THOO91i5_QTYMo2-dDceIGi3NvD-gqt-nvH2d4Q_gcQOD0nOpU0dhT-GVBlh38f2qDgiEtl3oXsKomRhruN_eqlK4atcEBHQpK-pxCHMu3DWeZGgGTqqLNFSK_XUbkN-GuNfPMQst51q83bnGJDRBthQyv_sM3H0WULzxy","summary":[]},"output_index":0,"sequence_number":3} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","item":{"id":"sh_0b9b92b07af80391006a9f9493d16087d0874b27939f7e1b20","type":"shell_call","status":"in_progress","action":{"commands":[],"max_output_length":null,"timeout_ms":null},"call_id":"call_Jchrq39cKyfEXAf2J7onLe4M","environment":null},"output_index":1,"sequence_number":4} + + ' + - ' + + ' + - 'event: response.shell_call_command.added + + ' + - 'data: {"type":"response.shell_call_command.added","command":"","command_index":0,"output_index":1,"sequence_number":5} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"sleep","obfuscation":"dM5AXq8bpTh","output_index":1,"sequence_number":6} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":" + ","obfuscation":"KLzxon1rM2amEjy","output_index":1,"sequence_number":7} + + ' + - ' + + ' + - 'event: response.shell_call_command.delta + + ' + - 'data: {"type":"response.shell_call_command.delta","command_index":0,"delta":"2","obfuscation":"Es8V9YMhx2mFR54","output_index":1,"sequence_number":8} + + ' + - ' + + ' + - 'event: response.shell_call_command.done + + ' + - 'data: {"type":"response.shell_call_command.done","command":"sleep 2","command_index":0,"output_index":1,"sequence_number":9} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","item":{"id":"sh_0b9b92b07af80391006a9f9493d16087d0874b27939f7e1b20","type":"shell_call","status":"completed","action":{"commands":["sleep + 2"],"max_output_length":4096,"timeout_ms":1000},"call_id":"call_Jchrq39cKyfEXAf2J7onLe4M","environment":null},"output_index":1,"sequence_number":10} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","response":{"id":"resp_0b9b92b07af80391006a9f94911b8c87d0819c29aa782a35db","object":"response","created_at":1788843153,"status":"completed","background":false,"completed_at":1788843156,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[{"id":"rs_0b9b92b07af80391006a9f9491f85487d0bcf85a53b2fb4bfb","type":"reasoning","content":[],"encrypted_content":"gAAAAABqn5SU_k5RMotqI6Vic8MGTGGAJXvy-hZI6mXRJgmdwu2KfIXkDFa7GD5HWf7059dSNXD_0ySpM_552W6Ve7iCAvazsdhyWs9bM2viyzknhXJEBGsx74RKh5PkzVZtUIwph09vF0ynrsps1qpysb7y3hyEzh2NjHVwrM_BOjjCGL-_kTpwk0jKPmxkACWLpo10o0NjLqhykfjmYl0SoxfbKahg5MTaLkObTq3Zg5Va9uTl-duf2dBwhbgpyZNefLDPB72q01Q87jew02hkQIYhe6t9QU69cOmjOsIXziWjfslwVkHHDFbvLOufphaapDRIf5kJZn4fRE-QU2X5HYd8GNCQJYayNDO994RFUj9VMBm3J-bmIC6YYjy2B8yO1dTWNKUWJ3nAwXR58agqbvcU5h7lYD7K9znaxPSSiEGZMkHpjj0wTYZ072-hhCaGFKZOlAd2gkswLS9Gul2bLwmgmZ4M4Vd5L38YmUed_pe-JqgXzyv_1aAPZ_dLZnJgx2MtxOVmZnZucHkYJjf9kROfbNOA3w_paaR-ROYJBj3MoSev6os-k4FKLSCyxf6oaQdEqXb098v-IWdUinEnd3zTZqK9KPM6qyMvKJli3y4FZ_YCsc5sL5Vk0ZlGTjTaV4Ntma-TfGW4eTs3lKfZ3FyoHuXLlluOhGgdUlnOXtCXK-lmCs3Ww4InbdArciR9uGZGZ7xWFl8zyZDF0EhukYXd8vx5z01bSJrIOvy9EH3uxTSZk-8HpIItxH1RT_mrqaQ0kNTm7jsAzo_NS8yGO2vSG-0v883C-XikCSkzkbtQzyGDWptZCjQBl1I7gpimc7hsFJkJyOqe1AHZMybpGMvxUc-GEARtBQFFAdliiUx2EuWlwxLr1-s7dhLlfS5-iajqjzCSNuJ_24tAgBWqdcYEBqAQx-fU9IYYDF2bK4F9vAjr2xM_MiVM9uGySMi3ofCpoLtofax76HDKTjI-REq81iZB6wQoO9oKgba3acA69-2bvC7FTSkiZizjlaRMbA8QNK6T1V2FBD5ogytjAFFlnUIMGoKoLx24k0GKa_z5n-K3I57B50emZ0nvR__YZcBNsda9Ifu2l_l9i-xUHH21NsZzziCDTxaGhJ03HFMIzsFGVD9bLQn9JynWtqI3wS5SFeWo8_E2XmrAxxz0y5foLqchmBEuLxocTnPWp1ezY__mMH-1iJfj6ou2lbk3skTY-x1AEOYXGdM3sn4tYTIUeVuTV_VP6lun6Ub4vem6WTYq2-dubWRkhzbB1xgf3520DKxepXEhNMaSuXQ6WjKvUtoWPQz4IZCPNQKy5Zc8FxiEoJYv4K--vr_x-yexe6VjEtVjGfbBabZGn4QJPX8OnzSI3YBxGyWfqE9pj4qKS7lTgTNfQm0JIfsSkOy2XQprCP6w_pg5bPFCvAsx623g8gkuIyeR4_2IofF1TtO-giVwe7BmkVwdXhsinckLry0jcTEzr0fN1kGBykIRLtyLIDifKSGTKRByyYPseTGSsz-UFGx4YZMuF_9tGjH-OspNrDbdeozxReCMKW-uWjPp7ioBHiGttgk6MsrkB7SNLUotYjZs5kIgkC_NkEpdBGKHIf7zP8ZCm7Oh-OUalsQjAYn2PlRG2rZ5_pDpFI7-FDTgiOe2lMkbMMLs6CO_yLX_xhaWdPoArI2E1acRwQbGXd4S9dfxqP_3evrLEzOQpnKYXb3vFCHJgZfNwl0-V_P8p3KCQp5Yu11I2r50xOeo1TIDiHJU9xjvI5ztZ5vnVBqmHmsFJnQDh4tuMWysI9C275yS","summary":[]},{"id":"sh_0b9b92b07af80391006a9f9493d16087d0874b27939f7e1b20","type":"shell_call","status":"completed","action":{"commands":["sleep + 2"],"max_output_length":4096,"timeout_ms":1000},"call_id":"call_Jchrq39cKyfEXAf2J7onLe4M","environment":null}],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"default","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":{"input_tokens":309,"input_tokens_details":{"cache_write_tokens":0,"cached_tokens":0},"output_tokens":126,"output_tokens_details":{"reasoning_tokens":91},"total_tokens":435},"user":null,"metadata":{}},"sequence_number":11} + + ' + - ' + + ' + status_code: 200 +- filename: t2 + request: + body: + input: + - call_id: call_Jchrq39cKyfEXAf2J7onLe4M + max_output_length: 4096 + output: + - outcome: + type: timeout + stderr: '' + stdout: '' + type: shell_call_output + - content: Use the shell output above without calling any more tools. For each + command, report its stdout, stderr, and exit code or timeout outcome in + order. + role: user + type: message + max_output_tokens: 4096 + model: gpt-5.6 + previous_response_id: resp_0b9b92b07af80391006a9f94911b8c87d0819c29aa782a35db + store: true + stream: true + tool_choice: auto + tools: + - environment: + type: local + type: shell + headers: + accept: '*/*' + authorization: Bearer *** + content-type: application/json + user-agent: python-httpx/0.28.1 + method: POST + path: /v1/responses + query_params: {} + response: + headers: + content-type: text/event-stream; charset=utf-8 + sse: + - 'event: response.created + + ' + - 'data: {"type":"response.created","response":{"id":"resp_0b9b92b07af80391006a9f9494a7a487d0a231c548daecca2d","object":"response","created_at":1788843156,"status":"in_progress","background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":"resp_0b9b92b07af80391006a9f94911b8c87d0819c29aa782a35db","prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":0} + + ' + - ' + + ' + - 'event: response.in_progress + + ' + - 'data: {"type":"response.in_progress","response":{"id":"resp_0b9b92b07af80391006a9f9494a7a487d0a231c548daecca2d","object":"response","created_at":1788843156,"status":"in_progress","background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":"resp_0b9b92b07af80391006a9f94911b8c87d0819c29aa782a35db","prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":1} + + ' + - ' + + ' + - 'event: response.output_item.added + + ' + - 'data: {"type":"response.output_item.added","item":{"id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","type":"message","status":"in_progress","content":[],"phase":"final_answer","role":"assistant"},"output_index":0,"sequence_number":2} + + ' + - ' + + ' + - 'event: response.content_part.added + + ' + - 'data: {"type":"response.content_part.added","content_index":0,"item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","output_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""},"sequence_number":3} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"1","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"RguFxYfZmKNMKFK","output_index":0,"sequence_number":4} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":".","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"gXwNmlAjy2yjqPQ","output_index":0,"sequence_number":5} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" `","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"hhnmC0iEcCc2BJ","output_index":0,"sequence_number":6} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"sleep","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"1AGAJfL7Upm","output_index":0,"sequence_number":7} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"UiUo4OlpmEWw4pa","output_index":0,"sequence_number":8} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"2","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"93EgKt5EyiHDxFx","output_index":0,"sequence_number":9} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"`\n","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"g5CXwU9UCg7kDh","output_index":0,"sequence_number":10} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"VXii13r6ED4T7h","output_index":0,"sequence_number":11} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" -","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"WYBkT2lopEDd8P","output_index":0,"sequence_number":12} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" **","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"2umB5qJoO8SoK","output_index":0,"sequence_number":13} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"stdout","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"eMikDQDffX","output_index":0,"sequence_number":14} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":":**","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"qmY6w1o8ERnAF","output_index":0,"sequence_number":15} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" Empty","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"La7lIscgMT","output_index":0,"sequence_number":16} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"\n","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"jsohBwET1CEYlWg","output_index":0,"sequence_number":17} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"QARjNdMCsUS33Z","output_index":0,"sequence_number":18} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" -","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"2D20WakpO7Rccb","output_index":0,"sequence_number":19} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" **","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"WPODYFSA51a1E","output_index":0,"sequence_number":20} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"stderr","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"7jJCGKpOr8","output_index":0,"sequence_number":21} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":":**","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"RfP643Bp499rL","output_index":0,"sequence_number":22} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" Empty","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"Ts0WLzGTtu","output_index":0,"sequence_number":23} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"\n","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"dBG3QG9WsF7h9Gc","output_index":0,"sequence_number":24} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" ","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"ZnYhCBlf3RoGZc","output_index":0,"sequence_number":25} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" -","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"giTUWWnkW3Sote","output_index":0,"sequence_number":26} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" **","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"VzhH9gw8Gbo2X","output_index":0,"sequence_number":27} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"Outcome","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"lNG5zwRIc","output_index":0,"sequence_number":28} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":":**","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"HXYVeJXbTYbmm","output_index":0,"sequence_number":29} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" Tim","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"5Z5Ap18RjF7y","output_index":0,"sequence_number":30} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"ed","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"kc1Uk5HO985VOK","output_index":0,"sequence_number":31} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" out","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"XGpEuP6MTbQJ","output_index":0,"sequence_number":32} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" (","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"4vJZKVQKSonBjH","output_index":0,"sequence_number":33} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":"no","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"isPLCYCfgLMeN3","output_index":0,"sequence_number":34} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" exit","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"mAKunbKowXJ","output_index":0,"sequence_number":35} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" code","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"pmiwGJD831f","output_index":0,"sequence_number":36} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":" reported","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"Ozdp2uI","output_index":0,"sequence_number":37} + + ' + - ' + + ' + - 'event: response.output_text.delta + + ' + - 'data: {"type":"response.output_text.delta","content_index":0,"delta":")","item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"obfuscation":"MUTeo5OMNJryzng","output_index":0,"sequence_number":38} + + ' + - ' + + ' + - 'event: response.output_text.done + + ' + - 'data: {"type":"response.output_text.done","content_index":0,"item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","logprobs":[],"output_index":0,"sequence_number":39,"text":"1. + `sleep 2`\n - **stdout:** Empty\n - **stderr:** Empty\n - **Outcome:** + Timed out (no exit code reported)"} + + ' + - ' + + ' + - 'event: response.content_part.done + + ' + - 'data: {"type":"response.content_part.done","content_index":0,"item_id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","output_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":"1. + `sleep 2`\n - **stdout:** Empty\n - **stderr:** Empty\n - **Outcome:** + Timed out (no exit code reported)"},"sequence_number":40} + + ' + - ' + + ' + - 'event: response.output_item.done + + ' + - 'data: {"type":"response.output_item.done","item":{"id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"1. + `sleep 2`\n - **stdout:** Empty\n - **stderr:** Empty\n - **Outcome:** + Timed out (no exit code reported)"}],"phase":"final_answer","role":"assistant"},"output_index":0,"sequence_number":41} + + ' + - ' + + ' + - 'event: response.completed + + ' + - 'data: {"type":"response.completed","response":{"id":"resp_0b9b92b07af80391006a9f9494a7a487d0a231c548daecca2d","object":"response","created_at":1788843156,"status":"completed","background":false,"completed_at":1788843157,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":4096,"max_tool_calls":null,"model":"gpt-5.6-sol","moderation":null,"output":[{"id":"msg_0b9b92b07af80391006a9f949553fc87d0a76a70fca403d027","type":"message","status":"completed","content":[{"type":"output_text","annotations":[],"logprobs":[],"text":"1. + `sleep 2`\n - **stdout:** Empty\n - **stderr:** Empty\n - **Outcome:** + Timed out (no exit code reported)"}],"phase":"final_answer","role":"assistant"}],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":"resp_0b9b92b07af80391006a9f94911b8c87d0819c29aa782a35db","prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"medium","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"default","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[{"type":"shell","environment":{"type":"local"}}],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":{"input_tokens":490,"input_tokens_details":{"cache_write_tokens":0,"cached_tokens":0},"output_tokens":39,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":529},"user":null,"metadata":{}},"sequence_number":42} + + ' + - ' + + ' + status_code: 200 diff --git a/crates/agentic-server-core/tests/cassettes/shell/tools.json b/crates/agentic-server-core/tests/cassettes/shell/tools.json new file mode 100644 index 00000000..2f6cc81e --- /dev/null +++ b/crates/agentic-server-core/tests/cassettes/shell/tools.json @@ -0,0 +1,8 @@ +[ + { + "type": "shell", + "environment": { + "type": "local" + } + } +] diff --git a/crates/agentic-server-core/tests/event_normalizer_test.rs b/crates/agentic-server-core/tests/event_normalizer_test.rs index 3b53b2c0..5dc9a56c 100644 --- a/crates/agentic-server-core/tests/event_normalizer_test.rs +++ b/crates/agentic-server-core/tests/event_normalizer_test.rs @@ -238,8 +238,10 @@ fn test_output_item_added_function_call() { name, namespace, call_id, + shell_call, } = &frame.payload { + assert!(shell_call.is_none()); assert_eq!(item_id, "fc_1"); assert_eq!(item_type, "function_call"); assert_eq!(*output_index, 1); diff --git a/crates/agentic-server-core/tests/shell_tool_test.rs b/crates/agentic-server-core/tests/shell_tool_test.rs new file mode 100644 index 00000000..481e5660 --- /dev/null +++ b/crates/agentic-server-core/tests/shell_tool_test.rs @@ -0,0 +1,566 @@ +//! Constructed regression fixtures, not live OpenAI/vLLM recordings. +use std::fmt::Write; +use std::sync::Arc; + +use agentic_core::executor::request::RequestContext; +use agentic_core::executor::{ExecuteRequest, UpstreamBody, decode_upstream}; +use agentic_core::storage::InOutItem; +use agentic_core::types::io::{InputItem, OutputItem, ResponsesInput, ShellCall, ShellCallStatus}; +use agentic_core::types::request_response::{RequestPayload, ResponsePayload}; +use either::Either; +use futures::StreamExt; +use serde_json::{Value, json}; + +mod support; + +fn request(stream: bool) -> RequestPayload { + serde_json::from_value(json!({ + "model": "test-model", "input": "Inspect the sandbox", "store": true, "stream": stream, + "tools": [{"type": "shell", "environment": {"type": "local"}}], + "tool_choice": {"type": "shell"} + })) + .unwrap() +} + +fn shell_item(status: &str) -> Value { + json!({"type": "shell_call", "id": "sh_1", "call_id": "call_1", "status": status, + "action": {"commands": ["pwd"], "timeout_ms": 1000, "max_output_length": 128}}) +} + +fn shell_output() -> Value { + json!({"type": "shell_call_output", "call_id": "call_1", "output": [ + {"stdout": "/sandbox\n", "stderr": "", "outcome": {"type": "exit", "exit_code": 0}} + ]}) +} + +fn context() -> RequestContext { + let request = request(true); + RequestContext { + original_request: request.clone(), + enriched_request: request, + new_input_items: Vec::new(), + response_id: "resp_reserved".to_owned(), + conversation_id: None, + conversation_version: None, + } +} + +fn sse(events: &[Value]) -> String { + let mut stream = String::new(); + for event in events { + write!(&mut stream, "data: {event}\n\n").unwrap(); + } + stream.push_str("data: [DONE]\n\n"); + stream +} + +fn lifecycle(item: &Value) -> Vec { + let mut added = item.clone(); + added["status"] = json!("in_progress"); + vec![ + json!({"type": "response.created", "response": {"id": "resp_upstream", "status": "in_progress"}}), + json!({"type": "response.in_progress", "response": {"id": "resp_upstream", "status": "in_progress"}}), + json!({"type": "response.output_item.added", "output_index": 0, "item": added}), + json!({"type": "response.output_item.done", "output_index": 0, "item": item}), + json!({"type": "response.completed", "response": {"id": "resp_upstream", "status": "completed", "output": [item]}}), + ] +} + +#[test] +fn shell_input_bytes_have_one_discriminator_and_keep_extensions() { + for mut wire in [shell_item("completed"), shell_output()] { + wire["future_field"] = json!(true); + let item: InputItem = serde_json::from_value(wire.clone()).unwrap(); + let bytes = serde_json::to_string(&item).unwrap(); + let tag = format!("\"type\":\"{}\"", wire["type"].as_str().unwrap()); + assert_eq!( + bytes.matches(&tag).count(), + 1, + "duplicate tag in actual wire bytes: {bytes}" + ); + assert_eq!(serde_json::from_str::(&bytes).unwrap(), wire); + } +} + +#[test] +fn prepared_shell_history_and_choice_match_upstream_function_tools() { + let mut request = request(false); + request.input = serde_json::from_value(json!([shell_item("completed"), shell_output()])).unwrap(); + let mut prepared = request.clone(); + prepared.input = ResponsesInput::Items(Vec::from(&request.input)); + let upstream = serde_json::to_value(prepared.to_upstream_request(false).unwrap()).unwrap(); + assert_eq!(upstream["tool_choice"], json!({"type": "function", "name": "shell"})); + assert_eq!(upstream["tools"][0]["name"], "shell"); + assert_eq!(upstream["input"][0]["type"], "function_call"); + assert_eq!(upstream["input"][0]["call_id"], upstream["input"][1]["call_id"]); + assert_eq!(upstream["input"][1]["type"], "function_call_output"); + let action: Value = serde_json::from_str(upstream["input"][0]["arguments"].as_str().unwrap()).unwrap(); + assert_eq!(action, shell_item("completed")["action"]); + let output: Value = serde_json::from_str(upstream["input"][1]["output"].as_str().unwrap()).unwrap(); + assert_eq!(output, shell_output()["output"]); + assert_eq!( + serde_json::to_value(&request.input).unwrap(), + json!([shell_item("completed"), shell_output()]) + ); + assert_eq!( + serde_json::to_value(&request.tool_choice).unwrap(), + json!({"type": "shell"}) + ); +} + +#[test] +fn native_shell_stream_obeys_strict_lifecycle() { + for status in ["completed", "incomplete"] { + let events = lifecycle(&shell_item(status)); + let response = decode_upstream(&context(), UpstreamBody::Sse(&sse(&events))).expect("native shell lifecycle"); + assert_eq!(serde_json::to_value(&response.output[0]).unwrap(), shell_item(status)); + let frame = agentic_core::events::normalize_sse_line(&format!("data: {}", events[2])).unwrap(); + let added = ShellCall::try_from(&frame.payload).unwrap(); + assert_eq!(added.action.commands, ["pwd"]); + assert!(!added.extra.contains_key("type")); + let mut changed_id = events.clone(); + changed_id[3]["item"]["id"] = json!("sh_wrong"); + assert!(decode_upstream(&context(), UpstreamBody::Sse(&sse(&changed_id))).is_err()); + let mut changed_call = events.clone(); + changed_call[3]["item"]["call_id"] = json!("call_wrong"); + assert!(decode_upstream(&context(), UpstreamBody::Sse(&sse(&changed_call))).is_err()); + let mut changed_index = events.clone(); + changed_index[3]["output_index"] = json!(1); + assert!(decode_upstream(&context(), UpstreamBody::Sse(&sse(&changed_index))).is_err()); + let mut repeated = events.clone(); + repeated.insert(4, events[3].clone()); + assert!(decode_upstream(&context(), UpstreamBody::Sse(&sse(&repeated))).is_err()); + } +} + +fn model_response(stream: bool, shell: bool) -> support::MockResponse { + let item = if shell { + json!({"type": "function_call", "id": "fc_1", "call_id": "call_1", "name": "shell", "status": "completed", + "arguments": shell_item("completed")["action"].to_string()}) + } else { + json!({"type": "message", "id": "msg_1", "role": "assistant", "status": "completed", + "content": [{"type": "output_text", "text": "sandbox checked", "annotations": []}]}) + }; + if stream { + support::MockResponse::Sse(sse(&lifecycle(&item))) + } else { + support::MockResponse::Json( + json!({"id": "resp_upstream", "object": "response", "model": "test-model", + "status": "completed", "output": [item]}) + .to_string(), + ) + } +} + +async fn run(request: RequestPayload, ctx: Arc) -> ResponsePayload { + match ExecuteRequest::new(request, ctx).run().await.unwrap() { + Either::Left(response) => response, + Either::Right(stream) => { + let chunks = stream.collect::>().await; + let events = support::streamed_sse_events(&chunks); + let response = events + .iter() + .find(|event| event["type"] == "response.completed") + .expect("completed response"); + for event in events + .iter() + .filter(|event| event["type"] == "response.output_item.done" && event["item"]["type"] == "shell_call") + { + assert_eq!(event["item"]["status"], "completed"); + } + // A consumer outside the gateway must be able to strictly replay its stream. + decode_upstream(&context(), UpstreamBody::Sse(&chunks.join(""))).expect("public strict replay"); + serde_json::from_value(response["response"].clone()).unwrap() + } + } +} + +#[tokio::test] +async fn client_shell_continuation_blocking_and_streaming() { + for stream in [false, true] { + let fixture = support::TestFixture::new_with_responses(vec![ + model_response(stream, true), + model_response(stream, false), + model_response(stream, false), + ]) + .await; + let first = run(request(stream), fixture.exec_ctx.clone()).await; + let public_tools = json!([{"type": "shell", "environment": {"type": "local"}}]); + assert_eq!(serde_json::to_value(&first.tools).unwrap(), public_tools); + assert_eq!( + serde_json::to_value(&first.tool_choice).unwrap(), + json!({"type": "shell"}) + ); + let OutputItem::ShellCall(call) = &first.output[0] else { + panic!("public shell call") + }; + assert_eq!(call.status, Some(ShellCallStatus::Completed)); + assert_eq!( + fixture.request_bodies().await.len(), + 1, + "default shell must wait for client execution" + ); + let mut continuation = request(stream); + continuation.tools = None; + continuation.tool_choice = None; + continuation.previous_response_id = Some(first.id); + continuation.input = serde_json::from_value(json!([shell_output()])).unwrap(); + let final_response = run(continuation, fixture.exec_ctx.clone()).await; + assert_eq!(serde_json::to_value(&final_response.tools).unwrap(), public_tools); + assert_eq!( + serde_json::to_value(&final_response.tool_choice).unwrap(), + json!({"type": "shell"}) + ); + assert_eq!(support::output_text(&final_response), "sandbox checked"); + let requests = fixture.request_bodies().await; + let history = requests[1]["input"].as_array().unwrap(); + assert_eq!(history.iter().filter(|item| item["type"] == "function_call").count(), 1); + assert_eq!( + history + .iter() + .filter(|item| item["type"] == "function_call_output") + .count(), + 1 + ); + assert!( + !history + .iter() + .any(|item| item["type"] == "shell_call" || item["type"] == "shell_call_output") + ); + let mut stored_context = context(); + stored_context.original_request.previous_response_id = Some(final_response.id.clone()); + let stored = fixture.exec_ctx.resp_handler.rehydrate(&stored_context).await.unwrap(); + assert!( + stored + .iter() + .any(|item| matches!(item, InOutItem::Input(InputItem::ShellCallOutput(_)))) + ); + + // A later turn must normalize the persisted public output as well as new outputs. + let mut third = request(stream); + third.previous_response_id = Some(final_response.id); + third.input = ResponsesInput::Text("Continue from the shell output".to_owned()); + assert_eq!( + support::output_text(&run(third, fixture.exec_ctx.clone()).await), + "sandbox checked" + ); + } +} + +#[tokio::test] +async fn submitted_shell_items_preserve_public_fields_in_storage() { + for conversation in [false, true] { + let fixture = support::TestFixture::new_with_responses(vec![model_response(false, false)]).await; + let mut req = request(false); + if conversation { + req.conversation_id = Some(fixture.exec_ctx.conv_handler.create().await.unwrap().conversation_id); + } + let mut call = shell_item("completed"); + call["extension"] = json!("call metadata"); + let mut output = shell_output(); + output["max_output_length"] = json!(128); + output["extension"] = json!("output metadata"); + req.input = serde_json::from_value(json!([call, output])).unwrap(); + let conversation_id = req.conversation_id.clone(); + let response = run(req, fixture.exec_ctx.clone()).await; + let mut ctx = context(); + let stored = if let Some(id) = conversation_id { + ctx.original_request.conversation_id = Some(id.clone()); + ctx.conversation_id = Some(id); + fixture.exec_ctx.conv_handler.rehydrate(&ctx).await.unwrap() + } else { + ctx.original_request.previous_response_id = Some(response.id); + fixture.exec_ctx.resp_handler.rehydrate(&ctx).await.unwrap() + }; + let inputs = stored + .iter() + .filter_map(|item| match item { + InOutItem::Input(input) => Some(serde_json::to_value(input).unwrap()), + InOutItem::Output(_) => None, + }) + .collect::>(); + assert_eq!(inputs, vec![call, output]); + let requests = fixture.request_bodies().await; + assert_eq!(requests[0]["input"][0]["type"], "function_call"); + assert_eq!(requests[0]["input"][1]["type"], "function_call_output"); + } +} + +#[tokio::test] +async fn shell_response_metadata_uses_public_declarations_and_selector() { + for tool_search in [false, true] { + let mut req = request(true); + if tool_search { + req.tools.as_mut().unwrap().push( + serde_json::from_value(json!({ + "type": "tool_search", "execution": "client" + })) + .unwrap(), + ); + } + let expected_tools = serde_json::to_value(&req.tools).unwrap(); + let item = json!({"type": "function_call", "id": "fc_1", "call_id": "call_1", "name": "shell", + "status": "completed", "arguments": shell_item("completed")["action"].to_string()}); + let mut events = lifecycle(&item); + for event in &mut events { + if event.get("response").is_some() { + event["response"]["tools"] = json!([{"type": "function", "name": "shell"}]); + event["response"]["tool_choice"] = json!({"type": "function", "name": "shell"}); + } + } + let fixture = support::TestFixture::new_with_responses(vec![support::MockResponse::Sse(sse(&events))]).await; + let Either::Right(stream) = ExecuteRequest::new(req, fixture.exec_ctx.clone()).run().await.unwrap() else { + panic!("expected streaming response"); + }; + let chunks = stream.collect::>().await; + let events = support::streamed_sse_events(&chunks); + for kind in ["response.created", "response.in_progress", "response.completed"] { + let event = events.iter().find(|event| event["type"] == kind).unwrap(); + assert_eq!(event["response"]["tools"], expected_tools, "{kind}"); + assert_eq!(event["response"]["tool_choice"], json!({"type": "shell"}), "{kind}"); + } + } +} + +#[test] +fn recorded_shell_streams_replay_strictly() { + let root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/cassettes/shell"); + for (provider, model) in [("openai-reference", "gpt-5.6"), ("gateway", "Qwen-Qwen3.5-35B-A3B-FP8")] { + for scenario in ["success", "nonzero-exit", "timeout", "multiple-commands"] { + let path = root.join(format!("shell-{provider}-{scenario}-{model}-streaming.yaml")); + let cassette = support::load_cassette(path.to_str().unwrap()); + assert_eq!(cassette.turns.len(), 2); + for (index, turn) in cassette.turns.iter().enumerate() { + let wire = turn.response.sse.as_ref().unwrap().join(""); + let response = decode_upstream(&context(), UpstreamBody::Sse(&wire)) + .unwrap_or_else(|error| panic!("{} turn {index}: {error}", path.display())); + if index == 0 { + let call = response + .output + .iter() + .find_map(|item| match item { + OutputItem::ShellCall(call) => Some(call), + _ => None, + }) + .expect("shell call"); + assert_eq!(call.status, Some(ShellCallStatus::Completed)); + let expected_commands = match scenario { + "multiple-commands" => 3..=4, + "nonzero-exit" => 1..=2, + _ => 1..=1, + }; + assert!(expected_commands.contains(&call.action.commands.len())); + } else { + assert!(!support::output_text(&response).is_empty()); + } + } + } + } +} + +fn command_lifecycle() -> Vec { + let item = shell_item("completed"); + let mut events = lifecycle(&item); + events[2]["item"]["action"] = json!({"commands": [], "timeout_ms": null, "max_output_length": null}); + events.splice(3..3, [ + json!({"type": "response.shell_call_command.added", "output_index": 0, "command_index": 0, "command": ""}), + json!({"type": "response.shell_call_command.delta", "output_index": 0, "command_index": 0, "delta": "pw"}), + json!({"type": "response.shell_call_command.delta", "output_index": 0, "command_index": 0, "delta": "d"}), + json!({"type": "response.shell_call_command.done", "output_index": 0, "command_index": 0, "command": "pwd"}), + ]); + events +} + +#[test] +fn shell_command_stream_validates_indices_order_and_final_commands() { + let events = command_lifecycle(); + decode_upstream(&context(), UpstreamBody::Sse(&sse(&events))).unwrap(); + for failure in [ + "index", + "item-id", + "command-index", + "missing-index", + "negative-index", + "string-index", + "missing-delta", + "before-added", + "duplicate-added", + "duplicate-done", + "after-done", + "unfinished", + "contradict-done", + "contradict-item", + "wrong-kind", + ] { + let mut bad = events.clone(); + match failure { + "index" => bad[4]["output_index"] = json!(1), + "item-id" => bad[4]["item_id"] = json!("wrong"), + "command-index" => bad[4]["command_index"] = json!(1), + "missing-index" => { + bad[4].as_object_mut().unwrap().remove("command_index"); + } + "negative-index" => bad[4]["command_index"] = json!(-1), + "string-index" => bad[4]["command_index"] = json!("0"), + "missing-delta" => { + bad[4].as_object_mut().unwrap().remove("delta"); + } + "before-added" => { + bad.remove(3); + } + "duplicate-added" => bad.insert(4, events[3].clone()), + "duplicate-done" => bad.insert(7, events[6].clone()), + "after-done" => bad.insert(7, events[4].clone()), + "unfinished" => { + bad.remove(6); + } + "contradict-done" => bad[6]["command"] = json!("other"), + "contradict-item" => bad[7]["item"]["action"]["commands"] = json!(["other"]), + "wrong-kind" => bad[2]["item"] = json!({"type":"message","id":"sh_1","role":"assistant","content":[]}), + _ => unreachable!(), + } + assert!( + decode_upstream(&context(), UpstreamBody::Sse(&sse(&bad))).is_err(), + "accepted {failure}" + ); + } +} + +// Compare semantic shell events; IDs, sequence numbers, and delta boundaries +// belong to individual responses and are not provider compatibility requirements. +fn recorded_shell_lifecycle(events: &[Value], call: &Value) -> Vec { + let added = events + .iter() + .find(|event| event["type"] == "response.output_item.added" && event["item"]["id"] == call["id"]) + .expect("shell item added"); + assert_eq!(added["item"]["status"], "in_progress"); + assert_eq!(added["item"]["action"]["commands"], json!([])); + assert!(added["item"]["action"]["timeout_ms"].is_null()); + assert!(added["item"]["action"]["max_output_length"].is_null()); + let mut commands = Vec::::new(); + let mut trace = Vec::new(); + for event in events { + let kind = event["type"].as_str().unwrap(); + if kind.starts_with("response.shell_call_command.") { + assert_eq!(event["output_index"], added["output_index"]); + let index = usize::try_from(event["command_index"].as_u64().unwrap()).unwrap(); + match kind { + "response.shell_call_command.added" => { + assert_eq!(index, commands.len()); + assert_eq!(event["command"], ""); + commands.push(String::new()); + } + "response.shell_call_command.delta" => { + commands[index].push_str(event["delta"].as_str().unwrap()); + continue; + } + "response.shell_call_command.done" => assert_eq!(event["command"], commands[index]), + _ => panic!("unexpected shell event: {kind}"), + } + trace.push(json!({"type": kind, "command_index": index, "command": event["command"]})); + } else if event["item"]["id"] == call["id"] { + assert_eq!(event["output_index"], added["output_index"]); + assert_eq!(event["item"]["call_id"], call["call_id"]); + if kind == "response.output_item.done" { + assert_eq!(event["item"]["action"], call["action"]); + assert_eq!(event["item"]["status"], "completed"); + } + trace.push(json!({"type": kind, "status": event["item"]["status"], "action": event["item"]["action"]})); + } + } + assert_eq!(json!(commands), call["action"]["commands"]); + assert_eq!(trace.first().unwrap()["type"], "response.output_item.added"); + assert_eq!(trace.last().unwrap()["type"], "response.output_item.done"); + trace +} + +fn recorded_shell_contract(provider: &str, model: &str, scenario: &str, streaming: bool) -> Value { + let mode = if streaming { "streaming" } else { "nonstreaming" }; + let path = format!( + "{}/tests/cassettes/shell/shell-{provider}-{scenario}-{model}-{mode}.yaml", + env!("CARGO_MANIFEST_DIR") + ); + let cassette = support::load_cassette(&path); + assert_eq!(cassette.turns.len(), 2, "{path}"); + let mut responses = Vec::new(); + let mut first_events = Vec::new(); + for (index, turn) in cassette.turns.iter().enumerate() { + assert_eq!(turn.request.path, "/v1/responses"); + assert_eq!(turn.request.body.stream, streaming); + assert!(turn.request.body.store); + assert_eq!( + turn.request.body.tools, + vec![json!({"type":"shell", "environment":{"type":"local"}})] + ); + let body = if streaming { + let chunks = turn.response.sse.as_ref().unwrap(); + let wire = chunks.join(""); + decode_upstream(&context(), UpstreamBody::Sse(&wire)).expect("strict shell stream replay"); + let events = support::streamed_sse_events(chunks); + let completed = events + .iter() + .filter(|event| event["type"] == "response.completed") + .collect::>(); + assert_eq!(completed.len(), 1); + let body = completed[0]["response"].clone(); + if index == 0 { + first_events = events; + } + body + } else { + turn.response.body.clone().unwrap() + }; + assert_eq!(body["status"], "completed", "{path} turn {index}"); + responses.push(body); + } + let calls = responses[0]["output"] + .as_array() + .unwrap() + .iter() + .filter(|item| item["type"] == "shell_call") + .collect::>(); + assert_eq!(calls.len(), 1); + let call = calls[0]; + assert!(call["id"].as_str().unwrap().starts_with("sh_")); + assert!(!call["call_id"].as_str().unwrap().is_empty()); + assert_eq!(call["status"], "completed"); + assert_eq!(call["action"]["timeout_ms"], 1000); + assert_eq!(call["action"]["max_output_length"], 4096); + let continuation = &cassette.turns[1].request.body; + assert_eq!( + continuation.previous_response_id.as_deref(), + responses[0]["id"].as_str() + ); + let input = continuation.input.as_array().unwrap(); + assert_eq!(input.len(), 2); + assert_eq!(input[0]["type"], "shell_call_output"); + assert_eq!(input[0]["call_id"], call["call_id"]); + assert_eq!(input[0]["max_output_length"], call["action"]["max_output_length"]); + assert_eq!( + input[0]["output"].as_array().unwrap().len(), + call["action"]["commands"].as_array().unwrap().len() + ); + assert_eq!(input[1]["role"], "user"); + let final_response: ResponsePayload = serde_json::from_value(responses[1].clone()).unwrap(); + assert!(!support::output_text(&final_response).trim().is_empty()); + assert!(!final_response.output.iter().any(|item| matches!( + item, + OutputItem::ShellCall(_) | OutputItem::FunctionCall(_) | OutputItem::CustomToolCall(_) + ))); + json!({ + "action": call["action"], "status": call["status"], + "output": input[0]["output"], "follow_up": input[1], + "lifecycle": if streaming { recorded_shell_lifecycle(&first_events, call) } else { Vec::new() } + }) +} + +#[test] +fn recorded_gateway_shell_contract_matches_openai() { + for scenario in ["success", "nonzero-exit", "timeout", "multiple-commands"] { + for streaming in [false, true] { + let reference = recorded_shell_contract("openai-reference", "gpt-5.6", scenario, streaming); + let gateway = recorded_shell_contract("gateway", "Qwen-Qwen3.5-35B-A3B-FP8", scenario, streaming); + assert_eq!(gateway, reference, "{scenario}, streaming={streaming}"); + } + } +} diff --git a/crates/agentic-server-core/tests/support/mod.rs b/crates/agentic-server-core/tests/support/mod.rs index 69306a63..75b04a01 100644 --- a/crates/agentic-server-core/tests/support/mod.rs +++ b/crates/agentic-server-core/tests/support/mod.rs @@ -557,6 +557,7 @@ pub fn output_text(payload: &ResponsePayload) -> String { OutputItem::FunctionCall(_) | OutputItem::ToolSearchCall(_) | OutputItem::CustomToolCall(_) + | OutputItem::ShellCall(_) | OutputItem::WebSearchCall(_) | OutputItem::McpCall(_) | OutputItem::McpListTools(_) diff --git a/crates/agentic-server/src/openapi.rs b/crates/agentic-server/src/openapi.rs index 83ee56f0..fe86bfb0 100644 --- a/crates/agentic-server/src/openapi.rs +++ b/crates/agentic-server/src/openapi.rs @@ -52,6 +52,12 @@ use utoipa::OpenApi; agentic_core::types::io::FunctionToolCall, agentic_core::types::io::ToolSearchCall, agentic_core::types::io::CustomToolCall, + agentic_core::types::io::ShellCall, + agentic_core::types::io::ShellCallAction, + agentic_core::types::io::ShellCallStatus, + agentic_core::types::io::ShellCallOutputMessage, + agentic_core::types::io::ShellCallOutputContent, + agentic_core::types::io::ShellCallOutcome, agentic_core::types::io::WebSearchCall, agentic_core::types::io::WebSearchAction, agentic_core::types::io::WebSearchActionSearch, @@ -90,6 +96,9 @@ use utoipa::OpenApi; agentic_core::types::tools::WebSearchUserLocation, agentic_core::types::tools::FileSearchToolParam, agentic_core::types::tools::CodeInterpreterToolParam, + agentic_core::types::tools::ShellToolParam, + agentic_core::types::tools::ShellEnvironment, + agentic_core::types::tools::LocalShellEnvironment, agentic_core::types::tools::CodexNamespaceToolParam, agentic_core::types::tools::CodexNamespaceMember, agentic_core::types::tools::NonEmptyToolName, @@ -530,7 +539,9 @@ mod tests { serde_json::json!({"type": "tool_search_call", "id": "tsc1", "call_id": "c1", "execution": "client", "arguments": {}, "status": "completed"}), serde_json::json!({"type": "tool_search_output", "call_id": "c1", "execution": "client", "status": "completed", "tools": []}), serde_json::json!({"type": "custom_tool_call", "id": "ct1", "name": "t", "input": "d"}), + serde_json::json!({"type": "shell_call", "id": "sh_1", "call_id": "c1", "action": {"commands": ["pwd"], "timeout_ms": 1000}, "status": "completed"}), serde_json::json!({"type": "custom_tool_call_output", "call_id": "c1", "output": "r"}), + serde_json::json!({"type": "shell_call_output", "call_id": "c1", "output": [{"stdout": "ok", "stderr": "", "outcome": {"type": "exit", "exit_code": 0}}, {"outcome": {"type": "timeout"}}]}), serde_json::json!({"type": "reasoning", "id": "r1", "content": [{"type": "reasoning_text", "text": "think"}]}), serde_json::json!({"type": "mcp_list_tools", "id": "mlt1", "server_label": "s", "tools": []}), serde_json::json!({"type": "compaction", "id": "cmp1", "encrypted_content": "enc"}), @@ -546,6 +557,7 @@ mod tests { serde_json::json!({"type": "function_call", "id": "fc1", "call_id": "c1", "name": "f", "arguments": "{}", "status": "completed"}), serde_json::json!({"type": "tool_search_call", "id": "tsc1", "call_id": "c1", "execution": "client", "arguments": {}, "status": "completed"}), serde_json::json!({"type": "custom_tool_call", "id": "ct1", "name": "t", "input": "d"}), + serde_json::json!({"type": "shell_call", "id": "sh_1", "call_id": "c1", "action": {"commands": ["pwd"], "timeout_ms": 1000}, "status": "completed"}), serde_json::json!({"type": "web_search_call", "id": "ws1", "status": "completed", "action": {"type": "search", "query": "q"}}), serde_json::json!({"type": "mcp_call", "id": "mc1", "server_label": "s", "name": "n", "arguments": "{}"}), serde_json::json!({"type": "mcp_list_tools", "id": "mlt1", "server_label": "s", "tools": []}), @@ -581,6 +593,7 @@ mod tests { serde_json::json!({"type": "web_search_preview"}), serde_json::json!({"type": "file_search"}), serde_json::json!({"type": "code_interpreter"}), + serde_json::json!({"type": "shell", "environment": {"type": "local"}}), serde_json::json!({"type": "namespace", "name": "ns", "tools": []}), serde_json::json!({"type": "custom", "name": "c"}), ]; diff --git a/docs/design/shell-tool.md b/docs/design/shell-tool.md new file mode 100644 index 00000000..4c887b44 --- /dev/null +++ b/docs/design/shell-tool.md @@ -0,0 +1,24 @@ +# Shell tool execution + +`{"type":"shell","environment":{"type":"local"}}` declares a client-executed +tool. The gateway returns a typed `shell_call`; the client runs the +commands in its own environment and submits `shell_call_output` with the same +`call_id`. Explicit `tool_choice: {"type":"shell"}` is supported. + +The public shell items remain in stored history. Stored calls use the standard +output-to-input conversion to become `shell` function calls during rehydration. +Typed input conversions also lower submitted shell calls and outputs; inference +normalizes the declaration and selector to the matching function representation. +Completed calls report `completed` in both blocking +responses and streaming `response.output_item.done` events. Native shell streams +can also be consumed through `decode_upstream` and its strict lifecycle validation. + +For client execution, normalized function arguments are translated incrementally +into `response.shell_call_command.added`, `.delta`, and `.done` events with +`output_index` and `command_index`. The initial shell item has an empty commands +array; the completed item contains the full action and limits. JSON string +escapes (including split Unicode surrogate pairs) are decoded before command +deltas are emitted. Native shell command events use the same ingestion lifecycle +checks; malformed indices, repeated completion, and contradictory command text +are rejected. The OpenAI recordings in `tests/cassettes/shell` are replayed by +`tests/shell_tool_test.rs` alongside client-continuation tests.