Skip to content

feat: batch AI responses on review submit (#94)#106

Merged
harrryyd merged 2 commits into
mainfrom
feature/issue-94-batch-ai-responses
Jun 8, 2026
Merged

feat: batch AI responses on review submit (#94)#106
harrryyd merged 2 commits into
mainfrom
feature/issue-94-batch-ai-responses

Conversation

@harrryyd
Copy link
Copy Markdown
Owner

@harrryyd harrryyd commented Jun 8, 2026

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

  • "Also request AI responses for all N comments" toggle in submit confirmation (off by default)
  • Review submitted first, then agents spawned for every comment
  • Agents run in parallel with concurrency limit (max 3)
  • Agent failures on individual comments don't block other agents
  • Progress indicators inline beneath each comment
  • B+ expandable details pattern for streaming responses
  • Agent status tracked in ReviewDraft agentStatus field
  • Tests: batch spawns, failure isolation, toggle off, concurrency limit

Closes #94

- '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
@github-actions github-actions Bot added size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Jun 8, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread apps/server/src/ws.ts
Comment on lines +1655 to +1657
[WS_METHODS.changeRequestRunBatchAgents]: (input) =>
observeRpcStreamEffect(
WS_METHODS.changeRequestRunBatchAgents,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +194 to +195
if (updatedDraft) {
const commentIds = updatedDraft.comments.map((c) => c.id);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@harrryyd harrryyd merged commit 7ea060f into main Jun 8, 2026
5 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Batch AI responses on review submit

1 participant