feat(compaction): disable thinking by default; add compaction.thinking override#34554
Closed
iamcobolt wants to merge 2 commits intoopenclaw:mainfrom
Closed
feat(compaction): disable thinking by default; add compaction.thinking override#34554iamcobolt wants to merge 2 commits intoopenclaw:mainfrom
iamcobolt wants to merge 2 commits intoopenclaw:mainfrom
Conversation
…g override Compaction now runs with thinking=off by default, regardless of the session model's thinking level. On channels with strict reply windows (Discord 30s, Telegram 240s), extended thinking during compaction can race against the channel timeout and trigger a stale-response loop (openclaw#25272). New config key: agents.defaults.compaction.thinking ("off" | "on") - "off" (default): compaction always runs without extended thinking - "on": inherits the session model's current thinking level; retries once without thinking on timeout Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Mar 4, 2026
70f0272 to
d3f57ae
Compare
Contributor
|
I found one blocking issue in the new timeout-retry path: on timeout, attempt 2 can start while attempt 1 compaction is still running. |
7 tasks
Contributor
|
This PR has gone stale. Closing for now. Feel free to re-open if still needed on an up-to-date branch. |
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
thinking:high) can take 4+ minutes to compact — exceeding channel timeout windows (Discord 30s, Telegram 240s) and causing a stale-response retry loop (Compaction timeout races against channel timeout, causing stale-response loop #25272).thinking=offby default regardless of session model. Newagents.defaults.compaction.thinkingkey —"off"(default) or"on"(inherit the session model's current thinking level). When a compaction run times out with thinking enabled, the runner retries once without thinking automatically. Thebefore_compactionhook is guarded to fire exactly once per compaction event.run.tsare unchanged; no new network calls or auth paths.Schema
agents.defaults.compaction.thinking:"off"(default) |"on""off": compaction always runs without extended thinking regardless of the session model — preventing timeout races on channels with strict reply windows."on": compaction inherits the session model's current thinking level. On timeout, automatically retries once without thinking.Renders as a two-button segmented control in the config UI.
UI — Before / After
Before (upstream
main— no Compaction Thinking field):After — new
Compaction Thinkingfield withoff / onsegmented control:Change Type
Scope
Linked Issue/PR
compaction.fallbackModel)User-visible / Behavior Changes
thinking: offby default. Existing sessions unaffected — this only changes the thinking level used during the compaction summarization turn.agents.defaults.compaction.thinking(opt-in; defaults to"off").Security Impact
Repro + Verification
thinking: high)[compaction-diag]log showsthinking=off)agents.defaults.compaction.thinking: "on", repeat — confirm thinking is used and timeout-retry path activates if neededEvidence
resolveCompactionThinkLevelbranches (absent,"off","on"with various session levels)thinking=${effectiveThinkLevel} thinkAttempt=${thinkAttempt}on every[compaction-diag] start/endlineHuman Verification
pnpm tsgoclean,pnpm checkpasses"off"with thinking session,"on"with non-thinking session,hookFiredguardCompatibility / Migration
thinkingis optional; default is"off"(no change for existing sessions without explicit opt-in)agents.defaults.compaction.thinking: "on"Failure Recovery
agents.defaults.compaction.thinkingfrom config (or set to"off")resolveCompactionThinkLevelreturn value in logsRisks and Mitigations
thinking: "on"who expect fast compaction may see slower compaction on first attempt before timeout-retry kicks in."on"is opt-in; default is"off"which is strictly faster.