feat: batch AI responses on review submit (#94)#106
Conversation
- 'Also request AI responses for all N comments' toggle in submit dialog - Toggle off by default, triggers background agents for all comments - Agents run in parallel with concurrency limit (max 3) - Agent failures on individual comments don't block others - Progress indicators inline beneath each comment (spinner → checkmark/X) - B+ expandable details pattern for streaming responses - Agent status tracked in ReviewDraft comment agentStatus field - Tests: batch spawns, failure isolation, toggle off, concurrency limit
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75f9b8738c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| [WS_METHODS.changeRequestRunBatchAgents]: (input) => | ||
| observeRpcStreamEffect( | ||
| WS_METHODS.changeRequestRunBatchAgents, |
There was a problem hiding this comment.
Add the batch-agent RPC authorization scope
This new RPC handler is not registered in RPC_REQUIRED_SCOPE (checked the map in apps/server/src/ws.ts, which lists changeRequest.runBackgroundAgent but not changeRequest.runBatchAgents). Since observeRpcStreamEffect authorizes by calling requiredScopeForMethod(method), invoking this endpoint throws RPC method changeRequest.runBatchAgents has no declared authorization scope before the stream can start, so the new batch-agent toggle cannot work. Add the same review-write scope used by the single-agent endpoint.
Useful? React with 👍 / 👎.
| if (updatedDraft) { | ||
| const commentIds = updatedDraft.comments.map((c) => c.id); |
There was a problem hiding this comment.
Limit batch agents to submitted local comments
When the draft already includes GitHub review comments, submitReview returns a published draft merged with those fetched GitHub comments as well as the submitted local ones, so mapping every updatedDraft.comments id here can spawn agents for pre-existing/non-local comments the user did not just submit. Capture/filter the local draft comment ids before submitting, or filter the returned comments to only the submitted local comments before calling runBatchAgents.
Useful? React with 👍 / 👎.
Parent
Parent PRD: #81
What was built
Optional toggle on the submit review confirmation dialog that triggers background agents for all submitted comments simultaneously after the review is posted to GitHub. Each comment gets its own agent with concurrency limiting.
Changes
Closes #94