diff --git a/.github/workflows/sisyphus-agent.yml b/.github/workflows/sisyphus-agent.yml index 7becdf5..530efe8 100644 --- a/.github/workflows/sisyphus-agent.yml +++ b/.github/workflows/sisyphus-agent.yml @@ -338,7 +338,7 @@ jobs: PROMPT="${PROMPT//BRANCH_PLACEHOLDER/$DEFAULT_BRANCH}" PROMPT="${PROMPT//COMMENT_PLACEHOLDER/$USER_COMMENT}" - bun run dist/cli/index.js run "$PROMPT" + stdbuf -oL -eL bun run dist/cli/index.js run "$PROMPT" # Push changes (as sisyphus-dev-ai) - name: Push changes diff --git a/src/cli/run/runner.ts b/src/cli/run/runner.ts index 27f27db..6bd5d03 100644 --- a/src/cli/run/runner.ts +++ b/src/cli/run/runner.ts @@ -5,7 +5,7 @@ import { checkCompletionConditions } from "./completion" import { createEventState, processEvents } from "./events" const POLL_INTERVAL_MS = 500 -const DEFAULT_TIMEOUT_MS = 30 * 60 * 1000 +const DEFAULT_TIMEOUT_MS = 0 export async function run(options: RunOptions): Promise { const { @@ -18,10 +18,15 @@ export async function run(options: RunOptions): Promise { console.log(pc.cyan("Starting opencode server...")) const abortController = new AbortController() - const timeoutId = setTimeout(() => { - console.log(pc.yellow("\nTimeout reached. Aborting...")) - abortController.abort() - }, timeout) + let timeoutId: ReturnType | null = null + + // timeout=0 means no timeout (run until completion) + if (timeout > 0) { + timeoutId = setTimeout(() => { + console.log(pc.yellow("\nTimeout reached. Aborting...")) + abortController.abort() + }, timeout) + } try { const { client, server } = await createOpencode({ @@ -29,7 +34,7 @@ export async function run(options: RunOptions): Promise { }) const cleanup = () => { - clearTimeout(timeoutId) + if (timeoutId) clearTimeout(timeoutId) server.close() } @@ -100,7 +105,7 @@ export async function run(options: RunOptions): Promise { throw err } } catch (err) { - clearTimeout(timeoutId) + if (timeoutId) clearTimeout(timeoutId) if (err instanceof Error && err.name === "AbortError") { return 130 }