Skip to content

review: ask for a code review now, on a PR or on your working tree#82

Merged
hbrooks merged 1 commit into
mainfrom
hunter/agent-review
Jul 25, 2026
Merged

review: ask for a code review now, on a PR or on your working tree#82
hbrooks merged 1 commit into
mainfrom
hunter/agent-review

Conversation

@hbrooks

@hbrooks hbrooks commented Jul 25, 2026

Copy link
Copy Markdown
Member

The CLI half of the reviews surface. Backend shipped in ellipsis-dev/ellipsis#5980; @ellipsis-dev/sdk@0.3.0 is published, and this bumps to it for the generated types.

Reviews could only be triggered by a push. Now:

agent review 5975            # review a pull request (also accepts #5975 or the PR URL)
agent review                 # review the work in your tree, right now
agent review get <id>        # findings, scope, and whether it posted
agent review list --repo o/r --pr 5975

Aliases: reviews, code-review, cr.

Summary

  • agent review <pr> blocks and streams the review live, then prints the findings — the findings are collected from the sandbox at teardown, so they only exist once it finalizes. That's the same stream-then-re-GET two-step agent asset get uses. --no-wait prints the id and exits.
  • A bare agent review is the interesting one: it snapshots your working tree (git stash create, so your tree is untouched), force-pushes it to ellipsis/review/<your-branch>, and the platform finds-or-creates a draft PR to review it against — a code review is structurally a PR review, so it needs one. Always terminal-only: the PR being reviewed is one the platform manufactured, so commenting on it would be talking to itself.
  • A review id IS a session id, so agent session get <review-id>, --watch, records, and stop all work on it unchanged. That's why there's no review-specific status, stream, or cost plumbing here — it reuses watchSessionStreaming.
  • Findings print greppable, path:42-48 [4/5 security] with the claim, evidence, and suggested fix indented beneath, highest severity first (the order the platform posts them in). A finding anchored off the diff is labelled recorded-not-posted.

Notes for the reviewer

  • --no-post only applies to a real PR. The local path hard-codes post: false rather than reading the flag — the first draft threaded the option through and a test caught that --post would have been honored.
  • review reserves the word, so agent review the auth changes dispatches here instead of starting a session with that prompt (the tradeoff every subcommand makes). The error names the fix: quote it.
  • Branch → PR auto-resolution is not implemented. Spec §6 wants a bare agent review on a branch that already has a PR to review that PR incrementally; there's no /v1 endpoint to look a PR up by branch, so it always takes the local path. Adding one is a backend follow-up — flagging rather than guessing.
  • The sidecar branch and its draft PR linger — nothing sweeps them (spec §8).

Test plan

  • bun run typecheck clean
  • bun run test318 passed, 20 new
  • bun run build and the --compile binary both succeed; agent review --help renders on the compiled binary
  • The local path is tested against a real throwaway git repo (bare remote on disk), asserting the sidecar branch actually receives the commit and the working branch is untouched
  • Dispatch verified by hand for all four aliases, the default subcommand (agent review 5975), and that the bare-prompt shorthand still reaches session start
  • Not yet run against a live review — the backend gate is ellipsis-dev-only and posting is prod-only, so a real end-to-end pass wants a throwaway PR in our org

🤖 Generated with Claude Code

Reviews could only be triggered by a push. `agent review 5975` reviews a
pull request on demand; a bare `agent review` reviews the work in your tree
right now, before there is a PR to review it against.

The local path snapshots your working tree, force-pushes it to a sidecar
branch (never the branch you are on), and the platform finds-or-creates a
draft PR to review it against — a code review is structurally a PR review, so
it needs one. Those reviews are terminal-only: nothing is posted to GitHub,
findings print in the terminal.

A review id IS a session id, so `agent session get <review-id>`, records, and
stop all work on it — which is why there is no review-specific status or
stream plumbing here. Needs @ellipsis-dev/sdk 0.3.0 for the generated types.
@hbrooks
hbrooks merged commit d0de02e into main Jul 25, 2026
1 check passed
@hbrooks
hbrooks deleted the hunter/agent-review branch July 25, 2026 20:01
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