Skip to content

feat: paginate memories MCP search results#20996

Merged
jif-oai merged 2 commits into
mainfrom
jif/s-pagination
May 4, 2026
Merged

feat: paginate memories MCP search results#20996
jif-oai merged 2 commits into
mainfrom
jif/s-pagination

Conversation

@jif-oai

@jif-oai jif-oai commented May 4, 2026

Copy link
Copy Markdown
Collaborator

Why

The memories MCP search tool previously stopped once it hit max_results, so callers could tell there were more matches via truncated but had no way to fetch the rest of the result set. That made large searches awkward for clients that need to keep paging through a stable, deterministic view of the matches.

What changed

  • add an optional cursor field to SearchMemoriesRequest / tool input and return next_cursor in SearchMemoriesResponse
  • update the MCP schemas and tool wiring so clients can request subsequent pages explicitly
  • change the local memories backend to collect and sort the full scoped match list, then slice the requested page and reject invalid cursors
  • add unit coverage for paginated search results and invalid cursor handling in memories/mcp/src/local_tests.rs

Testing

  • Added targeted unit coverage in memories/mcp/src/local_tests.rs
  • GitHub Actions are running for the branch

@jif-oai jif-oai changed the title feat: search pagination feat: paginate memories MCP search results May 4, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 86278549bd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/memories/mcp/src/local.rs
@jif-oai jif-oai merged commit 554223a into main May 4, 2026
25 of 26 checks passed
@jif-oai jif-oai deleted the jif/s-pagination branch May 4, 2026 13:23
@github-actions github-actions Bot locked and limited conversation to collaborators May 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant