Skip to content

Automate CodeRabbit rate-limit fallback to exact-head Qodo review #168

Description

@safal207

Goal

Add a safe reviewer fallback for pull requests when CodeRabbit reports a native review-rate limit.

Qodo is the primary exact-head reviewer. CodeRabbit remains supplemental. A CodeRabbit quota failure must not be treated as approval and must not stall the review graph when trusted Qodo review is available.

Trigger

React only to a trusted native CodeRabbit bot comment that explicitly reports review unavailability or rate limiting, such as Review limit reached.

Required trust checks

Before requesting Qodo review, the automation must verify:

  1. repository and pull request are the expected target;
  2. pull request is still open;
  3. event actor/comment author is the canonical CodeRabbit bot identity;
  4. rate-limit marker is present in the trusted bot payload;
  5. the recorded PR head is a full 40-character SHA and still equals the current head;
  6. no successful or in-progress Qodo request already exists for that exact head;
  7. no newer head superseded the request;
  8. the workflow cannot be triggered recursively by its own comment.

Fallback action

Post exactly one native Qodo /review request bound to the current PR head, plus a structured review rubric:

  • reconstruct intended invariants first;
  • treat green CI as evidence, not proof;
  • search for fail-open behavior, stale-SHA acceptance, artifact substitution, symlink/path ambiguity, duplicate-key ambiguity, mutable-reference downgrade, cross-run evidence mixing, nondeterminism, and unsafe error handling;
  • require a concrete counterexample for each suspected issue;
  • report only actionable correctness, security, determinism, or trust-contract findings;
  • for each finding include severity, affected guarantee, exact boundary, failure path, minimal regression test, and minimal remediation;
  • explicitly bind a no-findings result to the exact reviewed SHA.

This is a Claude-like skeptical review method, not a claim that Qodo runs a specific model.

Evidence output

Publish or update one canonical machine-readable status containing:

  • schema version;
  • repository and PR number;
  • exact head SHA;
  • CodeRabbit status and trusted comment ID;
  • Qodo request status and request comment ID;
  • request timestamp;
  • stale/superseded flag;
  • final Qodo review identity, SHA, and outcome when available.

Fail-closed behavior

  • spoofed/non-bot rate-limit comments: reject;
  • missing or short SHA: reject;
  • stale head: reject;
  • duplicate request for the same SHA: no-op;
  • Qodo unavailable: record PROVIDER_EVIDENCE_UNAVAILABLE, never approval;
  • workflow error: publish diagnostic evidence, never approval;
  • no merge or auto-merge authority.

Acceptance criteria

  • deterministic tests for trusted rate-limit, spoofed actor, stale head, duplicate delivery, concurrent delivery, superseded request, Qodo unavailable, and successful exact-head request;
  • least-privilege workflow permissions;
  • immutable action pins;
  • no pull_request_target execution of untrusted PR code;
  • exact-run/exact-attempt evidence;
  • no comment loops or duplicate Qodo reviews.

Related implementation context: PR #167.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions