fix(daemon): give AMR the Cloud first-output budget - #7495
Conversation
The first-output watchdog gave AMR a two-minute absolute budget: past it the daemon surfaced an error, burned a same-run retry, and SIGTERM'd the child. First-token latency tracks context size (p90 = 277s past 600k tokens), so healthy turns were being declared dead — across 14 days, 968 runs emitted their first output more than ten minutes in and then succeeded. Align the budget with the product's decision in 《Open Design 报错体验 设计方案》 §3: 「10 分钟(Cloud 30 分钟)没输出才报超时」. AMR (`amr_cloud`) is that document's Cloud runtime, so its budget becomes 30 minutes — matching the sliding inactivity watchdog and the ACP stage watchdog it sits beside. Every other runtime keeps its first-output watchdog disabled, which already satisfies 「不到超时不报错」. Also stop diagnosing the user's model. The timeout sentence asserted "The model or CLI likely hung while generating"; the daemon observed silence, not a hang, and the data says that guess is usually wrong. The daemon now reports only what it saw, and the card renders the design's copy off `failure_detail` — 「等了 N 分钟没有新的输出,先停下来了 —— 已做的部分都保留着。」 — in all 19 locales.
|
🧪 This PR has changes that need a manual QA pass before merge — please hold off self-merging for now; we'll loop QA in once it's merge-ready. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0dd2870c7c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
nettee
left a comment
There was a problem hiding this comment.
The 30-minute AMR value addresses the original short deadline, but the default ACP path still lets its prompt-stage watchdog win the same deadline on a silent bridge. That bypasses the new first-output classification and the localized duration/work-preserved card; the inline comment details the timer ordering and the regression coverage needed.
🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.












































Why
We are taking over the abandoned draft #7342 on a clean latest-
mainbranch. Its original commit and author are preserved; the two current-main conflicts are resolved without dropping the newer membership-concurrency guidance, and the outstanding duration-rounding review comment is fixed.AMR's first-output watchdog is now a 15-minute absolute deadline. Production evidence from the Vela stream-establishment monitor shows why the former 120-second threshold terminated healthy long-tail requests across providers, not only Claude/Bedrock:
request_body_written + caller_cancelledfailures in the observed window.The approved policy gives AMR (
amr_cloud) a 15-minute absolute first-output deadline while retaining its 30-minute sliding inactivity watchdog. The closed #7406 moved the limit only to 150 seconds; it was correctly closed as a duplicate.Related:
What users will see
The separate 60-second waiting hint and Continue Running button remain out of scope.
Surface area
OD_CHAT_RUN_FIRST_OUTPUT_TIMEOUT_MSalready exists and retains override/0disable semanticsScreenshots
No new UI entry point or component. This changes the threshold and localized sentence inside the existing run-error card; English and Chinese copy are pinned by
apps/web/tests/i18n/runErrors.test.ts.Bug fix verification
apps/daemon/tests/amr-first-output-budget.test.ts— real server + child + ACP heartbeat-only stall; old behavior/copy was red onmainin fix(daemon): stop killing AMR turns at 120s of first-token silence #7342 and is green here.apps/daemon/tests/runtimes/chat-run-inactivity-timeout.test.ts— shipped 15-minute first-output budget, 30-minute inactivity budget, and non-AMR guard.apps/web/tests/runtime/amr-guidance.test.ts— duration readback, 59.5-second floor, 90-second singular, unreadable fallback, and current-main failure mappings.packages/contracts/tests/runtime/agent-stall-timeout.test.ts— shared daemon formatter/parser ownership so prose cannot drift silently.apps/web/tests/i18n/runErrors.test.ts— timeout copy and no-causal-guess contract.Validation
pnpm guard— passedpnpm typecheckusing repository-pinnedpnpm@10.33.2— passed