Skip to content

fix(pr-pipeline): log status, rate-limit headers and body on any non-2xx GitHub call in pr-verify, pr-refine and pr-feedback-dispatch #8062

Description

@kyle-sexton

No related issue: found by the monitoring session.

Summary

At 05:57Z on 2026-10-18, three workflows' GITHUB_TOKEN calls got HTTP 403 within the same minute. None logs why, so the limit that was hit can't be named.

The lanes broker's App token was healthy over the same window: 64 allows and 3 workflow-modified denies in AppTraces. The likely cause is the repository's GITHUB_TOKEN budget running out. GitHub limits it to "1,000 requests per hour per repository", shared by every workflow in the repository (https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api). That cause is unverified until the response is logged.

Fix

On any non-2xx GitHub API response in pr-verify, pr-refine and pr-feedback-dispatch, log:

  • the HTTP status;
  • the x-ratelimit-remaining, x-ratelimit-reset and x-ratelimit-resource headers, plus retry-after when present;
  • the first 200 characters of the response body.

Keep it in the existing error annotation or a ::notice, with no new API calls. GitHub's best-practices page explains how to read these headers on a rate-limit response (https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api).

Verification

  • A forced 403, for example a call with a bad token in a test, shows the status, all four header values and the body prefix in the run's annotation.
  • The next real 403 names its limit, either x-ratelimit-resource: core with remaining 0, or a secondary-limit body.

Related

#7954, #8032, #8029. The pr-merge verdict-artifact listing on github.token is the suspected main consumer; poteto is measuring it.

🤖 Generated with Claude Code

