feat: make preemptive compaction enabled by default (#372)

This commit is contained in:
Sisyphus
2025-12-31 12:55:39 +09:00
committed by GitHub
parent 471cf868ff
commit 7cb3f23c2b
8 changed files with 43 additions and 27 deletions

View File

@@ -82,10 +82,12 @@ export function createPreemptiveCompactionHook(
const experimental = options?.experimental
const onBeforeSummarize = options?.onBeforeSummarize
const getModelLimit = options?.getModelLimit
const enabled = experimental?.preemptive_compaction === true
// Preemptive compaction is now enabled by default.
// Backward compatibility: explicit false in experimental config disables the hook.
const explicitlyDisabled = experimental?.preemptive_compaction === false
const threshold = experimental?.preemptive_compaction_threshold ?? DEFAULT_THRESHOLD
if (!enabled) {
if (explicitlyDisabled) {
return { event: async () => {} }
}