fix(agents): use configured compaction timeout for aggregate retry deadline#94407
Closed
zhangqueping wants to merge 1 commit into
Closed
fix(agents): use configured compaction timeout for aggregate retry deadline#94407zhangqueping wants to merge 1 commit into
zhangqueping wants to merge 1 commit into
Conversation
…adline Replace the hardcoded COMPACTION_RETRY_AGGREGATE_TIMEOUT_MS (60s) with resolveCompactionTimeoutMs(params.config), which reads the user-configured agents.defaults.compaction.timeoutSeconds (default 180s). On large sessions (~200K tokens), the compaction summary model call can take 143–187s. The hardcoded 60s deadline abandons valid results before the provider finishes, triggering a self-compounding retry storm where every attempt times out while the provider is still processing. Fixes openclaw#94391
This was referenced Jun 18, 2026
Contributor
|
Superseded by #94421, landed as 9a57139. The landed fix follows both compaction and the active retry stream, preserving deadlock recovery when both lifecycle facts are idle. Thank you @zhangqueping for investigating #94391 and contributing a fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace the hardcoded 60-second
COMPACTION_RETRY_AGGREGATE_TIMEOUT_MSwithresolveCompactionTimeoutMs(params.config), which reads the user-configuredagents.defaults.compaction.timeoutSeconds(default 180s).On large sessions (~200K tokens), the compaction summary model call can take
143–187s. The hardcoded 60s deadline abandons valid results before the
provider finishes, triggering a self-compounding retry storm where every
attempt times out while the provider is still processing. The result is
paid for by the user but discarded by OpenClaw.
Fixes #94391
Real behavior proof
Behavior addressed:
Compaction retry aggregate timeout now respects the user-configured
agents.defaults.compaction.timeoutSecondsinstead of a hardcoded 60s.Large sessions whose compaction model calls exceed 60s no longer suffer
a self-compounding retry storm.
Real environment tested:
Linux x64, Node 24.13.1
Exact steps or command run after this patch:
After-fix evidence:
Observed result after the fix:
resolveCompactionTimeoutMs(params.config)now returns the user-configuredvalue (or the default 180s), ensuring the aggregate retry deadline matches
the compaction model timeout. The previous 60s hardcoded floor is removed.
What was not tested:
Changes
One line changed in
src/agents/embedded-agent-runner/run/attempt.ts:resolveCompactionTimeoutMsreads from the existing config pathagents.defaults.compaction.timeoutSecondsand was already importedin this file (line 257).
Risk / scope
when the user configures a higher timeout
see longer waits. Mitigation: they can set
compaction.timeoutSecondsto a lower value