fix: handle ValueError in render_tree() for incompatible Language versions#4841
Open
clayarnoldg2m wants to merge 3 commits intoAider-AI:mainfrom
Open
fix: handle ValueError in render_tree() for incompatible Language versions#4841clayarnoldg2m wants to merge 3 commits intoAider-AI:mainfrom
clayarnoldg2m wants to merge 3 commits intoAider-AI:mainfrom
Conversation
Path.resolve() raises RuntimeError on circular symlinks. Catch RuntimeError and OSError, fall back to Path.absolute(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sions (Aider-AI#4835) TreeContext creation calls get_parser() which raises ValueError when tree-sitter Language version is incompatible. Wrap with try/except ValueError and return empty string, matching the defensive pattern already used in get_tags_raw(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
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
TreeContextcreation inrender_tree()callsget_parser()which raisesValueErrorwhen the tree-sitter Language version is incompatible, crashing aider during repo map generation.TreeContext(...)withtry/except ValueError, returning empty string on failure. This matches the existing defensive pattern inget_tags_raw()(lines 284-289 in the same file).Test plan
test_render_tree_language_version_error— mocksTreeContextto raiseValueError("Incompatible Language version"), verifiesrender_tree()returns""test_get_repo_map_with_incompatible_language— same mock atget_repo_map()level, verifies no crash