From aa14f6a97561dc531461304aaecc53a4b2104d43 Mon Sep 17 00:00:00 2001 From: Lucky Lodhi Date: Sat, 7 Feb 2026 14:17:57 +0000 Subject: [PATCH 1/2] dynamically set default host --- src/agents/bash-tools.exec.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/agents/bash-tools.exec.ts b/src/agents/bash-tools.exec.ts index a771f85879e..7896f9b6d1f 100644 --- a/src/agents/bash-tools.exec.ts +++ b/src/agents/bash-tools.exec.ts @@ -828,7 +828,16 @@ export function createExecTool( label: "exec", description: "Execute shell commands with background continuation. Use yieldMs/background to continue later via process tool. Use pty=true for TTY-required commands (terminal UIs, coding agents).", - parameters: execSchema, + parameters: { + ...execSchema, + properties: { + ...execSchema.properties, + host: { + ...execSchema.properties.host, + default: defaults?.host ?? "sandbox", + }, + }, + }, execute: async (_toolCallId, args, signal, onUpdate) => { const params = args as { command: string; From b57101b80d607008aa21d6fab4ee844433307c27 Mon Sep 17 00:00:00 2001 From: Lucky Lodhi Date: Sat, 7 Feb 2026 16:21:55 +0000 Subject: [PATCH 2/2] made suggested changes --- src/agents/bash-tools.exec.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/agents/bash-tools.exec.ts b/src/agents/bash-tools.exec.ts index 7896f9b6d1f..cf5f901c65c 100644 --- a/src/agents/bash-tools.exec.ts +++ b/src/agents/bash-tools.exec.ts @@ -828,16 +828,15 @@ export function createExecTool( label: "exec", description: "Execute shell commands with background continuation. Use yieldMs/background to continue later via process tool. Use pty=true for TTY-required commands (terminal UIs, coding agents).", - parameters: { - ...execSchema, - properties: { - ...execSchema.properties, - host: { - ...execSchema.properties.host, + parameters: Type.Object({ + ...execSchema.properties, + host: Type.Optional( + Type.String({ + description: "Exec host (sandbox|gateway|node).", default: defaults?.host ?? "sandbox", - }, - }, - }, + }), + ), + }), execute: async (_toolCallId, args, signal, onUpdate) => { const params = args as { command: string;