Skip to content

Commit 2b054be

Browse files
committed
core: fix compaction config checks to properly respect user settings
1 parent 2cdc88d commit 2b054be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/opencode/src/session/compaction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export namespace SessionCompaction {
2929

3030
export async function isOverflow(input: { tokens: MessageV2.Assistant["tokens"]; model: Provider.Model }) {
3131
const config = await Config.get()
32-
if ((config.compaction?.auto ?? true) === false) return false
32+
if (config.compaction?.auto === false) return false
3333
const context = input.model.limit.context
3434
if (context === 0) return false
3535
const count = input.tokens.input + input.tokens.cache.read + input.tokens.output
@@ -48,7 +48,7 @@ export namespace SessionCompaction {
4848
// tool calls that are no longer relevant.
4949
export async function prune(input: { sessionID: string }) {
5050
const config = await Config.get()
51-
if ((config.compaction?.prune ?? true) === false) return
51+
if (config.compaction?.prune === false) return
5252
log.info("pruning")
5353
const msgs = await Session.messages({ sessionID: input.sessionID })
5454
let total = 0

0 commit comments

Comments
 (0)