Repository navigation
fix: let slow auto-compaction run to its configured timeout instead of stopping at 6 minutes - #201928
Conversation
The reply stall watchdog aborted overflow compaction at about six minutes, before compaction.timeoutSeconds could finish.
The repository formatter wants the timeout allowance on one line so the overflow compaction change stays check-clean.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR lets nested compaction use its existing timeout and gives the resumed turn a fresh stall window. Example: Auto-compaction has timeoutSeconds=600 and its quiet summary finishes after 420 seconds.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a demonstrated compaction failure still present on current main, with no actionable introduced defects found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe session-controller watchdog combines progress, request deadlines, and execution deadlines to decide whether an active reply may continue or must stop; compaction registers as a nested attempt under that owner. flowchart TD
A[Active reply] --> B[Session controller]
B --> C[Nested compaction]
C --> D[Summary model request]
C --> E[Watchdog deadline]
E --> F[Continue or stop reply]
D --> G[Resume turn]
Technical reviewBest possible solution: Use the existing watchdog's nested compaction deadline and release handoff while preserving foreground execution limits and user cancellation. Do we have a high-confidence way to reproduce the issue? Current-main source explains the failure after the summary request closes, and the supplied isolated Gateway comparison demonstrates that failure; this read-only review ran no reproduction. Is this the best way to solve the issue? The revised patch is the smallest complete fix using the existing watchdog owner: it honors nested maintenance deadlines and renews the semantic horizon at handoff without another wrapper or setting. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f96a979a0f3b. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +14, Tests +19. Total +33 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 19, 2026, 1:13 PM ET / 18:13 UTC (Revision 2). |
…eadline The reply watchdog measured a quiet compaction against the 6-minute semantic window from the last progress before compaction began. Its summary request was covered only while open, so once a long summary ended the turn was stopped as stalled even though the nested compaction attempt already declared its own deadline (compaction.timeoutSeconds). - The watchdog now counts a live nested maintenance attempt's execution deadline in the semantic deadline, and releasing it starts the semantic horizon (never retroactively), as runtime-owned waits already do. - Drop the separate compaction-watchdog-allowance module; the watchdog owner already has the hook. Keep its two checks as one compact watchdog regression.
Observed proof lines for #201576 (isolated |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thanks @chessing234 for the fix and @kazuyuki-eguchi for the clear report. This is merged in ea63462: a quiet auto-compaction now counts as progress for the reply stall watchdog until its own |
…f stopping at 6 minutes (openclaw#201928) Root cause: `src/sessions/session-controller.watchdog.ts:103` (base `c59f66b73e`) builds the reply watchdog's semantic deadline from the last progress plus 6 minutes and the open model requests only, so a nested compaction attempt's own deadline (`compaction.timeoutSeconds`, set in `compaction-session-agent.ts:221`) never counts and the turn is stopped as stalled once a long compaction summary has run past 6 minutes. Fixes openclaw#201576 Thanks @kazuyuki-eguchi for the detailed report and timeline, and @chessing234 for the first fix in this PR (its two checks are kept as one regression in the watchdog suite). ## What Problem This Solves With `agents.defaults.compaction.timeoutSeconds: 600`, auto-compaction on a slow local model was cut off after about 6 minutes with `Reply operation stalled`, so the 600 s budget could never be used. The turn failed, the next turn hit the same overflow, and the cycle repeated. ## User Impact User impact: a quiet auto-compaction can now run until its own `compaction.timeoutSeconds`, and the turn continues once the summary arrives. Stop still cancels compaction at once, compaction still ends at its own timeout, and an ordinary stalled model call is still stopped at the usual window. ## Why This Change Was Made Compaction already registers with the reply watchdog as a nested maintenance attempt with its own deadline (refreshed while it makes progress). The watchdog honoured that deadline only as a hard stop, not as a reason the turn was not stalled. It covered the summary request only while it was open, measured from the last progress before compaction began. Now a live nested attempt's deadline counts toward the stall window, and when compaction finishes the stall window restarts from that point. Native runtime-owned waits already work this way. No new setting, timeout or wording. The earlier version of this PR added a separate `compaction-watchdog-allowance` module around recovery compaction. It is removed: the watchdog owner already has the hook, and this covers every compaction that runs through the compaction session, not only recovery. ## Evidence Isolated Gateway (`ocx src`, pinned Bun, task-owned state), reporter's compaction config (`safeguard`, `qualityGuard`, `midTurnPrecheck`, `timeoutSeconds: 600`), and a scripted local OpenAI-compatible model. A turn reads large files, mid-turn context pressure triggers auto-compaction, and the compaction summary request stays quiet. Only the Gateway process's clock is stepped. Observed lines: openclaw#201928 (comment) | Case | Base `c59f66b73e` (main) | This PR | | --- | --- | --- | | Quiet summary, answered after 420 s | `lane task error: lane=main durationMs=427663 error="Reply operation stalled"`, `caller_signal_aborted`; user sees "Your request couldn't be completed." | `auto-compaction succeeded ...; retrying prompt`, turn answers | | Quiet past 600 s | n/a | compaction ends at its own timeout (`[compaction-diag] fallback ... reason=timeout`), turn continues | | User Stop during compaction | n/a | `chat.abort` -> compaction ends 190 ms later, `agent run aborted` | | Ordinary model call quiet 370 s, no compaction | request closed at the window, then retried | same | Regression: `session-controller.watchdog.test.ts` "lets quiet compaction outlast the stall window while Stop still cancels it" fails on base (stopped as stalled at 7 min) and passes here. Change size against the merge base: production +16/-2 (one file), tests +19. The contributor's new module and its test (+89) and the `compaction-runtime.ts` wrapper are gone. Merge danger: two-way door, no stored state or config change; revert restores the old window. Blast radius: replies whose turn runs compaction (embedded runtime), and only while compaction runs; ordinary model and tool stalls are unchanged. Co-authored-by: Ayaan Zaidi <[email protected]>
…f stopping at 6 minutes (#201928) Root cause: `src/sessions/session-controller.watchdog.ts:103` (base `0eb6488cd3`) builds the reply watchdog's semantic deadline from the last progress plus 6 minutes and the open model requests only, so a nested compaction attempt's own deadline (`compaction.timeoutSeconds`, set in `compaction-session-agent.ts:221`) never counts and the turn is stopped as stalled once a long compaction summary has run past 6 minutes. Fixes #201576 Thanks @kazuyuki-eguchi for the detailed report and timeline, and @chessing234 for the first fix in this PR (its two checks are kept as one regression in the watchdog suite). ## What Problem This Solves With `agents.defaults.compaction.timeoutSeconds: 600`, auto-compaction on a slow local model was cut off after about 6 minutes with `Reply operation stalled`, so the 600 s budget could never be used. The turn failed, the next turn hit the same overflow, and the cycle repeated. ## User Impact User impact: a quiet auto-compaction can now run until its own `compaction.timeoutSeconds`, and the turn continues once the summary arrives. Stop still cancels compaction at once, compaction still ends at its own timeout, and an ordinary stalled model call is still stopped at the usual window. ## Why This Change Was Made Compaction already registers with the reply watchdog as a nested maintenance attempt with its own deadline (refreshed while it makes progress). The watchdog honoured that deadline only as a hard stop, not as a reason the turn was not stalled. It covered the summary request only while it was open, measured from the last progress before compaction began. Now a live nested attempt's deadline counts toward the stall window, and when compaction finishes the stall window restarts from that point. Native runtime-owned waits already work this way. No new setting, timeout or wording. The earlier version of this PR added a separate `compaction-watchdog-allowance` module around recovery compaction. It is removed: the watchdog owner already has the hook, and this covers every compaction that runs through the compaction session, not only recovery. ## Evidence Isolated Gateway (`ocx src`, pinned Bun, task-owned state), reporter's compaction config (`safeguard`, `qualityGuard`, `midTurnPrecheck`, `timeoutSeconds: 600`), and a scripted local OpenAI-compatible model. A turn reads large files, mid-turn context pressure triggers auto-compaction, and the compaction summary request stays quiet. Only the Gateway process's clock is stepped. Observed lines: #201928 (comment) | Case | Base `0eb6488cd3` (main) | This PR | | --- | --- | --- | | Quiet summary, answered after 420 s | `lane task error: lane=main durationMs=427663 error="Reply operation stalled"`, `caller_signal_aborted`; user sees "Your request couldn't be completed." | `auto-compaction succeeded ...; retrying prompt`, turn answers | | Quiet past 600 s | n/a | compaction ends at its own timeout (`[compaction-diag] fallback ... reason=timeout`), turn continues | | User Stop during compaction | n/a | `chat.abort` -> compaction ends 190 ms later, `agent run aborted` | | Ordinary model call quiet 370 s, no compaction | request closed at the window, then retried | same | Regression: `session-controller.watchdog.test.ts` "lets quiet compaction outlast the stall window while Stop still cancels it" fails on base (stopped as stalled at 7 min) and passes here. Change size against the merge base: production +16/-2 (one file), tests +19. The contributor's new module and its test (+89) and the `compaction-runtime.ts` wrapper are gone. Merge danger: two-way door, no stored state or config change; revert restores the old window. Blast radius: replies whose turn runs compaction (embedded runtime), and only while compaction runs; ordinary model and tool stalls are unchanged. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit ea63462) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 507c007d1344991cceb0110b114e5c80b23ce0fb)
Root cause:
src/sessions/session-controller.watchdog.ts:103(base0eb6488cd3) builds the reply watchdog's semantic deadline from the last progress plus 6 minutes and the open model requests only, so a nested compaction attempt's own deadline (compaction.timeoutSeconds, set incompaction-session-agent.ts:221) never counts and the turn is stopped as stalled once a long compaction summary has run past 6 minutes.Fixes #201576
Thanks @kazuyuki-eguchi for the detailed report and timeline, and @chessing234 for the first fix in this PR (its two checks are kept as one regression in the watchdog suite).
What Problem This Solves
With
agents.defaults.compaction.timeoutSeconds: 600, auto-compaction on a slow local model was cut off after about 6 minutes withReply operation stalled, so the 600 s budget could never be used. The turn failed, the next turn hit the same overflow, and the cycle repeated.User Impact
User impact: a quiet auto-compaction can now run until its own
compaction.timeoutSeconds, and the turn continues once the summary arrives. Stop still cancels compaction at once, compaction still ends at its own timeout, and an ordinary stalled model call is still stopped at the usual window.Why This Change Was Made
Compaction already registers with the reply watchdog as a nested maintenance attempt with its own deadline (refreshed while it makes progress). The watchdog honoured that deadline only as a hard stop, not as a reason the turn was not stalled. It covered the summary request only while it was open, measured from the last progress before compaction began. Now a live nested attempt's deadline counts toward the stall window, and when compaction finishes the stall window restarts from that point. Native runtime-owned waits already work this way. No new setting, timeout or wording.
The earlier version of this PR added a separate
compaction-watchdog-allowancemodule around recovery compaction. It is removed: the watchdog owner already has the hook, and this covers every compaction that runs through the compaction session, not only recovery.Evidence
Isolated Gateway (
ocx src, pinned Bun, task-owned state), reporter's compaction config (safeguard,qualityGuard,midTurnPrecheck,timeoutSeconds: 600), and a scripted local OpenAI-compatible model. A turn reads large files, mid-turn context pressure triggers auto-compaction, and the compaction summary request stays quiet. Only the Gateway process's clock is stepped. Observed lines: #201928 (comment)0eb6488cd3(main)lane task error: lane=main durationMs=427663 error="Reply operation stalled",caller_signal_aborted; user sees "Your request couldn't be completed."auto-compaction succeeded ...; retrying prompt, turn answers[compaction-diag] fallback ... reason=timeout), turn continueschat.abort-> compaction ends 190 ms later,agent run abortedRegression:
session-controller.watchdog.test.ts"lets quiet compaction outlast the stall window while Stop still cancels it" fails on base (stopped as stalled at 7 min) and passes here.Change size against the merge base: production +16/-2 (one file), tests +19. The contributor's new module and its test (+89) and the
compaction-runtime.tswrapper are gone.Merge danger: two-way door, no stored state or config change; revert restores the old window. Blast radius: replies whose turn runs compaction (embedded runtime), and only while compaction runs; ordinary model and tool stalls are unchanged.