Skip to content

fix(mcp): return controlled errors for Milvus search failures - #252

Open
sanjayy0612 wants to merge 1 commit into
kubeflow:mainfrom
sanjayy0612:fix/milvus-search-errors
Open

sanjayy0612 wants to merge 1 commit into
kubeflow:mainfrom
sanjayy0612:fix/milvus-search-errors

Conversation

@sanjayy0612

Copy link
Copy Markdown

Fixes #251

Problem

The shared MCP search helper handled failures while loading a Milvus collection and generating an embedding, but exceptions from the actual vector search escaped the tool boundary. A transient Milvus timeout could therefore abort documentation, GitHub issue, and code search invocations.

Root cause

_search_collection() called client.search() outside the existing RuntimeError normalization used by the public MCP tools.

Solution

Wrap the Milvus search operation and raise a contextual RuntimeError. Existing tool handlers now return a controlled Search failed: ... response. A regression test simulates a Milvus timeout and verifies that behavior.

Testing

  • pytest tests/test_mcp_server.py: 64 passed
  • pytest: 168 passed, 6 skipped
  • ruff check docs-agent-mcp/mcp-server tests
  • ruff format --check docs-agent-mcp/mcp-server tests
  • Python compile check
  • git diff --check

Signed-off-by: sanjayy0612 <sanjayelango06@gmail.com>
Copilot AI balanced review requested due to automatic review settings September 13, 2026 13:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@google-oss-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign franciscojavierarceo for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(mcp): Milvus search failures escape the tool boundary

2 participants