Skip to content

feat(web): acknowledge review command comments with a reaction#1174

Open
fatmcgav wants to merge 5 commits into
sourcebot-dev:mainfrom
fatmcgav:feat-ai-codereview-ack-comment
Open

feat(web): acknowledge review command comments with a reaction#1174
fatmcgav wants to merge 5 commits into
sourcebot-dev:mainfrom
fatmcgav:feat-ai-codereview-ack-comment

Conversation

@fatmcgav
Copy link
Copy Markdown
Contributor

@fatmcgav fatmcgav commented May 5, 2026

Adds a configurable acknowledgment reaction/emoji to the triggering
comment when the review agent receives a review command, so users
get immediate feedback that the request was received.

  • github: reacts to the issue comment via the reactions API (default: eyes)
  • gitlab: awards an emoji on the MR note via MergeRequestNoteAwardEmojis
  • New REVIEW_AGENT_ACK_REACTION env var (default: eyes) controls the reaction
  • Acknowledgment failures are logged as warnings and do not block the review

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

Summary by CodeRabbit

  • New Features

    • Review Agent now adds an acknowledgement reaction to review-command comments on GitHub and GitLab (best-effort).
  • Behavior

    • Acknowledgement is non-blocking; failures or timeouts are logged and do not prevent processing.
  • Configuration

    • New REVIEW_AGENT_ACK_REACTION environment variable (default: "eyes") to configure the acknowledgement emoji.
  • Documentation

    • Environment variable reference and changelog updated to document the new reaction setting.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

PR changed again? Review this PR in Change Stack to compare snapshots and stay oriented.

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a4192d35-0513-437c-9f7d-a3e07db41811

📥 Commits

Reviewing files that changed from the base of the PR and between 7c21f39 and 32e7008.

📒 Files selected for processing (1)
  • docs/docs/configuration/environment-variables.mdx
✅ Files skipped from review due to trivial changes (1)
  • docs/docs/configuration/environment-variables.mdx

Walkthrough

Adds a configurable acknowledgement reaction for the Review Agent and a minor docs typo fix. Webhooks try to add the configured reaction (env var REVIEW_AGENT_ACK_REACTION, default "eyes") to the triggering GitHub comment or GitLab note (timed, non-blocking) before processing the review command.

Changes

Review Agent Acknowledgment Reaction

Layer / File(s) Summary
Environment / Config
packages/shared/src/env.server.ts
Adds REVIEW_AGENT_ACK_REACTION with default "eyes" to the server environment schema and exported env mapping.
Data Shape / Types
packages/web/src/features/agents/review-agent/types.ts
gitLabNotePayloadSchema gains object_attributes.id: number, updating the inferred GitLabNotePayload type.
Core Integration (ack helper)
packages/web/src/app/api/(server)/webhook/route.ts
Adds ACK_TIMEOUT_MS = 1500 and ackWithTimeout helper that races an ack API call against a timeout and logs warnings on failure.
Webhook Wiring (GitHub)
packages/web/src/app/api/(server)/webhook/route.ts
Before processing a review command: for GitHub issue_comment events call octokit.rest.reactions.createForIssueComment(...) via ackWithTimeout. Failures/timeouts are logged and do not block subsequent processing.
Webhook Wiring (GitLab)
packages/web/src/app/api/(server)/webhook/route.ts
Before processing a review command: for GitLab Note Hook events call gitlabClient.MergeRequestNoteAwardEmojis.award(...) via ackWithTimeout. Failures/timeouts are logged and do not block subsequent processing.
Documentation
docs/docs/configuration/environment-variables.mdx, docs/docs/features/agents/review-agent.mdx, CHANGELOG.md
Add REVIEW_AGENT_ACK_REACTION (default eyes) to env var reference tables, add changelog entry, and fix AUTH_SECRET typo.

Sequence Diagram(s)

sequenceDiagram
    participant GitHost as GitHub/GitLab
    participant Webhook as Webhook Handler
    participant AckAPI as Reactions API
    participant Processor as Review Processor

    GitHost->>Webhook: issue_comment / Note Hook (review command)
    Webhook->>AckAPI: create reaction (uses env.REVIEW_AGENT_ACK_REACTION)
    alt ack succeeds within 1500ms
        AckAPI-->>Webhook: 200 OK
    else ack fails or times out
        AckAPI-->>Webhook: error/timeout (logged)
    end
    Webhook->>Processor: fetch PR/MR and invoke processGitHubPullRequest / processGitLabMergeRequest
    Processor-->>Webhook: processing result
    Webhook-->>GitHost: respond 200
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • brendan-kellam
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: adding acknowledgment reactions to review command comments.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/web/src/app/api/`(server)/webhook/route.ts:
- Around line 189-199: Wrap the best-effort acknowledgment calls in a timeout
wrapper so they don't block webhook processing: replace the direct await of
octokit.rest.reactions.createForIssueComment(...) (and the analogous GitLab ack
call) with a withTimeout or Promise.race that races the API promise against a
1500ms timeout promise, and proceed regardless of timeout or error; keep
existing error logging (logger.warn) for failures but ensure the handler
continues immediately when the timeout fires and do not await the ack
indefinitely—use the existing env.REVIEW_AGENT_ACK_REACTION and method
octokit.rest.reactions.createForIssueComment to locate the GitHub call and the
corresponding GitLab ack function to apply the same pattern.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c0ea19aa-2825-42c9-83a3-4ab2a5de8919

📥 Commits

Reviewing files that changed from the base of the PR and between a6116ca and f327c52.

📒 Files selected for processing (5)
  • docs/docs/configuration/environment-variables.mdx
  • docs/docs/features/agents/review-agent.mdx
  • packages/shared/src/env.server.ts
  • packages/web/src/app/api/(server)/webhook/route.ts
  • packages/web/src/features/agents/review-agent/types.ts

Comment thread packages/web/src/app/api/(server)/webhook/route.ts Outdated
@fatmcgav fatmcgav force-pushed the feat-ai-codereview-ack-comment branch from 6ee674d to 428c038 Compare May 7, 2026 08:07
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/docs/configuration/environment-variables.mdx`:
- Line 73: Update the table row for REVIEW_AGENT_ACK_REACTION so the default
value is formatted as inline code; change the Default column from plain eyes to
backtick-wrapped `eyes` (edit the table entry that references
REVIEW_AGENT_ACK_REACTION to use `eyes`).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 518b405b-9f79-4d05-ac41-c28873b26fcd

