Repository navigation
fix(llm): clarify independent timeouts and deadline diagnostics - #1159
lizhengfeng101 merged 6 commits into
Conversation
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 3 selected item(s). |
The --timeout flag documents a concurrent-task timeout in minutes, but the per-request HTTP deadline stayed at the client's independent 5-minute default. A review of one slow file therefore failed with classification=timeout at duration_to_headers_ms≈300000 even when the caller granted --timeout 30, and no CLI setting could let the file review finish (issue alibaba#1155). ResolveOptions gains a TaskTimeout field: when no env (OCR_LLM_TIMEOUT) or config-file (timeout_sec) request timeout is set, the task budget raises the request deadline so a single request can use the whole task budget. Existing precedence is unchanged — env and config-file timeouts still win, and leaving --timeout at its default keeps the 5-minute client default. ocr review and ocr scan both pass their --timeout value through. Fixes alibaba#1155
5af41ca to
8707e4f
Compare
main replaced the per-file timeout flag with --timeout binding concurrentTaskTimeout, and the agent applies it as a context deadline across review rounds — but the per-request HTTP deadline stayed at the client's independent 5-minute default, so a single slow file request could still die inside a task that had plenty of budget left (alibaba#1155's original symptom). Wire ResolveOptions.TaskTimeout from the live opts.concurrentTaskTimeout (minutes) in both review and scan commands. Precedence is unchanged: env OCR_LLM_TIMEOUT and config-file timeout_sec still win, and an unset task timeout keeps the 5-minute client default.
|
Thanks for working on this, @nolanchic. To clarify the maintainer direction: we should not adopt option 1 from #1155. Please keep the task timeout and per-request HTTP timeout independent.
Please revise this PR toward option 2:
Completed-plan reuse on resume can remain a separate follow-up. Thanks! |
|
Hi @nolanchic, since I haven't heard back and would like to move this PR forward, I've taken over the follow-up work on this PR. Thanks for getting this started! |
Summary
Clarify the independent task and request timeouts and improve deadline diagnostics, without changing timeout defaults or retry behavior. This revision replaces the original proposal to derive the HTTP request timeout from
--timeout.Behavior
--timeoutremains the concurrent-task budget in minutes (default15;0disables the task deadline). Review multiplies this setting by the number of effort rounds.OCR_LLM_TIMEOUTor providertimeout_sec(also supported in the legacyllmsection). Precedence remains environment > configuration file > the 300-second client default. Increasing--timeoutdoes not extend an individual request's timeout.LLM request timeoutfromcaller deadline exceeded, preserving the original error chain anderrors.Isbehavior. The shared LLM helper does not attribute arbitrary caller deadlines to--timeout: background memory compression andocr llm testhave their own deadlines. Per-file review failure reasons distinguish request timeouts from task deadlines.For a slow request that legitimately needs more than five minutes, configure the request timeout explicitly, for example:
Changes and tests
Validation
make check,make test(including race detection), andmake coveragepassed; total coverage is 91.2%.05fb953b, including CI, Pages CI, translation sync, CodeQL, plugin contract, and CLA.Scope
Related to #1155. Completed-plan reuse on resume is not implemented here and remains a separate follow-up. No new timeout-retry policy is introduced.
AI assistance
The maintainer follow-up used Codex CLI (session model identifier:
gpt-6-astra) for implementation, tests, and documentation, andocr(configured review model:claude-opus-5) for automated code review. This disclosure covers the maintainer follow-up, not the original author's tooling.