fix: remove MaxLen constraint from observation content · basicmachines-co/basic-memory@45d6caf · GitHub
Skip to content

Commit 45d6caf

Browse files
phernandezclaude
andcommitted
fix: remove MaxLen constraint from observation content
The API Pydantic schema had a MaxLen(1000) constraint on observation content while the database uses SQLAlchemy's Text type (unlimited). This mismatch caused validation errors when observations exceeded 1000 characters (e.g., JSON schemas with 1458+ chars). Removed the MaxLen constraint to match the DB schema. Retained: - BeforeValidator(str.strip) for whitespace cleaning - MinLen(1) to ensure non-empty content Added comprehensive tests to verify: - Long content (10K+ chars) is accepted - Very long content (50K+ chars) is accepted - Empty/whitespace-only content is still rejected - Whitespace stripping still works Fixes #385 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
1 parent 1652f86 commit 45d6caf

2 files changed

Lines changed: 43 additions & 1 deletion

File tree

src/basic_memory/schemas/base.py

Lines changed: 1 addition & 1 deletion

tests/schemas/test_schemas.py

Lines changed: 42 additions & 0 deletions

0 commit comments

Comments
 (0)