Activity

  1. added
    needs-triage
    on Oct 18, 2026
  2. github-actions commented on Oct 18, 2026

    @github-actions
    Contributor

    Proposed work class: work-class: scoped
    Basis: automated intake triage; the lanes App applied this class.

    Size: Medium
    Complexity: Low
    Uncertainty: Known
    Flags: none
    Blocked by: none

    You asked for non-2xx GitHub responses in pr-verify, pr-refine and pr-feedback-dispatch to log the status, rate-limit headers and a body prefix. The recorded decision below narrows that to the non-rate-limit errors that still log only a message. It settles the open questions, so nothing more is needed from you.

    Decision recorded.

    Part of this is done at origin/main: the three scripts call GitHub through createGitHub or budgetedFetch (resolve-pr.mjs:801, feedback-dispatch.mjs:137, report-check-run.mjs:131), which share the rate guard that logs the method, URL, pool, status and reset on a rate-limited 403 or 429 (.github/actions/log-api-budget/rate-guard.mjs:1-4, :451-475). Any other non-2xx still logs only the message (resolve-pr.mjs:877, feedback-dispatch.mjs:1231, report-check-run.mjs:138-140), so the rest of the body's fix remains, and the body's second verification line, which waits for a real 403, is not a criterion here. Agents decided this on evidence under standing direction §1.

    Done when

    • On a non-2xx GitHub response that the rate guard does not treat as a rate limit, the error annotations at .github/scripts/pr-verify/resolve-pr.mjs:877, .github/scripts/pr-unblock/feedback-dispatch.mjs:1231 and .github/actions/report-check-run/report-check-run.mjs:140 carry the HTTP status, the x-ratelimit-remaining, x-ratelimit-reset and x-ratelimit-resource headers, retry-after when present, and the first 200 characters of the response body, with no new API call.
    • A test for each of the three scripts forces a 403 (for example a bad-token fixture) and asserts the status, the four header values and the body prefix in the annotation.

    #8062 (comment)

    Automated triage, applied by the lanes App.

  3. added
    needs-human
    and removed
    needs-triage
    on Oct 18, 2026
  4. added
    status: confirmed
    and removed
    needs-human
    on Oct 19, 2026
  5. kyle-sexton commented on Oct 31, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded.

    Part of this is done at origin/main: the three scripts call GitHub through createGitHub or budgetedFetch (resolve-pr.mjs:801, feedback-dispatch.mjs:137, report-check-run.mjs:131), which share the rate guard that logs the method, URL, pool, status and reset on a rate-limited 403 or 429 (.github/actions/log-api-budget/rate-guard.mjs:1-4, :451-475). Any other non-2xx still logs only the message (resolve-pr.mjs:877, feedback-dispatch.mjs:1231, report-check-run.mjs:138-140), so the rest of the body's fix remains, and the body's second verification line, which waits for a real 403, is not a criterion here. Agents decided this on evidence under standing direction §1.

    Done when

    • On a non-2xx GitHub response that the rate guard does not treat as a rate limit, the error annotations at .github/scripts/pr-verify/resolve-pr.mjs:877, .github/scripts/pr-unblock/feedback-dispatch.mjs:1231 and .github/actions/report-check-run/report-check-run.mjs:140 carry the HTTP status, the x-ratelimit-remaining, x-ratelimit-reset and x-ratelimit-resource headers, retry-after when present, and the first 200 characters of the response body, with no new API call.
    • A test for each of the three scripts forces a 403 (for example a bad-token fixture) and asserts the status, the four header values and the body prefix in the annotation.
  6. removed
    status: confirmed
    on Oct 31, 2026
  7. added
    status: ready
    admission-deferred
    agent-ready
    and removed
    admission-deferred
    on Oct 31, 2026
  8. github-actions commented on Oct 31, 2026

    @github-actions
    Contributor
    No description provided.
  9. melodic-automation-lanes commented on Oct 31, 2026

    @melodic-automation-lanes
    Contributor

    Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.

    Intended outcome: A non-2xx GitHub response that the rate guard does not treat as a rate limit makes the error annotations in resolve-pr, feedback-dispatch and report-check-run carry the status, rate-limit headers, retry-after when present and a 200-character body prefix, with a test for each script.

    Acceptance criteria

    • The error annotation at .github/scripts/pr-verify/resolve-pr.mjs:877 carries the HTTP status, x-ratelimit-remaining, x-ratelimit-reset, x-ratelimit-resource, retry-after when present, and the first 200 characters of the response body.
    • The error annotation at .github/scripts/pr-unblock/feedback-dispatch.mjs:1231 carries the same fields.
    • The error annotation at .github/actions/report-check-run/report-check-run.mjs:140 carries the same fields.
    • The details come from the response already received (for example captured on GitHubError at .github/actions/check-trusted-trigger/check-trusted-trigger.mjs:84-90 and :252); no new API call is added.
    • A header that is absent is shown as absent or omitted without throwing, and retry-after appears only when the response has it.
    • The body prefix is cut at 200 characters and the annotation stays one line, with newlines in the body neutralized so the body cannot inject a workflow command.
    • The token value never appears in the annotation.
    • The rate guard's existing log for a rate-limited 403 or 429 (.github/actions/log-api-budget/rate-guard.mjs:451-475) is unchanged.
    • A test for resolve-pr forces a 403 (for example a bad-token fixture) and asserts the status, the four header values and the body prefix in the annotation.
    • A test for feedback-dispatch forces a 403 and asserts the status, the four header values and the body prefix in the annotation.
    • A test for report-check-run forces a 403 and asserts the status, the four header values and the body prefix in the annotation.
    • The repository's existing test suite for these scripts still passes.

    External state: none

    Related work

    Sources read

    • /home/runner/work/claude-code-plugins/claude-code-plugins/refine-data/context.json: the owner's Decision recorded comment narrows the issue to non-rate-limit non-2xx responses and drops the wait-for-a-real-403 check.
    • .github/scripts/pr-verify/resolve-pr.mjs:877: the error annotation prints only error.message.
    • .github/scripts/pr-verify/resolve-pr.mjs:801: calls GitHub through createGitHub.
    • .github/actions/report-check-run/report-check-run.mjs:138-140: the annotation prints only the GitHubError message or the error name.
    • .github/scripts/pr-unblock/feedback-dispatch.mjs:1231: the annotation prints only error.message and the cause code.
    • .github/actions/check-trusted-trigger/check-trusted-trigger.mjs:84-90: GitHubError holds only status and message, with no headers or body.
    • .github/actions/check-trusted-trigger/check-trusted-trigger.mjs:252: createGitHub throws GitHubError(response.status, method and path) on a non-2xx response.

    Automated refinement by the lanes App. Admission counts only criteria a listed human wrote: to confirm these, post them as your own comment whose first line is **Decision recorded.**, which sends the issue back through intake.

  10. github-actions commented on Oct 31, 2026

    @github-actions
    Contributor
    No description provided.
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-readystatus: ready

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions