diff options
| author | Aiden Cline <[email protected]> | 2026-02-11 15:43:04 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-11 21:43:04 +0000 |
| commit | 8c7b35ad05c9dca5778501b287c5f17ee59dd0a2 (patch) | |
| tree | 671849049718697ea90adb88b88310a8d47c455b | |
| parent | e2a33f75e1635830b559322b507a7ed4ff114e59 (diff) | |
| download | opencode-8c7b35ad05c9dca5778501b287c5f17ee59dd0a2.tar.gz opencode-8c7b35ad05c9dca5778501b287c5f17ee59dd0a2.zip | |
tweak: compaction check (#13214)
| -rw-r--r-- | packages/opencode/src/session/compaction.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/opencode/src/session/compaction.ts b/packages/opencode/src/session/compaction.ts index 5660ca973..924542605 100644 --- a/packages/opencode/src/session/compaction.ts +++ b/packages/opencode/src/session/compaction.ts @@ -41,7 +41,9 @@ export namespace SessionCompaction { const reserved = config.compaction?.reserved ?? Math.min(COMPACTION_BUFFER, ProviderTransform.maxOutputTokens(input.model)) - const usable = input.model.limit.input ? input.model.limit.input - reserved : context - reserved + const usable = input.model.limit.input + ? input.model.limit.input - reserved + : context - ProviderTransform.maxOutputTokens(input.model) return count >= usable } |
