Skip to content

bug: Invalid tags silently dropped in Belief model validator, breaks future filtering (post-Dec 5 commit) #2

@moonrunnerkc

Description

@moonrunnerkc

Context

After pulling latest (Dec 5 model refinements), the Belief Pydantic validator for tags (List[str]) silently filters out non-string items during creation, which broke a quick test of tag-based listing in storage stubs. This propagates to agent tagging (e.g., PerceptionAgent) without warnings.

Steps to Reproduce

  1. git pull origin main (post-Dec 5).
  2. In a test script: belief = Belief(..., tags=["user_pref", None, 123]) → Create via store.
  3. await store.list(tags=["user_pref"]) stub → Misses belief (tags became ["user_pref"] only).
  4. Check logs → No error; just quiet drop.

Expected vs Actual

  • Expected: Validator raises ValidationError on invalid tags (e.g., None/int) for explicit debugging.
  • Actual: Strips invalids silently → Subtle data loss, hard to trace in agent pipelines.

Logs/Screenshots

  • Pydantic log (if verbose): WARNING: Ignoring invalid tag 'None' in list.
  • Test output: showing len(tags) mismatch.
  • Commit ref: Likely in belief.py @root_validator for tags.

Suggested Fix

Update validator to raise ValueError on non-str tags. Add a unit test in tests/core/models/test_belief.py for tag validation. Fix before Phase 4 agents rely on tags.

Metadata

Metadata

Assignees

Labels

agentsbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions