Skip to content

feat: make memories MCP list shallow#20994

Merged
jif-oai merged 1 commit into
mainfrom
jif/list-shallow
May 4, 2026
Merged

feat: make memories MCP list shallow#20994
jif-oai merged 1 commit into
mainfrom
jif/list-shallow

Conversation

@jif-oai

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

Copy link
Copy Markdown
Collaborator

Why

The memories MCP list tool should behave like a directory listing, not a recursive tree walk. Recursive results make pagination harder to reason about, return unexpectedly deep paths for scoped requests, and no longer match the intended tool contract.

What Changed

  • Changed the local memories backend so list returns only the immediate children of the requested path.
  • Preserved file-scoped requests by returning the file itself, and missing paths by returning an empty result.
  • Updated cursor handling to paginate over the shallow sibling set and reject cursors past the available results.
  • Updated the MCP tool description to say it lists immediate files and directories under a path.
  • Reworked the local backend tests to cover shallow top-level listing, shallow scoped listing, sibling ordering, and pagination.

Testing

  • cargo test -p codex-memories-mcp

@jif-oai jif-oai changed the title feat: mcp memories list shallow feat: make memories MCP list shallow May 4, 2026
@jif-oai jif-oai merged commit 2935256 into main May 4, 2026
26 checks passed
@jif-oai jif-oai deleted the jif/list-shallow branch May 4, 2026 13:08
@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