Skip to content

feat: standalone spawn mode + PR inline comment review#477

Open
MW-DO wants to merge 20 commits intobacknotprop:mainfrom
Bezoar:spawn-mode
Open

feat: standalone spawn mode + PR inline comment review#477
MW-DO wants to merge 20 commits intobacknotprop:mainfrom
Bezoar:spawn-mode

Conversation

@MW-DO
Copy link
Copy Markdown

@MW-DO MW-DO commented Apr 2, 2026

Summary

  • Add plannotator plan <file.md | --archive | -> subcommand for standalone plan review without hooks
  • Add --spawn flag (and PLANNOTATOR_SPAWN env var) to plan, review, and annotate modes — feedback spawns a new interactive claude session instead of writing hook output
  • Fetch and display PR inline review comments on the diff viewer with reply-to-annotation support
  • UI shows "Send to Claude" / "Dismiss" buttons in spawn mode

Test plan

  • plannotator plan /tmp/test.md opens plan review UI
  • plannotator plan /tmp/test.md --spawn opens UI with "Send to Claude"/"Dismiss" buttons, feedback spawns claude
  • plannotator plan --archive --spawn opens archive browser
  • plannotator plan - reads from stdin
  • plannotator review --spawn opens code review with spawn buttons
  • plannotator annotate README.md --spawn opens annotate with spawn buttons
  • PLANNOTATOR_SPAWN=1 plannotator plan /tmp/test.md works via env var
  • plannotator review https://github.com/.../pull/N --spawn shows inline PR comments on diff
  • Replying to a PR comment creates annotation with context in export
  • Existing hook flows (no --spawn) are unaffected
  • All 385 tests pass (1 pre-existing failure in pi-extension unrelated)

🤖 Generated with Claude Code

Mark Welch and others added 20 commits March 29, 2026 18:56
Adds hook-stdin.ts with parseHookStdin() and formatPreToolUseDeny() utilities,
plus colocated tests covering all 6 cases. These will be used by the upcoming
annotate-hook and review-hook subcommands to bypass the Bash tool timeout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds two new CLI subcommands (`annotate-hook` and `review-hook`) that read PreToolUse hook stdin JSON, extract the relevant command args, run the shared annotate/review flow, and emit a formatted PreToolUse deny decision with feedback.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: bypass 10-min Bash timeout for annotate and review via PreToolUse hooks
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
In spawn mode, the deny/feedback button shows "Send to Claude" and the
approve button shows "Dismiss" (clicking it just closes the window).
The approve/dismiss button is also made visible in annotate+spawn mode.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds `plannotator plan <file.md | - | --archive>` subcommand for reviewing plans outside the hook flow. Introduces global `--spawn` flag (via isSpawnMode()) that, when set, launches a new claude session with the denial feedback instead of printing to stdout. Removes --spawn from args before subcommand routing so all subcommands see clean args.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Threads spawnFlag through runReviewFlow() and runAnnotateFlow() into
their respective server options, and adds post-feedback spawn logic to
the review and annotate subcommand blocks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…port

Lift usePRContext hook from ReviewPanel to App.tsx so inline comments flow
to both the sidebar and DiffViewer. PR inline comments render after their
target diff line using the same lineAnnotations slot as user annotations and
AI markers. Reply creates a CodeAnnotation with prComment metadata for
export.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nv var

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The compiled binary couldn't resolve @plannotator/server/spawn because
the export path was missing from the package's exports map.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bun's default 10s idle timeout causes "[Bun.serve]: request timed out"
errors on stderr when the server shuts down with lingering SSE connections.
Setting idleTimeout to 255s (max) avoids the false warning.

Also removes temporary debug logging from annotate subcommand.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Instead of extending idleTimeout, properly dispose all SSE subscriber
streams via ExternalAnnotationHandler.dispose() before calling
server.stop(). This prevents the "[Bun.serve]: request timed out"
error from lingering connections.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants