Skip to content

fix: preserve collection_name on MCP search retry - #1624

Merged
igorls merged 1 commit into
MemPalace:developfrom
trek-e:fix/search-retry-preserve-collection
Jun 14, 2026
Merged

fix: preserve collection_name on MCP search retry#1624
igorls merged 1 commit into
MemPalace:developfrom
trek-e:fix/search-retry-preserve-collection

Conversation

@trek-e

@trek-e trek-e commented May 26, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes transient-retry behavior in mempalace_search so the retry call preserves collection_name.

  • Root cause: tool_search passed collection_name on the initial search_memories(...) call but dropped it on retry.
  • Fix: pass _config.collection_name on the retry call as well.
  • Adds regression test test_search_retry_preserves_collection_name to ensure both attempts use the same configured collection.

Closes #1623.

How to test

  1. Run focused regression slice:
    • uv run pytest tests/test_mcp_server.py -k "search_retries_once_on_hnsw_flush_transient or search_retry_preserves_collection_name or search_with_wing_filter or search_with_room_filter" -q
  2. Verify retry uses configured collection through the new test.

Validation run for this PR:

  • uv run ruff check . -> pass
  • Focused pytest slice above -> pass (4 passed)
  • Full suite command from contributing docs:
    • uv run pytest tests/ -v --ignore=tests/benchmarks
    • Current branch shows 4 unrelated existing failures in tests/test_cli.py, tests/test_repair.py, and tests/test_searcher.py.

Checklist

  • Tests pass (python -m pytest tests/ -v)
  • No hardcoded paths
  • Linter passes (ruff check .)

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request ensures that the configured collection name is preserved and passed during search retries in tool_search. It also adds a unit test to verify this behavior. There are no review comments, so I have no feedback to provide.

@igorls
igorls merged commit 0cb4508 into MemPalace:develop Jun 14, 2026
6 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.

MCP search retry drops configured collection_name after transient Error finding id

2 participants