fix: escape qdrant-find entry fields - #183
Closed
mikemikimike wants to merge 2 commits into
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #179.
Stored content and metadata are interpolated directly into the XML-like response returned by
qdrant-find. If either value contains structural tags such as</content><metadata>, the response becomes ambiguous and a consumer cannot reliably distinguish stored values from the server-generated boundaries.This change:
&,<, and>in content and serialized metadata before interpolation;<entry>,<content>, and<metadata>response structure;&/</>,metadata=None, nested JSON metadata, and injected structural tags.The formatter is a pure transformation: it does not mutate entries, shared state, or connector state, so the fix introduces no new race or partial-update path.
Verification
uv run --frozen pytest tests/test_mcp_server.py -q— 3 passeduv run --frozen ruff format --check .— passeduv run --frozen ruff check .— passedgit diff --check— passeduv run --frozen pytest -q— interrupted after more than 70 seconds without output while entering the integration path; no failure was reported before interruptionuv run --frozen mypy src tests— existing repository errors (9 errors infastembed.py,qdrant.py,common/filters.py, and existingmcp_server.pyfilter typing)The focused tests exercise the exact formatter used by
qdrant-find; a full Qdrant/MCP integration test was not added because the tool closure is local tosetup_tools()and introducing test-only production seams would broaden this focused fix.