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_automationAuto-fire path: GitHub webhook (pull_requestevents)
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
| Reason | What happened | First action |
|---|---|---|
github_token_missing_or_revoked | The org’s GitHub credential is missing or expired. | Reconnect in Integrations → GitHub. |
repo_not_accessible_to_app | Token valid, repo unreachable. | Install the GitHub App on the target repo. |
slack_bot_token_missing_or_revoked | Slack summary post failed. | Reconnect in Integrations → Slack; review still posts to GitHub even if Slack fails. |
pr_already_merged_or_closed | Webhook fired late; PR is no longer reviewable. | Ignore; the webhook fire log marks this as a benign no-op. |
review_comment_post_quota_exceeded | GitHub 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
- 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.
- 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
failedwithagent_offline_at_fire_time. - Tool profile policy? SS-050 (see
services/backend/src/services/runner_control_plane/openclaw_runtime_profile.py) deniesfull_vm_toolsfrom webhook fires by default. This template usesweb_automation, so it should NOT hit that gate — if it does, someone has overridden the tool profile on a copy of this template. - 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 reviewcall, 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.