| 52 | } |
| 53 | |
| 54 | export function resolveAgentTimeoutMs(timeoutSeconds: number | null | undefined): number { |
| 55 | const requestedAgentTimeout = typeof timeoutSeconds === "number" && timeoutSeconds > 0 ? timeoutSeconds * 1000 : 0 |
| 56 | |
| 57 | // In CLI runtime, stdin harnesses expect command lifetime to be governed |
| 58 | // solely by commandExecutionTimeout (user setting), not model-provided |
| 59 | // background timeouts. |
| 60 | return process.env.ROO_CLI_RUNTIME === "1" ? 0 : requestedAgentTimeout |
| 61 | } |
| 62 | |
| 63 | export class ExecuteCommandTool extends BaseTool<"execute_command"> { |
| 64 | readonly name = "execute_command" as const |