fix(opencode): separate per-file and overall timeouts - #717
Conversation
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 2 selected item(s). |
|
timeoutMinutes is documented as a per-file timeout, but runOcr.timeoutMs limits the entire review process. |
6f2bbbd to
5b33909
Compare
|
Good catch. I rebased onto current
The regression exercises |
|
Nice fix — separating per-file and overall timeouts is the right call. One suggestion: Consider a generous default overall timeout instead of no timeout. The original 15-minute default was clearly too short for multi-file reviews, but swinging to "no implicit timeout" removes the safety net entirely. If the abort signal never fires (e.g., OpenCode itself crashes or the host process dies), the OCR process will hang indefinitely. A default of ~60 minutes would be a reasonable middle ground:
Something like: const defaultOverallMs = 60 * 60 * 1000
const options: RunOptions = {
cwd,
signal: context.abort,
timeoutMs: input.overallTimeoutMinutes !== undefined
? input.overallTimeoutMinutes * 60 * 1000
: defaultOverallMs,
}Defense in depth — the safety net should exist but stay out of the way. |
lizhengfeng101
left a comment
There was a problem hiding this comment.
Consider a generous default overall timeout instead of no timeout. @Linxiushen
Description
timeoutMinutesis a per-file OCR setting, while the plugin watchdog covers the complete multi-file process. Treating them as one value can terminate valid work, especially across multiple files.This change keeps the two policies independent:
timeoutMinutesis passed only to OCR's per-file--timeoutflag;overallTimeoutMinutescontrols the enclosing process watchdog;main, including the newer process-group termination behavior.Type of Change
How Has This Been Tested?
Tested on Windows with Node.js 24:
tsc -p tsconfig.json --noEmitnode --test test/*.test.mjs(21 passed, 1 platform-specific skip)git diff --checkChecklist
Related Issues
Addresses the confirmed H1 finding in #702.
AI Assistance
AI-assisted tooling was used during implementation. I reviewed the final diff and ran the typecheck and complete plugin test suite locally.