mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-28 04:29:42 +00:00
chore: generate
This commit is contained in:
parent
c6c56ac2cf
commit
f3d5a71620
2 changed files with 7 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue