mirror of
https://github.com/anomalyco/opencode.git
synced 2026-06-01 19:05:38 +00:00
chore: generate
This commit is contained in:
@@ -45,10 +45,7 @@ type Turn = {
|
|||||||
function preserveRecentBudget(input: { cfg: Config.Info; model: Provider.Model }) {
|
function preserveRecentBudget(input: { cfg: Config.Info; model: Provider.Model }) {
|
||||||
return (
|
return (
|
||||||
input.cfg.compaction?.preserve_recent_tokens ??
|
input.cfg.compaction?.preserve_recent_tokens ??
|
||||||
Math.min(
|
Math.min(MAX_PRESERVE_RECENT_TOKENS, Math.max(MIN_PRESERVE_RECENT_TOKENS, Math.floor(usable(input) * 0.25)))
|
||||||
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,
|
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 {
|
try {
|
||||||
const msgs = await svc.messages({ sessionID: session.id })
|
const msgs = await svc.messages({ sessionID: session.id })
|
||||||
const parent = msgs.at(-1)?.info.id
|
const parent = msgs.at(-1)?.info.id
|
||||||
|
|||||||
Reference in New Issue
Block a user