Skip to content

fix(agentic): validate RecallFile pagination inputs - #663

Merged
MrXnneHang merged 1 commit into
NevaMind-AI:mainfrom
wutongyuonce:fix/validate-recall-pagination-662
Aug 26, 2026
Merged

MrXnneHang merged 1 commit into
NevaMind-AI:mainfrom
wutongyuonce:fix/validate-recall-pagination-662

Conversation

@wutongyuonce

Copy link
Copy Markdown
Contributor

Fixes #662

Summary

Validate RecallFile pagination inputs at the shared AgenticMixin service boundary before repository access.

Root cause

The pagination feature added _decode_cursor() and forwarded limit directly to list_recall_files_page(). Malformed cursors leaked decoder and tuple-unpacking exceptions, while limit=0 reached backend implementations without a shared contract.

Changes

  • Reject limit < 1 with ValueError("limit must be greater than zero").
  • Normalize malformed Base64, UTF-8, JSON, shape, and field-type failures to ValueError("invalid cursor").
  • Add regression coverage for InMemory and SQLite backends.
  • Keep the change in the shared service entry point; no repository-specific changes or new dependencies.

Validation

  • tests/test_agentic.py -q: 32 passed
  • Ruff check: passed
  • mypy for src/memu/app/agentic.py: passed
  • git diff --check: passed

This PR is based on the latest upstream main at commit 37d2efa.

@MrXnneHang
MrXnneHang self-requested a review August 24, 2026 01:23

@MrXnneHang MrXnneHang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMeow 🐾

@MrXnneHang
MrXnneHang merged commit abb1148 into NevaMind-AI:main Aug 26, 2026
3 checks passed
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.

fix(agentic): validate RecallFile pagination inputs before repository access

2 participants