mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
fix(core): strip null bytes from markdown content before database insert
PostgreSQL rejects null bytes (0x00) in text columns, causing CharacterNotInRepertoireError when syncing files like Claude agent definitions that contain embedded nulls. SQLite silently accepts them, so this only surfaces in cloud environments. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
This commit is contained in:
@@ -249,6 +249,10 @@ class EntityParser:
|
||||
|
||||
content = strip_bom(content)
|
||||
|
||||
# PostgreSQL rejects null bytes (0x00) in text columns.
|
||||
# Some markdown files (e.g. Claude agent definitions) contain embedded nulls.
|
||||
content = content.replace("\x00", "")
|
||||
|
||||
# Parse frontmatter with proper error handling for malformed YAML.
|
||||
# We use frontmatter.parse() instead of frontmatter.loads() because
|
||||
# loads() does Post(content, handler, **metadata), which crashes when
|
||||
|
||||
Reference in New Issue
Block a user