Skip to main content
The ao review-check command scans open pull requests for pending review comments and automatically sends agents messages to address them. This is useful for proactively handling review feedback without manual intervention.

Syntax

Arguments

string
Project ID to check. If omitted, checks all projects.

Options

flag
Show what would be done without actually sending messages to agents

How It Works

The command performs these steps:
  1. Fetch sessions - Lists all sessions for the specified project (or all projects)
  2. Filter PRs - Identifies sessions with open pull requests
  3. Check reviews - Queries GitHub GraphQL API for each PR to check:
    • Review decision (APPROVED, CHANGES_REQUESTED, etc.)
    • Unresolved review threads
  4. Notify agents - Sends a message to each agent with pending reviews

Review Detection

A session is considered to have pending reviews if either:
  • The PR has a CHANGES_REQUESTED review decision
  • The PR has one or more unresolved review threads

Message Format

When reviews are detected, the command sends this message to the agent:
The agent can then use GitHub CLI commands to fetch and address the comments.

Examples

Check all projects

Scans all sessions across all projects for pending reviews.

Check a specific project

Checks only sessions belonging to the frontend project.

Dry run to preview actions

Shows which sessions have pending reviews without sending messages:

Output

Sessions with pending reviews

No pending reviews

Implementation Details

GraphQL Query

The command uses GitHub’s GraphQL API to efficiently fetch review data:
This avoids REST API pagination and fetches all necessary data in one request.

Agent Interruption

Before sending the message, the command:
  1. Sends Ctrl-C to interrupt any running command
  2. Waits 500ms for the interruption to take effect
  3. Sends Ctrl-U to clear any partial input
  4. Waits 200ms
  5. Sends the review message
  6. Presses Enter to submit
This ensures the agent receives the message even if it’s currently busy.

Error Handling

Error: Unknown project: xyzCause: The specified project ID does not exist in agent-orchestrator.yaml.Solution: Check your configuration file and use a valid project ID from ao status.
If a PR cannot be accessed (private repo, insufficient permissions), it is silently skipped. No error is displayed.Solution: Ensure the gh CLI is authenticated with appropriate permissions:
Error: Failed to send: ...Cause: Tmux session is not running or target is invalid.Solution: Verify the session exists with ao status and is in a running state.

Use Cases

Automated review response workflow

Set up a cron job to periodically check for reviews:

CI/CD integration

Trigger review checks after a PR review event:

Manual review triage

Before end of day, check all pending reviews:
Review the output, then run without --dry-run to send messages.

Prerequisites

  • gh CLI - Must be authenticated with the repository
  • GraphQL API access - Repository must be accessible via GitHub GraphQL API
  • tmux - Sessions must be running in tmux for message delivery