mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05: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),
|
||||
},
|
||||
dbPath: typeof cfg.dbPath === "string" ? cfg.dbPath : DEFAULT_DB_PATH,
|
||||
autoCapture: cfg.autoCapture !== false,
|
||||
autoCapture: cfg.autoCapture === true,
|
||||
autoRecall: cfg.autoRecall !== false,
|
||||
captureMaxChars: captureMaxChars ?? DEFAULT_CAPTURE_MAX_CHARS,
|
||||
};
|
||||
|
||||
@@ -120,6 +120,21 @@ describe("memory plugin e2e", () => {
|
||||
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 () => {
|
||||
const { shouldCapture } = await import("./index.js");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user