Repository navigation
fix(cli): validate agent-review add targets, paths and lines - #663
Merged
Merged
Conversation
`agent-review add` stored comments nothing could display: any target type, workspace ids that don't exist, absolute or `..` file paths, and lines past the end of the file. It now requires a known target type (workspace_diff, file_browser_file), an existing target, a relative --file, and new-side lines within the file on disk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MxqTt1WtVRKkjNXQpgkJS9
Ziinc
commented
Oct 2, 2026
Ziinc
commented
Oct 2, 2026
Ziinc
left a comment
Collaborator
Author
There was a problem hiding this comment.
Reviewed correctness, surrounding call paths, code quality and regression coverage at 3d4b955b. Found 2 actionable issues; details and suggested regression checks are inline.
Validation: source review and GitHub workflow inspection. The PR-head CI workflow reports success. Rust/integration tests were not rerun locally because this environment has no Cargo toolchain.
Resolve --file against its root (workspace or repo), canonicalize it and require it to stay inside the canonical root and be a regular file before counting lines. For file_browser_file, --target-id must resolve to that same file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MxqTt1WtVRKkjNXQpgkJS9
Keep both new agent-review tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MxqTt1WtVRKkjNXQpgkJS9
This branch was successfully deployed
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.
agent-review addaccepted any--target-type, nonexistent workspace ids,--file /etc/passwdor../paths, and line 99999.workspace_diff(an existing workspace id) orfile_browser_file(an existing file inside the repo), a relative--filewith no.., and new-side lines within the file on disk. Old-side lines are not bounds-checked, since that file isn't on disk.add_target_must_be_real_and_inside_the_repo.🤖 Generated with Claude Code
https://claude.ai/code/session_01MxqTt1WtVRKkjNXQpgkJS9
Generated by Claude Code