Skip to content

CL-9006: fix automatic compaction governor so post-compact above-threshold sessions latch - #1175

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-9006-fix-automatic-compaction-governor-so-post-compact-above
Sep 27, 2026
Merged

TheGreatAxios merged 3 commits into
mainfrom
cl-9006-fix-automatic-compaction-governor-so-post-compact-above

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Post-compact measurements still over the high watermark latched instead of re-arming on resume-delta-scale growth.

  • Shared re-arm rule in src/provider/context-window.ts: COMPACTION_WIDE_RESUME_FRACTION (0.2, danger-anchored), hasWideResumeGap, isAtOrUnderCompactThreshold; replaces COMPACTION_RESUME_FRACTION/compactionResumeDeltaFor.
  • src/agent/compaction.ts: latch clears only on under-watermark fold evidence; consecutive-compact cap and overflow budget reset only there too — tool-call occupancy no longer resets either rail.
  • Tests: red commit ab31daef failed 5/6 new latch tests before the fix; green commit 8011e728 passes. Full suite bun test ./src ./tests ./evals ./scripts --randomize --seed 424242: 8036 pass, 0 fail. bun run typecheck exit 0, bun run lint exit 0, dead-exports guard exit 0.

Fixes CL-9006

@linear-code

linear-code Bot commented Sep 25, 2026

Copy link
Copy Markdown

CL-9006

@TheGreatAxios
TheGreatAxios merged commit 5cf8c62 into main Sep 27, 2026
13 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-9006-fix-automatic-compaction-governor-so-post-compact-above branch September 27, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant