[PR #13034] test(compaction): failing tests for missing headroom when limit.input is set #14486

Closed
opened 2026-02-16 18:19:16 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13034

State: closed
Merged: Yes


Relates to #10634

adds 3 failing tests showing that isOverflow() doesn't reserve any headroom when limit.input is set, unlike the context - output fallback path.

basically if you have a model with limit.input = 200K and you've used 198K tokens, isOverflow says you're fine. next turn overflows.

without limit.input, same scenario correctly triggers compaction because it uses context - output (168K).

the diff between the two paths is exactly 32K — the output budget that's not being subtracted.

was hitting this with claude models in our tui project and traced it to line 37 in compaction.ts. saw #6875 and #12924 are both trying to fix this — these tests should pass once either lands.

related: #10634 #8089 #11086

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13034 **State:** closed **Merged:** Yes --- Relates to #10634 adds 3 failing tests showing that `isOverflow()` doesn't reserve any headroom when `limit.input` is set, unlike the `context - output` fallback path. basically if you have a model with `limit.input = 200K` and you've used 198K tokens, `isOverflow` says you're fine. next turn overflows. without `limit.input`, same scenario correctly triggers compaction because it uses `context - output` (168K). the diff between the two paths is exactly 32K — the output budget that's not being subtracted. was hitting this with claude models in our tui project and traced it to line 37 in compaction.ts. saw #6875 and #12924 are both trying to fix this — these tests should pass once either lands. related: #10634 #8089 #11086
yindo added the pull-request label 2026-02-16 18:19:16 -05:00
yindo closed this issue 2026-02-16 18:19:16 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14486