Open
Conversation
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
This adds path-scoped review filtering to
codex exec reviewand the app-server review APIs.Related upstream issue:
New behavior / usage examples:
codex exec review --paths src/lib.rs src/main.rs --uncommittedcodex exec review --paths src/lib.rs --paths src/main.rs --uncommittedcodex exec review --pathspec-from-file review-paths.txt --uncommittedcodex exec review --paths src/lib.rs src/main.rs -- "focus on reviewer ergonomics"Motivation
Users often want review on a narrow part of the repo rather than the full diff. The goal here is to make that scope explicit and reliable without changing the overall review flow.
The important correctness requirements are:
Implementation
pathspecsto the review request protocol/app-server transport.--pathsand--pathspec-from-filetocodex exec review../...paths:(top,literal)...and:(top,glob)**commit 1234567: ... in src/lib.rs and src/main.rsWhy this approach
This is mostly a prompt-layer scoping feature with thin transport plumbing.
That keeps the implementation simple:
This avoids scattering path normalization and Git-pathspec behavior across multiple layers.
Testing
Added or updated coverage for:
./handling--paths a b--paths--QA run:
cargo test -p codex-core review_prompts::tests -- --nocapturecargo test -p codex-exec review_accepts_ -- --nocapturecargo test -p codex-exec builds_review_request_from_pathspec_file -- --nocapturecargo test -p codex-exec rejects_empty_pathspec_file -- --nocapturecargo test -p codex-app-server review_start_includes_paths_in_entered_review_mode -- --nocapturecargo test -p codex-app-server review_start_rejects_empty_pathspec -- --nocaptureNotes for reviewers
This PR intentionally keeps pathscope semantics centralized in
codex_core::review_promptsrather than spreading them across exec/app-server layers.That makes the behavior easier to reason about and fixes a class of issues around: