Skip to content

Retry transient CI check reads within a bounded interruptible budget #731

Closed

Description

@JacobStephens2

From the Oct 11–16 2026 Run retrospective, finding 11. Tracking issue: #721.

The evidence below is historical and attributed to the supplied report (repository snapshot 5504c97); it has not all been independently reproduced. Limited current-checkout checks were made at 53bb9c6. This is filed for maintainer triage, not automatic Pickup.

Requested outcome and validation

Retry read-only CI check retrieval when a transient transport/API response failure occurs, using a small bounded attempt count and backoff (the report proposes three attempts; choose and document exact semantics). A temporary read failure must never be interpreted as green or an empty successful check set.

Keep the original error and retry evidence visible when the budget is exhausted. Cancellation must interrupt both reads and backoff. Permanent/authentication errors need clear handling rather than an uncontrolled retry loop. Use the existing CI seam for deterministic tests.

Validate a transient malformed/truncated JSON read followed by success, repeated failure to exhaustion, cancellation during retry, and unchanged behavior for genuine failing/pending checks. Recovery must not consume Repair slots or repeat external mutations.

The report's early CI-fix dispatch and checking Base movement during the watch are lower-confidence follow-up ideas; evaluate separately rather than making them prerequisites for this retry fix. This is distinct from temporary Harness service recovery in #584.

Current checkout check: CI code directly propagates errors from checks_on(sha)?. The reported #671 failure was unexpected end of JSON input after 18.8 minutes of waiting.

Original finding, including evidence, proposed fixes, and confidence

11. One failed CI read fails the whole Run (Factory)

Activity

  1. added
    bug
    needs-triage
    on Oct 17, 2026
  2. JacobStephens2 commented on Oct 17, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief

    Category: bug
    Summary: Recover from transient read-only CI check failures within a bounded, interruptible retry budget.

    Current behavior:
    The CI watcher propagates a failed checks_on() call immediately. The retro reports a Run failing after 18.8 minutes of waiting because a check read returned truncated JSON. Code inspection confirmed direct error propagation and no check-read retry; this triage did not independently reproduce the service failure.

    Desired behavior:
    Give a transiently failing check read at most three total attempts: the original read and up to two retries, with one-second then two-second interruptible delays. Transient cases include transport failures, HTTP 429 or server errors, and truncated response JSON. Known permanent authentication, authorization, configuration, and validation failures should fail without repeated requests. Preserve meaningful diagnostics for unsupported or unclassified errors rather than treating them as valid check data.

    Apply the same read policy to check observations used by the initial watch, pending-check polling, Base comparison, and Check re-run reconciliation. Each retry must read the same repository and full commit. Retrying reads never consumes a Repair slot or causes a workflow re-run request to be repeated. Preserve ADR 0010's Check re-run semantics and all existing checks against stale or disappearing results.

    Key interfaces:

    • CI Outside::checks_on() and the GitHub observation adapter: keep transient-read recovery testable through the existing seam.
    • The CI watch, rerun(), and Base-check comparison: consume successful fresh observations or a causal error.
    • Poll/Command interruption: cancel retry delays and prevent further reads after cancellation.
    • Error/progress reporting: retain the underlying failure and identify retry/exhaustion without interpreting log prose as CI facts.

    Acceptance criteria:

    • A transient check-read failure followed by a valid response continues the same watch and preserves the real pending, passing, or failing check state.
    • Repeated transient failure stops after exactly three total attempts, with the causal error and retry context reported.
    • A known permanent error is not retried, and cancellation during a read or delay starts no further request.
    • A read failure never establishes green or absent CI, including during the initial grace period and Check re-run reconciliation.
    • Check re-run attempt identity and required-check disappearance protections remain enforced after read recovery.
    • Read recovery neither starts Repairs nor repeats external mutations such as workflow re-run requests.
    • Deterministic tests cover success after failure, exhaustion, permanent failure, and cancellation using the existing observation/wait seam without real network calls or wall-clock backoff waits.

    Out of scope:

    • Harness service recovery (Recover from temporary Harness service failures within a bounded retry budget #584), retrying arbitrary GitHub operations, and a new user-facing retry configuration.
    • Early dispatch of CI-fix Repairs, new Base-movement polling, PR lifecycle changes, or changes to Check re-run eligibility and allowances.
    • Suppressing CI failures, dropping checks, or accepting stale/empty results after known failures.

    Source and historical evidence: #721, finding 11. The exact three-attempt budget and delays above settle the original body's retry-budget question for this implementation.

  3. added
    ready-for-agent
    in-progress
    and removed
    needs-triage
    ready-for-agent
    on Oct 17, 2026
  4. removed
    in-progress
    on Oct 17, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions