Skip to content

fix(core): clamp compaction output budget#36745

Merged
thdxr merged 1 commit into
v2from
clamp-output-budget
Jul 13, 2026
Merged

fix(core): clamp compaction output budget#36745
thdxr merged 1 commit into
v2from
clamp-output-budget

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Summary

  • clamp the output-token reservation used by V2 automatic compaction to 32k, matching V1
  • prevent models advertising output equal to context (including Kimi K2.7 Code) from compacting after every non-empty step
  • add a regression test for a 262k context/output model after a 9.5k-token step

Root cause

V2 subtracted the raw advertised output limit from the context limit. For models with output === context, the automatic compaction threshold became zero.

Tests

  • bun test test/session-runner.test.ts
  • bun typecheck

@thdxr thdxr merged commit fbe7f26 into v2 Jul 13, 2026
10 checks passed
@thdxr thdxr deleted the clamp-output-budget branch July 13, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant