Skip to content

ParseError: Schema frontmatter with picoschema commas breaks YAML parser #612

Closed

Description

@bm-clawd

Bug

create_entity fails when parsing schema notes that use picoschema comma syntax in frontmatter values.

Stack Trace

File "basic_memory/services/entity_service.py", line 267, in create_entity
    content_frontmatter = parse_frontmatter(schema.content)
File "basic_memory/file_utils.py", line 348, in parse_frontmatter
    raise ParseError(f"Invalid YAML in frontmatter: {e}")

basic_memory.file_utils.ParseError: Invalid YAML in frontmatter: while parsing a block mapping
  in "<unicode string>", line 7, column 3:
      description: string, what needs  ... 
      ^
expected <block end>, but found ','
  in "<unicode string>", line 8, column 52:
     ... ctive, blocked, done, abandoned], current state
                                         ^

Cause

The Task schema file has picoschema values like:

schema:
  description: string, what needs to be done
  status?(enum): [active, blocked, done, abandoned], current state

YAML interprets [active, blocked, done, abandoned] as a flow sequence and then chokes on the trailing , current state. The picoschema syntax uses commas and brackets that conflict with YAML parsing.

Reproduction

Any schema note with picoschema in the frontmatter schema: block will trigger this when create_entity calls parse_frontmatter() on the content.

Possible Fixes

  1. Quote picoschema values in frontmatter so YAML doesn't try to parse them
  2. Have parse_frontmatter handle the schema: block specially (treat as raw string)
  3. Move picoschema definitions out of frontmatter into the note body

Environment

  • basic-memory 0.18.5
  • Python 3.13

Activity

  1. claude commented on Feb 26, 2026

    @claude
    Contributor

    Claude encountered an error —— View job


    I'll analyze this and get back to you.

  2. added this to the v0.19.0 milestone on Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions