fix(exec): skip default timeout for background sessions

This commit is contained in:
Peter Steinberger
2026-02-22 23:02:17 +01:00
parent 4b0fddc075
commit c677be9d5f
4 changed files with 40 additions and 4 deletions

View File

@@ -442,8 +442,12 @@ export function createExecTool(
execCommandOverride = gatewayResult.execCommandOverride;
}
const effectiveTimeout =
typeof params.timeout === "number" ? params.timeout : defaultTimeoutSec;
const explicitTimeoutSec = typeof params.timeout === "number" ? params.timeout : null;
const backgroundTimeoutBypass =
allowBackground && explicitTimeoutSec === null && (backgroundRequested || yieldRequested);
const effectiveTimeout = backgroundTimeoutBypass
? null
: (explicitTimeoutSec ?? defaultTimeoutSec);
const getWarningText = () => (warnings.length ? `${warnings.join("\n")}\n\n` : "");
const usePty = params.pty === true && !sandbox;