Repository navigation
fix(query): preserve escaped and spaced retrieved image paths - #464
Merged
LarFii merged 3 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.
# Conflicts: # raganything/query.py
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.
Retrieved image paths need to survive both spaces in filenames and JSON transport escaping. Decode paths once inside JSON records while preserving literal backslashes in plain text; keep the complete filename selection from #460 so an existing chart.png cannot replace chart.png v2.png. Preserve the original path spelling and surrounding prompt text, then apply the existing image-content, symlink and safe-directory checks.
Regression tests use LightRAG's real naive/mix context builders and assert the exact image bytes sent to both query entry points. Coverage includes quotes, literal backslashes, spaced names with earlier image suffixes, missing/invalid/outside files and the combinations of these path formats.
Validation: the complete 15-PR integration candidate passed 1,266 tests on Ubuntu 24.04 / Python 3.12 / LightRAG 1.4.16 and Ruff 0.6.4. Four live Qwen3-VL-30B calls on the development server verified naive/mix retrieval, both query entry points, conversation history, normal/streamed answers and correct selection of a blue image over an existing red shorter-prefix image. Updated Python 3.10/3.11/3.12 GitHub checks are running.