mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 23:02:02 +03:00
fix (memory/lancedb): require explicit opt-in for auto-capture
This commit is contained in:
@@ -121,7 +121,7 @@ export const memoryConfigSchema = {
|
|||||||
apiKey: resolveEnvVars(embedding.apiKey),
|
apiKey: resolveEnvVars(embedding.apiKey),
|
||||||
},
|
},
|
||||||
dbPath: typeof cfg.dbPath === "string" ? cfg.dbPath : DEFAULT_DB_PATH,
|
dbPath: typeof cfg.dbPath === "string" ? cfg.dbPath : DEFAULT_DB_PATH,
|
||||||
autoCapture: cfg.autoCapture !== false,
|
autoCapture: cfg.autoCapture === true,
|
||||||
autoRecall: cfg.autoRecall !== false,
|
autoRecall: cfg.autoRecall !== false,
|
||||||
captureMaxChars: captureMaxChars ?? DEFAULT_CAPTURE_MAX_CHARS,
|
captureMaxChars: captureMaxChars ?? DEFAULT_CAPTURE_MAX_CHARS,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -120,6 +120,21 @@ describe("memory plugin e2e", () => {
|
|||||||
expect(config?.captureMaxChars).toBe(1800);
|
expect(config?.captureMaxChars).toBe(1800);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("config schema keeps autoCapture disabled by default", async () => {
|
||||||
|
const { default: memoryPlugin } = await import("./index.js");
|
||||||
|
|
||||||
|
const config = memoryPlugin.configSchema?.parse?.({
|
||||||
|
embedding: {
|
||||||
|
apiKey: OPENAI_API_KEY,
|
||||||
|
model: "text-embedding-3-small",
|
||||||
|
},
|
||||||
|
dbPath,
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(config?.autoCapture).toBe(false);
|
||||||
|
expect(config?.autoRecall).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
test("shouldCapture applies real capture rules", async () => {
|
test("shouldCapture applies real capture rules", async () => {
|
||||||
const { shouldCapture } = await import("./index.js");
|
const { shouldCapture } = await import("./index.js");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user