Skip to content

fix(search): scope deprecated_by filter to user tables only#330

Merged
cyfyifanchen merged 1 commit into
mainfrom
fix/filter-deprecated-by-agent-tables
Jul 8, 2026
Merged

fix(search): scope deprecated_by filter to user tables only#330
cyfyifanchen merged 1 commit into
mainfrom
fix/filter-deprecated-by-agent-tables

Conversation

@Kendrick-Song

Copy link
Copy Markdown
Collaborator

Summary

compile_filters() unconditionally appended deprecated_by IS NULL to every LanceDB query, but the deprecated_by column only exists on user-scoped tables (episode, atomic_fact — Reflection V1). Agent tables (agent_case, agent_skill) lack this column, causing a SQL error on agent search/get queries.

Fix: gate the clause behind owner_type == "user" so agent queries no longer reference a non-existent column.

Also bumps version to 1.1.2.

Area

  • Architecture method
  • Benchmark
  • Use case
  • Documentation
  • Developer experience
  • CI, build, or release

Verification

make lint          # all gates pass (ruff, import-linter, datetime, openapi drift, etc.)
make test          # 1477 passed; 20 failures are pre-existing jieba SyntaxError on Python 3.14 (upstream)
pytest tests/unit/test_memory/test_search/test_filters.py tests/unit/test_memory/test_get/test_filters_adapter.py -v
                   # 52 passed — includes 2 new tests:
                   #   test_compile_filters_excludes_deprecated_by_for_user
                   #   test_compile_filters_omits_deprecated_by_for_agent

Checklist

  • I kept the change scoped to the relevant area.
  • I am opening this from a separate branch, not pushing directly to main.
  • I updated docs, examples, or setup notes when behavior changed.
  • I added or updated tests when the change affects behavior.
  • I did not commit secrets, .env files, dependency folders, or generated output.
  • Active relative links in Markdown files resolve.

Notes for Reviewers

  • The exclude_deprecated parameter was already removed from the public API in v1.1.1 (15efd11), but the unconditional deprecated_by IS NULL clause remained in compile_filters(). This PR completes that cleanup.
  • docs/openapi.json regenerated via make openapi to match the 1.1.2 version bump.

By submitting this pull request, I agree that my contribution is licensed under
the Apache License 2.0.

compile_filters() unconditionally appended 'deprecated_by IS NULL' to
every query, but the deprecated_by column only exists on user-scoped
tables (episode, atomic_fact — Reflection V1). Agent tables
(agent_case, agent_skill) lack this column, causing a SQL error on
agent search/get queries.

Gate the clause behind owner_type == 'user' so agent queries no longer
reference a non-existent column.

Bump version to 1.1.2.
@cyfyifanchen cyfyifanchen merged commit 56ee9c8 into main Jul 8, 2026
9 checks passed
@cyfyifanchen cyfyifanchen deleted the fix/filter-deprecated-by-agent-tables branch July 8, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants