mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-29 06:48:37 +00:00
Config: clarify memorySearch migration precedence
This commit is contained in:
committed by
Vignesh
parent
8688730161
commit
a76dea0d23
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user