From 48a333d9d5581baef19949d0620edc9aa8d5d67c Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 7 Jan 2026 23:26:26 +0100 Subject: [PATCH] fix: initialize bash warnings before use --- src/agents/bash-tools.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/agents/bash-tools.ts b/src/agents/bash-tools.ts index 51f2ebb1b..6b146c7e5 100644 --- a/src/agents/bash-tools.ts +++ b/src/agents/bash-tools.ts @@ -156,6 +156,10 @@ export function createBashTool( throw new Error("Provide a command to start."); } + const maxOutput = DEFAULT_MAX_OUTPUT; + const startedAt = Date.now(); + const sessionId = randomUUID(); + const warnings: string[] = []; const backgroundRequested = params.background === true; const yieldRequested = typeof params.yieldMs === "number"; if (!allowBackground && (backgroundRequested || yieldRequested)) { @@ -173,10 +177,6 @@ export function createBashTool( 120_000, ) : null; - const maxOutput = DEFAULT_MAX_OUTPUT; - const startedAt = Date.now(); - const sessionId = randomUUID(); - const warnings: string[] = []; const elevatedDefaults = defaults?.elevated; const elevatedDefaultOn = elevatedDefaults?.defaultLevel === "on" &&