Repository navigation
fix(query): avoid truncating spaced image filenames - #460
Merged
LarFii merged 2 commits intoNov 12, 2026
Merged
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This was referenced Nov 7, 2026
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.
Description
VLM-enhanced retrieval queries can send the wrong local image when a filename contains an image suffix followed by a space. With both
chart.pngandchart.png v2.pngpresent, a retrievedImage Path: .../chart.png v2.pngcurrently sends the bytes ofchart.png.Match the last image suffix within the same path field, stopping at real or JSON-escaped field separators. The existing image-content, symlink and safe-directory checks still apply to the complete selected path. An unavailable complete path does not fall back to its existing shorter prefix.
Related Issues
Resolves the known limitation recorded by the strict xfail in
tests/test_vlm_image_path_lightrag_prompt.py. This follows up on #445, preserving its delimiter handling and use of LightRAG's real prompt builders. No new issue was created.Changes Made
Validation
python -B -m pytest tests/ -q -rs -p no:cacheprovider, with a disposable test directory).git diff --checkpassed over the complete PR range.The first full-suite run had six example import failures because the isolated environment lacked the OpenAI client. After preparing that dependency, the two affected example modules passed all 40 tests, and the full-suite result above passed without changing their tests or the source fix.
Tests use local images and LightRAG's real context builders, with retrieval/vision callbacks simulated. No hosted model or paid service was used. The two skipped modules are
test_enhanced_markdown_images.pyandtest_enhanced_markdown_resources.py, which useimportorskipfor WeasyPrint. The local environment does not include MinerU, PaddleOCR, audio/video model runtimes or WeasyPrint/Pango; CI's full-dependency Python 3.10/3.11/3.12 matrix remains separate.Checklist
Developed with Codex assistance.