Skip to content

chore(pr-review): Prefer local tools when PR branch is checked out#809

Merged
JeanMertz merged 2 commits into
mainfrom
just-pr-review-local-code
Jun 29, 2026
Merged

chore(pr-review): Prefer local tools when PR branch is checked out#809
JeanMertz merged 2 commits into
mainfrom
just-pr-review-local-code

Conversation

@JeanMertz

Copy link
Copy Markdown
Collaborator

When running just pr-review NNN or just pr-triage NNN, the recipes now detect whether the local working tree is already at that PR's HEAD before building the prompt. A new _pr-checkout-state helper resolves the PR's head SHA via git ls-remote (no gh needed) and compares it to HEAD, reporting LOCAL <sha>, DIRTY <sha>, or REMOTE.

When the tree matches, the assistant is told to prefer the local fs_* and git_* tools over the slower github_* API calls. When the tree is dirty, it is told to run git status first and confirm that local edits don't affect the read before trusting local output. Both personas (pr-reviewer and pr-triager) have updated instructions to act on this signal.

pr-triage additionally offers an interactive prompt when the working tree is on the PR's branch, letting the caller continue in an existing session-bound conversation (via jp conversation use '?session') rather than always opening a fresh, context-free one.

When running `just pr-review NNN` or `just pr-triage NNN`, the recipes
now detect whether the local working tree is already at that PR's HEAD
before building the prompt. A new `_pr-checkout-state` helper resolves
the PR's head SHA via `git ls-remote` (no `gh` needed) and compares it
to `HEAD`, reporting `LOCAL <sha>`, `DIRTY <sha>`, or `REMOTE`.

When the tree matches, the assistant is told to prefer the local `fs_*`
and `git_*` tools over the slower `github_*` API calls. When the tree
is dirty, it is told to run `git status` first and confirm that local
edits don't affect the read before trusting local output. Both personas
(`pr-reviewer` and `pr-triager`) have updated instructions to act on
this signal.

`pr-triage` additionally offers an interactive prompt when the working
tree is on the PR's branch, letting the caller continue in an existing
session-bound conversation (via `jp conversation use '?session'`) rather
than always opening a fresh, context-free one.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz force-pushed the just-pr-review-local-code branch from 3bdf215 to b1d5078 Compare June 29, 2026 13:39
@JeanMertz JeanMertz merged commit e0a8db5 into main Jun 29, 2026
16 checks passed
@JeanMertz JeanMertz deleted the just-pr-review-local-code branch June 29, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant