Skip to content

fix(cli): avoid repeat compaction from stale totals - #10922

Merged
catrielmuller merged 1 commit into
mainfrom
laced-secure
Jun 10, 2026
Merged

fix(cli): avoid repeat compaction from stale totals#10922
catrielmuller merged 1 commit into
mainfrom
laced-secure

Conversation

@catrielmuller

Copy link
Copy Markdown
Contributor

Summary

  • Use normalized token buckets, including reasoning tokens, for local auto-compaction threshold decisions.
  • Fall back to provider-reported totals only when granular usage is unavailable, preserving recovery for providers that expose totals alone.
  • Prevent an inconsistent provider total from causing an unnecessary immediate second compaction after context has already been reduced.

Closes #10888

@kilo-code-bot

kilo-code-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • .changeset/avoid-repeat-compactions.md
  • packages/opencode/src/kilocode/session/overflow.ts
  • packages/opencode/src/session/overflow.ts
  • packages/opencode/test/kilocode/session-overflow.test.ts

Reviewed by claude-4.6-sonnet-20260217 · 485,289 tokens

Review guidance: REVIEW.md from base branch main

@catrielmuller
catrielmuller merged commit 5d04b25 into main Jun 10, 2026
22 of 24 checks passed
@catrielmuller
catrielmuller deleted the laced-secure branch June 10, 2026 16:15
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
fix(cli): avoid repeat compaction from stale totals
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.

Auto-compaction runs twice in a row

2 participants