test: pin /read-only + /add promotion of an outside image (#5620) - #1
Merged
Totoro-qaq merged 1 commit intoSep 5, 2026
Conversation
) An image outside the repository is accepted by /read-only from anywhere. Promoting it with /add reaches GitRepo.path_in_repo() with an out-of-root absolute path, which raised ValueError on main and killed the session. With the path_in_repo() guard from this branch it is answered as 'not part of the repository' instead. Fails without the guard, passes with it.
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.
Test-only PR for Aider-AI#5620 as invited in Aider-AI#5620 (comment), targeting
codex/fix-absolute-path-repo-checkso it can ride along with Aider-AI#5628.Adds
tests/basic/test_issue_5620_add_route.py, which pins the second entry route to the crash:/read-only <outside>/outside.png(allowed from anywhere for images) followed by/addon the same file. On upstreammain(5dc9490) the promotion branch incmd_addcallspath_in_repo()with an out-of-root absolute path and the session dies withValueError: ... is not in the subpath of .... With this branch'spath_in_repo()guard the file is reported as not part of the repository and stays read-only.Verified locally on Linux / Python 3.12:
mainwithout the guard:1 failed(theValueErrortraceback above)1 passedNo source changes; it complements the
path_in_repo/is_dirtytest already in this branch rather than duplicating it.