Skip to content
This repository was archived by the owner on Apr 20, 2026. It is now read-only.

Commit 90416ba

Browse files
fix(hsg): allow short content through sanitise guard
The < 20 char length check fired on legitimately short memories (e.g. "Finish Report" = 13 chars), failing the omnibus Phase 2 test. Changed to only reject content that was non-empty before sanitisation but is empty/whitespace after — i.e. the sanitiser consumed all content. Omnibus: all 3 phases pass. Co-Authored-By: Claude <noreply@anthropic.com> AI-Generated: true
1 parent dd5e3ed commit 90416ba

File tree

1 file changed

+2
-1
lines changed
  • packages/openmemory-js/src/memory

1 file changed

+2
-1
lines changed

packages/openmemory-js/src/memory/hsg.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,8 +1080,9 @@ export async function add_hsg_memory(
10801080
upserted?: boolean;
10811081
}> {
10821082
// Strip raw API content blocks (thinking, tool_use, tool_result) before storage
1083+
const raw_len = content.length;
10831084
content = sanitise_content(content);
1084-
if (content.length < 20) {
1085+
if (content.trim().length === 0 && raw_len > 0) {
10851086
throw new Error("memory_content_empty_after_sanitise");
10861087
}
10871088

0 commit comments

Comments
 (0)