Skip to content

feat(compaction): idle recompress past the provider cache ttl - #1151

Merged
TheGreatAxios merged 6 commits into
mainfrom
cl-8745-compaction-provider-aware-idle-recompress-cache-ttl-window
Sep 22, 2026
Merged

TheGreatAxios merged 6 commits into
mainfrom
cl-8745-compaction-provider-aware-idle-recompress-cache-ttl-window

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Under-threshold sessions recompress once past the provider cache TTL instead of only at 60% tokens
  • TTLs follow provider cache economics (5/10/15/60 min per provider, never for local inference)
  • Same compactor and consecutive-compact cap as the threshold path, so the fresh tail stays raw and no compact spiral starts

Verification

  • bun run check passes: lint, typecheck, dead-exports, build, 7836 tests with 0 failures
  • New mapping tests in src/provider/cache-ttl.test.ts plus 7 governor tests in src/agent/compaction.test.ts

Fixes CL-8745

@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

Targets release 0.3.31.

@linear-code

linear-code Bot commented Sep 21, 2026

Copy link
Copy Markdown

CL-8745

The TTL arm only defers while threshold arming is pending. After a
compact that stays over the high watermark, growth hysteresis clears
pending, so idle past the provider TTL still folds. Comments claimed
otherwise; keep the behavior and document it.

cacheTtlMsFor returns undefined only for missing, empty, or local
models; unknown strings get the default window.
Production LastCycleSource stamps a bare model and openai-compatible
provider. Keying TTL only off model treated local Ollama as a 10-minute
cache window.
The table key is bare ollama; the harness stamps slash-form on
sourceId. Stamp a production-looking Codex model on the governor
fixture instead of the helper default.
@TheGreatAxios
TheGreatAxios merged commit b4fab39 into main Sep 22, 2026
13 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-8745-compaction-provider-aware-idle-recompress-cache-ttl-window branch September 22, 2026 15:09
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