Skip to content

Commit f3d5a71

Browse files
chore: generate
1 parent c6c56ac commit f3d5a71

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

packages/opencode/src/session/compaction.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ type Turn = {
4545
function preserveRecentBudget(input: { cfg: Config.Info; model: Provider.Model }) {
4646
return (
4747
input.cfg.compaction?.preserve_recent_tokens ??
48-
Math.min(
49-
MAX_PRESERVE_RECENT_TOKENS,
50-
Math.max(MIN_PRESERVE_RECENT_TOKENS, Math.floor(usable(input) * 0.25)),
51-
)
48+
Math.min(MAX_PRESERVE_RECENT_TOKENS, Math.max(MIN_PRESERVE_RECENT_TOKENS, Math.floor(usable(input) * 0.25)))
5249
)
5350
}
5451

packages/opencode/test/session/compaction.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,12 @@ describe("session.compaction.process", () => {
925925
auto: false,
926926
})
927927

928-
const rt = runtime("continue", Plugin.defaultLayer, wide(), cfg({ tail_turns: 2, preserve_recent_tokens: 10_000 }))
928+
const rt = runtime(
929+
"continue",
930+
Plugin.defaultLayer,
931+
wide(),
932+
cfg({ tail_turns: 2, preserve_recent_tokens: 10_000 }),
933+
)
929934
try {
930935
const msgs = await svc.messages({ sessionID: session.id })
931936
const parent = msgs.at(-1)?.info.id

0 commit comments

Comments
 (0)