mirror of
https://fastgit.cc/https://github.com/anomalyco/opencode
synced 2026-04-21 05:10:58 +08:00
chore: generate
This commit is contained in:
@@ -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)))
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user