You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tracked job lifecycle: hard timeouts and runner watchdogs #13
runTrackedJob in plugins/opencode/scripts/lib/tracked-jobs.mjs:64 wraps the runner promise with no wall-clock guard:
constresult=awaitrunner({ report, log });
If the runner stalls (dropped SSE, unresponsive provider after the HTTP call returns, an exception inside getSessionDiff, a wedged subsequent API call), the await never resolves and nothing writes a terminal status for the job. The job file stays status: "running" forever until SessionEnd reaps it — and SessionEnd only reaps jobs whose PID is already dead.
Partial mitigation already exists: sendPrompt in lib/opencode-server.mjs:195 wraps its fetch in AbortSignal.timeout(600_000), so the big inference call has a 10-minute cap. But everything outside that single fetch (the diff fetch in handleTask, JSON parsing, result-file writes) is unguarded.
Suggested fix
Add taskTimeoutMs option to runTrackedJob (default ~15 min, configurable via env or setup state). On expiry, write failed + phase: "timeout" and reject.
Optional: idle-watchdog on report() calls — if no progress for N seconds, fail.
changed the title [-]runTrackedJob can hang indefinitely — no wall-clock timeout[/-][+]Tracked job lifecycle: hard timeouts and runner watchdogs[/+]on Apr 12, 2026
Consolidating related implementation detail from #41 into this canonical tracked-job timeout issue. Scope now includes the hard timeout, runner/exit-promise race, and any watchdog needed to guarantee terminal job state.
Hard timeout implemented in PR #51 commit cad21e8 (runTrackedJob gains Promise.race against 30min wall-clock). Issue was a parent tracking stub; implementation is done.
Activity
[-]runTrackedJob can hang indefinitely — no wall-clock timeout[/-][+]Tracked job lifecycle: hard timeouts and runner watchdogs[/+]JohnnyVicious commentedon Apr 12, 2026
Consolidating related implementation detail from #41 into this canonical tracked-job timeout issue. Scope now includes the hard timeout, runner/exit-promise race, and any watchdog needed to guarantee terminal job state.
JohnnyVicious commentedon Apr 12, 2026
Hard timeout implemented in PR #51 commit cad21e8 (runTrackedJob gains Promise.race against 30min wall-clock). Issue was a parent tracking stub; implementation is done.