Skip to content

feat(review): accept repository and worktree directory targets - #1644

Merged
backnotprop merged 3 commits into
backnotprop:mainfrom
oorestisime:feat/review-directory-target
Sep 30, 2026
Merged

backnotprop merged 3 commits into
backnotprop:mainfrom
oorestisime:feat/review-directory-target

Conversation

@oorestisime

Copy link
Copy Markdown
Contributor

Adds plannotator review [DIRECTORY | PR_URL] and equivalent slash-command support so an agent session can review another repository or worktree without moving the session. A directory inside a repository selects its root; a non-repository parent reuses the existing combined workspace review.

The selected directory is passed through discovery, diff generation, repository metadata, and project identity across the CLI, OpenCode, and Pi. Feedback returns to the invoking session and names the directory active at submission, including after a worktree switch. Bare approvals stay unchanged. Host descriptions, skills, and docs describe the new target semantics.

Closes #896. Closes #1482.

Maintainer review

  • Positional-argument compatibility is the main decision: fix(review): error loudly on unknown review options instead of silently dropping them #1483 deliberately retained tolerance for prose. This change treats plain positional words as directory targets and rejects extra arguments, so /plannotator-review please review my changes now errors. Missing directories, file targets, and a directory combined with --patch-file also fail before discovery rather than opening the caller's repository.
  • OpenCode version skew: directory reviews use a distinct internal opencode-review-directory command. Older binaries reject it instead of silently ignoring the target and reviewing the wrong repository; directory reviews therefore require an updated CLI.
  • Directory ownership: review the cwd propagation and submission-time directory resolution, since an initial diff from the right repository is insufficient if subsequent reads, staging, or feedback refer elsewhere. Plugin hosts never change the process cwd.

Verification is strongest on Linux/Git. Native macOS/Windows and live JJ/GitButler/P4 directory workflows remain unverified.

oorestisime and others added 3 commits September 30, 2026 14:23
backnotprop#1483 kept plain positional words tolerated because slash-command hosts
(Claude Code, Gemini, Copilot bang prefixes; OpenCode; Pi) forward raw
user words verbatim. Directory targets now resolve through
resolveReviewTarget, following the annotate tolerant-args precedent:

- a sole word, or any path-shaped word (/, ., ~), is a directory
  candidate; a path-shaped typo or a file still errors
- other words are ignored with a notice and the invoking cwd is
  reviewed as before
- a PR/MR URL is found anywhere among the words; two targets error

OpenCode: prose keeps the opencode-review command, so it still works on
an old binary; the update hint also covers pre-0.27.11 binaries, which
answer 'No plan content in hook event'. Tests realpath their tmp roots
so they pass on macOS.
@backnotprop
backnotprop merged commit 16036b4 into backnotprop:main Sep 30, 2026
24 checks passed
backnotprop added a commit that referenced this pull request Sep 30, 2026
* fix(review): treat path-shaped prose words as prose, not fatal targets

#1644 made any path-shaped word a directory target and threw when it did not
resolve, so '/plannotator-review review the frontend/backend split' failed.
Among several words, a path-shaped word that is missing or a file is now
ignored with the usual notice; an existing directory still selects it. A sole
argument keeps the strict behavior. OpenCode also toasts a refused review
target and the update-CLI hint instead of only logging them.

* test(opencode): give the older-CLI bridge test a 20s timeout

It now spawns the stub CLI five times and intermittently exceeded bun's 5s default locally.
YeKc1M pushed a commit to YeKc1M/plannotator that referenced this pull request Oct 1, 2026
…otprop#1644)

* feat(review): accept repository and worktree directory targets

* fix(review): keep prose tolerated when review words name no directory

backnotprop#1483 kept plain positional words tolerated because slash-command hosts
(Claude Code, Gemini, Copilot bang prefixes; OpenCode; Pi) forward raw
user words verbatim. Directory targets now resolve through
resolveReviewTarget, following the annotate tolerant-args precedent:

- a sole word, or any path-shaped word (/, ., ~), is a directory
  candidate; a path-shaped typo or a file still errors
- other words are ignored with a notice and the invoking cwd is
  reviewed as before
- a PR/MR URL is found anywhere among the words; two targets error

OpenCode: prose keeps the opencode-review command, so it still works on
an old binary; the update hint also covers pre-0.27.11 binaries, which
answer 'No plan content in hook event'. Tests realpath their tmp roots
so they pass on macOS.

---------

Co-authored-by: Michael Ramos <mdramos8@gmail.com>
YeKc1M pushed a commit to YeKc1M/plannotator that referenced this pull request Oct 1, 2026
…otprop#1649)

* fix(review): treat path-shaped prose words as prose, not fatal targets

backnotprop#1644 made any path-shaped word a directory target and threw when it did not
resolve, so '/plannotator-review review the frontend/backend split' failed.
Among several words, a path-shaped word that is missing or a file is now
ignored with the usual notice; an existing directory still selects it. A sole
argument keeps the strict behavior. OpenCode also toasts a refused review
target and the update-CLI hint instead of only logging them.

* test(opencode): give the older-CLI bridge test a 20s timeout

It now spawns the stub CLI five times and intermittently exceeded bun's 5s default locally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants