Repository navigation
feat: support a global reviewer config - #27
Open
theogrillat wants to merge 2 commits into
Open
theogrillat wants to merge 2 commits into
theogrillat wants to merge 2 commits into
Conversation
Fall back to $PI_CODING_AGENT_DIR/pair-programmer.reviewers.json (default ~/.pi/agent) when the working directory has no config. A project config replaces the global one entirely.
theogrillat
commented
Sep 29, 2026
| } catch (error) { | ||
| if (MissingConfigErrorSchema.safeParse(error).success) { | ||
| return DEFAULT_REVIEWERS; | ||
| return undefined; |
Author
There was a problem hiding this comment.
Done: readConfig now takes a whenMissing fallback, so a missing file delegates to the next source (project → global → defaults). No more undefined or ?? chaining.
Comment on lines
+4
to
+5
| // Keep tests from reading the developer's real Pi state directory, such as a | ||
| // global `pair-programmer.reviewers.json`. |
Chain config sources with an explicit fallback instead of undefined and ??, and drop explanatory comments.
T-moz
reviewed
Sep 29, 2026
|
|
||
| Use `current` or a `provider/model` identifier. File patterns are relative to your working directory; exclusions take precedence. Add entries for more reviewers. | ||
|
|
||
| To use the same reviewers in every project, put the file in `~/.pi/agent/pair-programmer.reviewers.json` (or `$PI_CODING_AGENT_DIR/pair-programmer.reviewers.json`). A project config in your working directory replaces the global one entirely; the reviewers are not merged. |
Owner
There was a problem hiding this comment.
Should also be compatible with omp
T-moz
requested changes
Sep 29, 2026
This branch has not been 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.
Why
Reviewer configs can only live in each project's working directory. If you want the same reviewers everywhere, you have to copy the file into every repo, including repos where you can't commit it.
What
loadReviewersnow looks for a config in this order, and the first file it finds wins:<cwd>/pair-programmer.reviewers.json(project config, same as before)$PI_CODING_AGENT_DIR/pair-programmer.reviewers.json, or~/.pi/agent/pair-programmer.reviewers.jsonif the variable is unset (global config, new)A project config replaces the global one entirely; the two are not merged. An explicitly empty project list (
{"reviewers": []}) still turns reviews off for that project. Only a missing project file falls through to the global one. If a config file exists but is invalid, you still get an error naming its path.Other changes
$PI_CODING_AGENT_DIR??~/.pi/agent) out oflogger.tsintosrc/agent-directory.ts, so the logger and the reviewer loader share it.test/setup.ts, which pointsPI_CODING_AGENT_DIRat a directory that doesn't exist. Without it, a developer's real global config could leak into the test suite.Checks
npm run checkpasses: types, lint, formatting, 421 tests, 100% coverage.