Skip to content

feat: support windowed multi-query memory search#21204

Merged
jif-oai merged 1 commit intomainfrom
jif/search-more-complex
May 5, 2026
Merged

feat: support windowed multi-query memory search#21204
jif-oai merged 1 commit intomainfrom
jif/search-more-complex

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

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

Why

Memory search currently supports either independent substring matches or requiring every query to appear on the same line. That is too restrictive for memory files where related terms often land on nearby lines in the same note or bullet block.

What changed

  • Replace the old all match mode with explicit tagged modes: all_on_same_line and all_within_lines { line_count }.
  • Add windowed matching in codex-rs/memories/mcp/src/local.rs so callers can require every query to appear within a bounded line range while returning only the minimal qualifying windows.
  • Reject invalid zero-width windows and update the MCP tool description plus argument parsing to expose the new mode.
  • Add coverage for same-line matching, windowed matching, and invalid line_count input.

Verification

  • Added targeted coverage in codex-rs/memories/mcp/src/local_tests.rs for search_supports_all_within_lines_match_mode and search_rejects_zero_line_window.
  • Added server-side parsing coverage in codex-rs/memories/mcp/src/server.rs for search_args_accept_windowed_all_match_mode.

@jif-oai jif-oai changed the title feat: all within line search feat: support windowed multi-query memory search May 5, 2026
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 5, 2026

@codex review

Copy link
Copy Markdown
Contributor

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

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: a9da920167

ℹ️ 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/backend.rs
@jif-oai jif-oai merged commit f75c600 into main May 5, 2026
26 checks passed
@jif-oai jif-oai deleted the jif/search-more-complex branch May 5, 2026 15:15
@github-actions github-actions Bot locked and limited conversation to collaborators May 5, 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