📥 Commits

Reviewing files that changed from the base of the PR and between 6ee674d and 428c038.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • docs/docs/configuration/environment-variables.mdx
  • docs/docs/features/agents/review-agent.mdx
  • packages/shared/src/env.server.ts
  • packages/web/src/app/api/(server)/webhook/route.ts
  • packages/web/src/features/agents/review-agent/types.ts
✅ Files skipped from review due to trivial changes (1)
  • docs/docs/features/agents/review-agent.mdx
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/web/src/features/agents/review-agent/types.ts
  • CHANGELOG.md
  • packages/shared/src/env.server.ts
  • packages/web/src/app/api/(server)/webhook/route.ts

Comment thread docs/docs/configuration/environment-variables.mdx
fatmcgav and others added 4 commits June 5, 2026 20:13
Adds a configurable acknowledgment reaction/emoji to the triggering
comment when the review agent receives a `/review` command, so users
get immediate feedback that the request was received.

- GitHub: reacts to the issue comment via the reactions API (default: `eyes`)
- GitLab: awards an emoji on the MR note via `MergeRequestNoteAwardEmojis`
- New `REVIEW_AGENT_ACK_REACTION` env var (default: `eyes`) controls the reaction
- Acknowledgment failures are logged as warnings and do not block the review

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>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fatmcgav fatmcgav force-pushed the feat-ai-codereview-ack-comment branch from 428c038 to 7c21f39 Compare June 5, 2026 19:17
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/docs/configuration/environment-variables.mdx`:
- Line 15: The documentation line for the AUTH_SECRET environment variable
contains a typo; update the description for AUTH_SECRET (the table cell text
currently reading "Genearte one with `openssl rand -base64 33`.") to correct the
spelling to "Generate one with `openssl rand -base64 33`." Ensure only the word
"Genearte" is changed to "Generate" in the AUTH_SECRET entry.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c9401610-a610-4974-a095-06ec56a9c1cf

📥 Commits

Reviewing files that changed from the base of the PR and between 428c038 and 7c21f39.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • docs/docs/configuration/environment-variables.mdx
  • docs/docs/features/agents/review-agent.mdx
  • packages/shared/src/env.server.ts
✅ Files skipped from review due to trivial changes (2)
  • docs/docs/features/agents/review-agent.mdx
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/shared/src/env.server.ts

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/docs/configuration/environment-variables.mdx`:
- Line 15: The documentation line for the AUTH_SECRET environment variable
contains a typo; update the description for AUTH_SECRET (the table cell text
currently reading "Genearte one with `openssl rand -base64 33`.") to correct the
spelling to "Generate one with `openssl rand -base64 33`." Ensure only the word
"Genearte" is changed to "Generate" in the AUTH_SECRET entry.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c9401610-a610-4974-a095-06ec56a9c1cf

📥 Commits

Reviewing files that changed from the base of the PR and between 428c038 and 7c21f39.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • docs/docs/configuration/environment-variables.mdx
  • docs/docs/features/agents/review-agent.mdx
  • packages/shared/src/env.server.ts
✅ Files skipped from review due to trivial changes (2)
  • docs/docs/features/agents/review-agent.mdx
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/shared/src/env.server.ts
🛑 Comments failed to post (1)
docs/docs/configuration/environment-variables.mdx (1)

15-15: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix typo in the AUTH_SECRET description.

Genearte should be Generate in the sentence about creating the secret key.

Proposed fix
-| `AUTH_SECRET` **(required)** | - | <p>Used to validate login session cookies. Genearte one with `openssl rand -base64 33`.</p> |
+| `AUTH_SECRET` **(required)** | - | <p>Used to validate login session cookies. Generate one with `openssl rand -base64 33`.</p> |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

| `AUTH_SECRET` **(required)** | - | <p>Used to validate login session cookies. Generate one with `openssl rand -base64 33`.</p> |
🧰 Tools
🪛 LanguageTool

[grammar] ~15-~15: Ensure spelling is correct
Context: ...Used to validate login session cookies. Genearte one with openssl rand -base64 33.

...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/docs/configuration/environment-variables.mdx` at line 15, The
documentation line for the AUTH_SECRET environment variable contains a typo;
update the description for AUTH_SECRET (the table cell text currently reading
"Genearte one with `openssl rand -base64 33`.") to correct the spelling to
"Generate one with `openssl rand -base64 33`." Ensure only the word "Genearte"
is changed to "Generate" in the AUTH_SECRET entry.

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