fix: allow memory flush model override

This commit is contained in:
Peter Steinberger
2026-04-28 05:25:42 +01:00
parent dc3df62e67
commit 540cbe24be
18 changed files with 186 additions and 3 deletions

View File

@@ -134,6 +134,24 @@ describe("buildMemoryFlushPlan", () => {
).toBeNull();
});
it("carries configured memory flush model override", () => {
const plan = buildMemoryFlushPlan({
cfg: {
agents: {
defaults: {
compaction: {
memoryFlush: {
model: "ollama/qwen3:8b",
},
},
},
},
},
});
expect(plan?.model).toBe("ollama/qwen3:8b");
});
it("falls back to defaults when numeric values are invalid", () => {
const plan = buildMemoryFlushPlan({
cfg: {

View File

@@ -132,6 +132,7 @@ export function buildMemoryFlushPlan(
softThresholdTokens,
forceFlushTranscriptBytes,
reserveTokensFloor,
model: defaults?.model?.trim() || undefined,
prompt: appendCurrentTimeLine(promptBase.replaceAll("YYYY-MM-DD", dateStamp), timeLine),
systemPrompt: systemPrompt.replaceAll("YYYY-MM-DD", dateStamp),
relativePath,