Part of #1367 (Phase 2 — AI Review Parity).
Goal
Comment-driven interaction, matching CodeRabbit's command set (commands) and Pullfrog's @pullfrog mentions (iterating in GitHub):
- Mention trigger:
@buddy-bot <anything>in an issue comment, PR comment, or review comment starts an agent task with that instruction - Structured commands (fast paths that skip free-form agent planning):
@buddy-bot review/full review— trigger/refresh review (#1375)@buddy-bot summary— regenerate PR summary@buddy-bot resolve— resolve all its own review threads@buddy-bot pause/resume— per-PR review pausing@buddy-bot ignore— skip this PR permanently@buddy-bot rebase— dependency-PR rebase (wire to existing rebase path,bin/cli.ts:696)@buddy-bot merge— evaluate auto-merge conditions now (#1369)@buddy-bot plan— issue planning (#1383)@buddy-bot help— command list
- Conversational replies: replying to a Buddy Bot review comment continues that thread with full finding context (CodeRabbit's agentic chat); the reply can defend, explain, or produce a committable suggestion
- Reaction acknowledgement: 👀 reaction on receipt, ✅/❌ on completion (cheap UX win both competitors have)
Design
src/commands/parser.ts: extract command + args from comment body; strict prefix match on the bot's mention name (configurable, default@buddy-bot); ignore comments authored by the bot itself (loop guard)src/commands/dispatcher.ts: command registry mapping to handlers; unknown text → free-form agent task in a permission tier derived from the commenter's repo permission (collaborator vs not — #1374 actor gating)- Workflow trigger:
issue_comment: [created]+pull_request_review_comment: [created]ingenerateUnifiedWorkflow(src/setup.ts), with an early cheap guard step (comment contains mention) before checking out or installing anything — keep Actions cost near zero for non-mention comments - CLI entry
buddy-bot handle-comment --payload <event.json>so the workflow step is a one-liner and the logic is testable - State: pause/ignore stored as markers in the PR body manifest (#1368) or labels (
buddy-bot:paused) — prefer labels for visibility
Permission model
- Read-only commands (
summary,help): anyone - Mutating commands (
rebase,merge,resolve, free-form tasks): collaborators with write access — verify viaGET /repos/{o}/{r}/collaborators/{user}/permission - Non-collaborators on public repos: replies allowed, restricted tier (no fs/shell/git tools)
Tasks
- Parser + dispatcher +
handle-commentCLI with full command table - Workflow trigger emission + cheap pre-filter + actor permission check
- Thread-context assembly for conversational replies (fetch thread, finding fingerprint, file excerpt)
- Reactions via
POST /repos/{o}/{r}/issues/comments/{id}/reactions - Loop-guard tests (bot mentioning itself, edited comments, quoted mentions in code blocks must NOT trigger)
docs/ai/commands.mdwith the command table and permission matrix
Acceptance criteria
- Each structured command works end-to-end in a test repo; unknown-command text spawns a free-form agent run for collaborators only
- Mentions inside fenced code blocks or quotes do not trigger
- Every handled comment gets 👀 then ✅/❌
- Zero-cost skip: workflows for non-mention comments terminate in the guard step