diff --git a/src/cli/run/runner.ts b/src/cli/run/runner.ts index 762fa487..e913389b 100644 --- a/src/cli/run/runner.ts +++ b/src/cli/run/runner.ts @@ -11,7 +11,7 @@ import { pollForCompletion } from "./poll-for-completion" export { resolveRunAgent } -const DEFAULT_TIMEOUT_MS = 0 +const DEFAULT_TIMEOUT_MS = 600_000 export async function run(options: RunOptions): Promise { process.env.OPENCODE_CLI_RUN_MODE = "true" @@ -67,7 +67,9 @@ export async function run(options: RunOptions): Promise { const ctx: RunContext = { client, sessionID, directory, abortController } const events = await client.event.subscribe() const eventState = createEventState() - const eventProcessor = processEvents(ctx, events.stream, eventState) + const eventProcessor = processEvents(ctx, events.stream, eventState).catch( + () => {}, + ) console.log(pc.dim("\nSending prompt...")) await client.session.promptAsync({ @@ -85,7 +87,7 @@ export async function run(options: RunOptions): Promise { // Abort the event stream to stop the processor abortController.abort() - await eventProcessor.catch(() => {}) + await eventProcessor cleanup() const durationMs = Date.now() - startTime @@ -126,4 +128,3 @@ export async function run(options: RunOptions): Promise { } } -