Skip to Content
RunbooksTemplatesCode Review Agent Runbook

Code Review Agent Runbook

Owner: platform-runners Template: Code Review Agent (certified, gallery-visible) Expected duration: ~10 minutes per PR Expected cost range: $0.50–$5.00 per PR Tool profile: web_automation Auto-fire path: GitHub webhook (pull_request events)

This template is autonomy=auto and fires via webhook. Operator approval happens at trigger-creation time, not per run, so failures look different from interactive launches.

Known failure reasons

ReasonWhat happenedFirst action
github_token_missing_or_revokedThe org’s GitHub credential is missing or expired.Reconnect in Integrations → GitHub.
repo_not_accessible_to_appToken valid, repo unreachable.Install the GitHub App on the target repo.
slack_bot_token_missing_or_revokedSlack summary post failed.Reconnect in Integrations → Slack; review still posts to GitHub even if Slack fails.
pr_already_merged_or_closedWebhook fired late; PR is no longer reviewable.Ignore; the webhook fire log marks this as a benign no-op.
review_comment_post_quota_exceededGitHub rate-limited the agent’s review comment posts.Customer’s repo hit GitHub’s review-comment cap. Reduce severity_threshold to cut comment volume.

Diagnostic steps

  1. Was the webhook delivered? Check Webhooks → Fire Log for the PR’s commit SHA. If the entry is missing, the webhook trigger itself is broken — see webhook-triggers runbook.
  2. Did the agent come online? Look for the BYOVM agent the trigger is bound to; if it’s offline, the webhook fire log marks the run as failed with agent_offline_at_fire_time.
  3. Tool profile policy? SS-050 (see services/backend/src/services/runner_control_plane/openclaw_runtime_profile.py) denies full_vm_tools from webhook fires by default. This template uses web_automation, so it should NOT hit that gate — if it does, someone has overridden the tool profile on a copy of this template.
  4. Run timeline. Click Copy diagnostics on the failed run to pull the redacted bundle including the timeline tail.

Rollback / cleanup behavior

From the template’s rollback_or_cleanup_behavior:

  • Cancelling the run leaves in-flight review comments as drafts; no posted review is rolled back.
  • The auto-approve path is idempotent: if the PR’s HEAD changes between the agent’s decision and the gh pr review call, GitHub rejects the stale approval and the next webhook fire retries.

Escalation

If the same PR fails three times in a row with different reasons, disable the webhook trigger temporarily in Webhooks → Triggers and ping platform-runners with the fire IDs.