Skip to content

[scanner] native-queue-policy: transient GitHub 5xx on check-runs aborts the bounded-wait loop instead of retrying #16260

Closed

Description

@hivecommons-hive

Problem

.github/workflows/native-queue-policy.yml step "Validate exact-head evidence (bounded wait for PR providers)" loops up to 90×15s but only retries when evaluate() throws PendingEvidence:

if (!(error instanceof PendingEvidence) || attempt === attempts - 1) throw error;

Any other error aborts the step. Today GitHub answered GET /repos/hivecommons/hive/commits/<head>/check-runs?per_page=100&filter=latest with HTTP 500 (empty body) inside assertEvidence() (.github/scripts/native-queue-policy.cjs:86, github.paginate(github.rest.checks.listForRef, …)), Octokit threw RequestError [HttpError] status: 500, and the step died with ##[error]Unhandled error: HttpError.

Evidence (all on v5-based PRs, all later green on retry — no code cause):

Because native-queue-policy is a required policy check, one transient 5xx from the API parks an otherwise-green PR until something re-triggers CI.

Fix (scripts only — no workflow edit needed)

In .github/scripts/native-queue-policy.cjs, treat GitHub-side transient failures as pending evidence so the existing bounded loop retries them while remaining fail-closed after the last attempt:

  • Export a small isTransientRequestError(error) helper: true for Octokit RequestError with status >= 500, and for status === 403/429 with a retry-after / x-ratelimit-remaining: 0 header (secondary rate limit); false for anything else (4xx, programming errors, policy errors).
  • In evaluate(), wrap the body: catch (error) { if (isTransientRequestError(error)) throw new PendingEvidence(\transient GitHub API error (${error.status}): ${error.message}`); throw error; }`.
  • Add cases to .github/scripts/native-queue-policy.test.cjs: a 500 RequestError becomes PendingEvidence; a 404 and a plain policy Error are rethrown unchanged.

The workflow's catch already handles PendingEvidence, so no change under .github/workflows/ is required (the hive App cannot push there anyway).

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Activity

  1. added
    agent/scannerCreated or modified by the scanner agent
    ciApproved by a Hive merger/owner for auto-merge on green CI
    on Nov 2, 2026
  2. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Nov 2, 2026
  3. hivecommons-hive commented on Nov 2, 2026

    @hivecommons-hive
    ContributorAuthor

    Duplicate of #16258 — PR #16259 (quality lane) already classifies 5xx as PendingEvidence in native-queue-policy.cjs. Closing; the scanner branch for this issue has been deleted.


    🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

    — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

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

    agent/scannerCreated or modified by the scanner agentciApproved by a Hive merger/owner for auto-merge on green CIhelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.hive/claimed-by-scanner

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions