Config: clarify memorySearch migration precedence

This commit is contained in:
Vignesh Natarajan
2026-02-07 19:57:57 -08:00
committed by Vignesh
parent 8688730161
commit a76dea0d23
2 changed files with 37 additions and 4 deletions

View File

@@ -210,7 +210,7 @@ describe("legacy config detection", () => {
},
});
expect(res.changes).toContain(
"Merged memorySearch → agents.defaults.memorySearch (preserved explicit agents.defaults overrides).",
"Merged memorySearch → agents.defaults.memorySearch (filled missing fields from legacy; kept explicit agents.defaults values).",
);
expect(res.config?.agents?.defaults?.memorySearch).toMatchObject({
provider: "openai",
@@ -219,6 +219,37 @@ describe("legacy config detection", () => {
query: { maxResults: 7 },
});
});
it("keeps nested agents.defaults.memorySearch values when merging legacy defaults", async () => {
vi.resetModules();
const { migrateLegacyConfig } = await import("./config.js");
const res = migrateLegacyConfig({
memorySearch: {
query: {
maxResults: 7,
minScore: 0.25,
hybrid: { enabled: true, textWeight: 0.8, vectorWeight: 0.2 },
},
},
agents: {
defaults: {
memorySearch: {
query: {
maxResults: 3,
hybrid: { enabled: false },
},
},
},
},
});
expect(res.config?.agents?.defaults?.memorySearch).toMatchObject({
query: {
maxResults: 3,
minScore: 0.25,
hybrid: { enabled: false, textWeight: 0.8, vectorWeight: 0.2 },
},
});
});
it("migrates tools.bash to tools.exec", async () => {
vi.resetModules();
const { migrateLegacyConfig } = await import("./config.js");