-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Make MAX_OVERFLOW_COMPACTION_ATTEMPTS config-driven (currently hardcoded to 3) #80638
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
MAX_OVERFLOW_COMPACTION_ATTEMPTS = 3is a hardcoded const atpi-embedded-Bcz04p2i.js:1955(verified in 2026.5.7 tarball). When a long-lived agent hits context-overflow, the runtime tries up to 3 LLM-summarizer compactions before bubbling the error. Each attempt is a billable model round-trip. For agents on per-seat ChatGPT Team/Pro/Enterprise quotas, a sustained overflow loop burns the seat very fast.Real-world impact
A long-lived
agent:<bot>:mainsession runningopenai-codex/gpt-5.5:The 2026.5.4 post-compaction loop guard helps when the agent is repeating the same
(tool, args, result)triple, but it does not protect against compaction itself running 3× per overflow on a session where the summary is structurally too large.Proposed fix
Expose as
agents.defaults.compaction.maxOverflowAttempts(default 3, lower to 1 to fail-fast on overflow). Sibling keys (compaction.mode,compaction.reserveTokens,compaction.recentTurnsPreserve) suggest this slot is the natural home.Related
(Re-filed from
badlogic/pi#4— filed in wrong repo originally.)