Repository navigation
Description
Bug Description
GET /api/v1/import/hermes-native/scan and the paged import endpoints read only MEMORY.md from the Hermes memories directory. USER.md (the user-profile store that Hermes maintains next to MEMORY.md) is never imported, so user-profile content silently never reaches the MemOS L1/L2 layers on a native-memory import.
Affected code (2.0.17)
dist/server/routes/import-export.js — readHermesNativeMemories(path, opts):
async function readHermesNativeMemories(path, opts = {}) {
const info = await stat(path);
...
const raw = await readFile(path, "utf8");
const source = {
memories: splitHermesNativeMemories(raw), // <-- MEMORY.md only
bytes: info.size,
mtimeMs: info.mtimeMs,
};
...
}Both consumers (scan at line ~315, paged import at line ~126) go through this single function, so one fix covers both. Cache correctness requires the bytes/mtimeMs fingerprint to cover USER.md too, otherwise edits to USER.md won't invalidate the cache.
Suggested fix
Read the sibling USER.md (optional, skip silently when missing) and include its entries in the same source structure:
const memories = [];
const memoryMtime = info.mtimeMs;
for (const text of splitHermesNativeMemories(await readFile(path, "utf8"))) {
memories.push({ text, file: "MEMORY.md", mtimeMs: memoryMtime });
}
let bytes = info.size;
let mtimeMs = memoryMtime;
try {
const userPath = join(dirname(path), "USER.md");
const userInfo = await stat(userPath);
const userRaw = await readFile(userPath, "utf8");
for (const text of splitHermesNativeMemories(userRaw)) {
memories.push({ text, file: "USER.md", mtimeMs: userInfo.mtimeMs });
}
bytes += userInfo.size;
mtimeMs = Math.max(mtimeMs, userInfo.mtimeMs);
} catch { /* USER.md is optional */ }
const source = { memories, bytes, mtimeMs };Note: this also requires dirname to be imported from node:path (2.0.17 currently imports only join).
Entries carry a file tag so the UI/dedup layer can distinguish MEMORY.md vs USER.md entries. A local patch running this exact body on 2.0.17 has been verified end-to-end (import + viewer display).
Environment
- Plugin: @memtensor/memos-local-plugin 2.0.17
- Agent: Hermes (Windows native)
Activity
github-actions commentedon Sep 29, 2026
This issue has been automatically marked as stale due to inactivity.
github-actions commentedon Oct 6, 2026
This issue has been automatically closed due to inactivity.
keeponlight commentedon Oct 14, 2026
Note: This issue was auto-closed by the stale bot while the fix in #2378 was awaiting review. #2378 has been rebased onto the latest
main(cd3237c3) with all OpenCodeReview items addressed and all 1,606 plugin unit tests passing. cc @Hun-ger @syzsunshine219