chore: generate

This commit is contained in:
opencode-agent[bot]
2026-04-20 06:07:28 +00:00
parent c6c56ac2cf
commit f3d5a71620
2 changed files with 7 additions and 5 deletions

View File

@@ -45,10 +45,7 @@ type Turn = {
function preserveRecentBudget(input: { cfg: Config.Info; model: Provider.Model }) {
return (
input.cfg.compaction?.preserve_recent_tokens ??
Math.min(
MAX_PRESERVE_RECENT_TOKENS,
Math.max(MIN_PRESERVE_RECENT_TOKENS, Math.floor(usable(input) * 0.25)),
)
Math.min(MAX_PRESERVE_RECENT_TOKENS, Math.max(MIN_PRESERVE_RECENT_TOKENS, Math.floor(usable(input) * 0.25)))
)
}

View File

@@ -925,7 +925,12 @@ describe("session.compaction.process", () => {
auto: false,
})
const rt = runtime("continue", Plugin.defaultLayer, wide(), cfg({ tail_turns: 2, preserve_recent_tokens: 10_000 }))
const rt = runtime(
"continue",
Plugin.defaultLayer,
wide(),
cfg({ tail_turns: 2, preserve_recent_tokens: 10_000 }),
)
try {
const msgs = await svc.messages({ sessionID: session.id })
const parent = msgs.at(-1)?.info.id