fix(sisyphus-agent): remove 30min timeout and add realtime output buffering
- Remove DEFAULT_TIMEOUT_MS (set to 0) to allow CI agent runs to complete without timeout
- Add stdbuf -oL -eL for unbuffered realtime output in GitHub Actions
- Update timeout logic to only set timeout when value > 0
This fixes CI agent runs that were timing out after 30 minutes and not showing realtime output.
🤖 Generated with assistance of OhMyOpenCode
This commit is contained in:
2
.github/workflows/sisyphus-agent.yml
vendored
2
.github/workflows/sisyphus-agent.yml
vendored
@@ -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
|
||||
|
||||
@@ -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<number> {
|
||||
const {
|
||||
@@ -18,10 +18,15 @@ export async function run(options: RunOptions): Promise<number> {
|
||||
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<typeof setTimeout> | 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<number> {
|
||||
})
|
||||
|
||||
const cleanup = () => {
|
||||
clearTimeout(timeoutId)
|
||||
if (timeoutId) clearTimeout(timeoutId)
|
||||
server.close()
|
||||
}
|
||||
|
||||
@@ -100,7 +105,7 @@ export async function run(options: RunOptions): Promise<number> {
|
||||
throw err
|
||||
}
|
||||
} catch (err) {
|
||||
clearTimeout(timeoutId)
|
||||
if (timeoutId) clearTimeout(timeoutId)
|
||||
if (err instanceof Error && err.name === "AbortError") {
|
||||
return 130
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user