Skip to content

refactor: split memories extension crate modules#22500

Merged
jif-oai merged 2 commits into
mainfrom
jif/reorg-crate
May 13, 2026
Merged

refactor: split memories extension crate modules#22500
jif-oai merged 2 commits into
mainfrom
jif/reorg-crate

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

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

Why

The memories extension has several distinct responsibilities: registering its prompt and tool contributors, enforcing local-memory filesystem boundaries, implementing list/read/search behavior, and wrapping that backend as extension tools. Those responsibilities were concentrated in lib.rs, local.rs, and the tool modules, which made follow-up work harder to review and risked growing files through unrelated edits.

This PR reorganizes the crate so each responsibility has a narrower owner while preserving the same extension entrypoint and memory tool behavior.

What Changed

  • Moved extension lifecycle, prompt, and tool registration into src/extension.rs, leaving src/lib.rs as the small crate entrypoint.
  • Split LocalMemoriesBackend helpers into local/list.rs, local/path.rs, local/read.rs, and local/search.rs.
  • Centralized tool names and limits at the crate level, and kept the backend and extension implementation crate-private.
  • Made memory_list, memory_read, and memory_search tool executors generic over MemoriesBackend, so tests can exercise the full executor path without depending on tool internals.
  • Consolidated and expanded memory extension tests in src/tests.rs, including read/search tool output coverage, multi-query search, windowed all_within_lines, and legacy query rejection.

Testing

  • Not run locally.

@jif-oai jif-oai changed the title chore: re-org crate refactor: split memories extension crate modules May 13, 2026
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 13, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Swish!

ℹ️ 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".

@jif-oai jif-oai merged commit 2edae8d into main May 13, 2026
27 checks passed
@jif-oai jif-oai deleted the jif/reorg-crate branch May 13, 2026 15:39
@github-actions github-actions Bot locked and limited conversation to collaborators May 13, 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