mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-02 04:21:34 +00:00
refactor(memory-lancedb): remove dead legacy path scan (#113299)
This commit is contained in:
committed by
GitHub
parent
b614661646
commit
445eea201a
@@ -1,5 +1,4 @@
|
||||
// Memory Lancedb helper module supports config behavior.
|
||||
import fs from "node:fs";
|
||||
import { homedir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { parseFiniteNumber } from "openclaw/plugin-sdk/number-runtime";
|
||||
@@ -28,34 +27,7 @@ export type MemoryCategory = (typeof MEMORY_CATEGORIES)[number];
|
||||
const DEFAULT_MODEL = "text-embedding-3-small";
|
||||
export const DEFAULT_CAPTURE_MAX_CHARS = 500;
|
||||
export const DEFAULT_RECALL_MAX_CHARS = 1000;
|
||||
const LEGACY_STATE_DIRS: string[] = [];
|
||||
|
||||
function resolveDefaultDbPath(): string {
|
||||
const home = homedir();
|
||||
const preferred = join(home, ".openclaw", "memory", "lancedb");
|
||||
try {
|
||||
if (fs.existsSync(preferred)) {
|
||||
return preferred;
|
||||
}
|
||||
} catch {
|
||||
// best-effort
|
||||
}
|
||||
|
||||
for (const legacy of LEGACY_STATE_DIRS) {
|
||||
const candidate = join(home, legacy, "memory", "lancedb");
|
||||
try {
|
||||
if (fs.existsSync(candidate)) {
|
||||
return candidate;
|
||||
}
|
||||
} catch {
|
||||
// best-effort
|
||||
}
|
||||
}
|
||||
|
||||
return preferred;
|
||||
}
|
||||
|
||||
const DEFAULT_DB_PATH = resolveDefaultDbPath();
|
||||
const DEFAULT_DB_PATH = join(homedir(), ".openclaw", "memory", "lancedb");
|
||||
|
||||
const EMBEDDING_DIMENSIONS: Record<string, number> = {
|
||||
"text-embedding-3-small": 1536,
|
||||
|
||||
Reference in New Issue
Block a user