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

@@ -267,7 +267,7 @@ export async function runExecProcess(opts: {
notifyOnExitEmptySuccess?: boolean;
scopeKey?: string;
sessionKey?: string;
timeoutSec: number;
timeoutSec: number | null;
onUpdate?: (partialResult: AgentToolResult<ExecToolDetails>) => void;
}): Promise<ExecProcessHandle> {
const startedAt = Date.now();
@@ -504,7 +504,9 @@ export async function runExecProcess(opts: {
}
const reason =
exit.reason === "overall-timeout"
? `Command timed out after ${opts.timeoutSec} seconds`
? typeof opts.timeoutSec === "number" && opts.timeoutSec > 0
? `Command timed out after ${opts.timeoutSec} seconds`
: "Command timed out"
: exit.reason === "no-output-timeout"
? "Command timed out waiting for output"
: exit.exitSignal != null