core: fix compaction config checks to properly respect user settings

pull/5845/head^2
Dax Raad 2025-12-26 19:48:56 -05:00
parent 2cdc88d295
commit 2b054bec95
1 changed files with 2 additions and 2 deletions

View File

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