Skip to content

fix(github): retry a short connect failure on the intake issue listing #5805

Closed

Description

@devops-cli-service

Split from #4753.

devops roadmap intake stopped after 3 min 10 s on 2026-11-11 because the issue listing read raised ConnectTimeout, and the same command worked a few minutes later (reply on #4753). The GitHub session is the one path where a connect failure is not retried.

Why deferred: ADR 0006 records that the session does not retry a refused connect, a connect or read timeout, and openspec/specs/github-session-retry and openspec/specs/github-session-timeouts state the same. A retry of the listing changes those records, so it needs a person's decision on the ADR and a change of its own.

Acceptance criteria:

  • The GitHub session SHALL send a GET again after httpx2.ConnectError or httpx2.ConnectTimeout, with jittered backoff, at most DEFAULT_GH_MAX_RETRIES more times, after the same ledger wait.
    • WHEN the first listing request raises httpx2.ConnectTimeout and the second answers page 1
    • THEN intake reads the items, the session records two attempts, and the run writes no connect error.
  • The GitHub session MUST NOT send a write again after a connect failure.
    • WHEN a POST fails with httpx2.ConnectTimeout
    • THEN the session raises GitHubUnreadError and sends one request.
  • ADR 0006 and the two specs SHALL state the new rule.

Proposed design

Problem statement

On 2026-11-11, devops roadmap intake stopped after 3 min 10 s because the issue listing raised ConnectTimeout. The same command worked a few minutes later. The GitHub session retries a lost connection but not a connect failure. This change resends a GET after httpx2.ConnectError or httpx2.ConnectTimeout, and it never resends a write.

Acceptance criteria

Requirement: A GET is resent after a connect failure

The GitHub session SHALL send a GET again after httpx2.ConnectError or httpx2.ConnectTimeout, with jittered backoff, at most DEFAULT_GH_MAX_RETRIES more times for each gidgethub attempt, after the same ledger wait.

Scenario: A connect timeout on the first listing request

  • WHEN The first listing request raises httpx2.ConnectTimeout and the second answers page 1.
  • THEN Intake reads the items, the session records two attempts, and the run writes no connect error.

Requirement: The connect resends stop at the retry bound

The GitHub session SHALL stop after DEFAULT_GH_MAX_RETRIES resends when each attempt of a GET raises httpx2.ConnectTimeout.

Scenario: A connect timeout on every attempt of a GET

  • WHEN Each attempt of a GET raises httpx2.ConnectTimeout.
  • THEN The session sends one request and DEFAULT_GH_MAX_RETRIES resends for each attempt, and it raises GitHubUnreadError.

Requirement: A write is not resent after a connect failure

The GitHub session MUST NOT send a write again after a connect failure.

Scenario: A connect timeout on a POST

  • WHEN A POST fails with httpx2.ConnectTimeout.
  • THEN The session sends one request and raises GitHubUnreadError.

Requirement: The records state the new rule

The change SHALL state the new rule in ADR 0006 and in a spec delta for github-session-retry and github-session-timeouts.

Scenario: A reader opens the change folder and the ADR

  • WHEN A reader opens ADR 0006 and the spec deltas of the change folder.
  • THEN ADR 0006 has a dated Status History entry, and both spec deltas hold a requirement that names httpx2.ConnectError and httpx2.ConnectTimeout for a GET and no resend for a write.

Existing Tool Considered

No alternatives check has run. No open tool covers the need. The HTTP client that ADR 0006 names, httpx2, has a transport-level retries option, but it resends on a connect error without reading the method, so it would resend a POST too, and it cannot use DEFAULT_GH_MAX_RETRIES or the ledger wait. The change therefore extends the retry branch that SessionGitHubAPI._request already has: about 15k tokens to build, about 5k tokens a year to keep and fix, and under one hour elapsed.

Key questions

  • Which transport errors does the GitHub session retry today, and which does it not?: The session resends a GET after httpx2.RemoteProtocolError, httpx2.ReadError and httpx2.WriteError. It does not retry a refused connect, a connect timeout, a read timeout or a refused origin. [sources: docs/adr/0006-github-session-requests-go-through-gidgethub.md:17, src/devops_cli/github/session_transport.py]
  • What is the connect bound of the GitHub session, and why is it 10 s?: The session connects within DEFAULT_GH_SESSION_CONNECT_TIMEOUT_SECONDS (10 s) and reads within DEFAULT_GH_SESSION_READ_TIMEOUT_SECONDS (60 s). The ADR records that a default 1 s connect bound failed live reads with ConnectTimeout on 2026-10-19, because a lost SYN is resent after 1, 2 and 4 s. [sources: docs/adr/0006-github-session-requests-go-through-gidgethub.md:13]
  • Where does the connect retry live?: In the branch of SessionGitHubAPI._request that already resends a GET after a lost connection, in src/devops_cli/github/session_transport.py. (best practice) [sources: src/devops_cli/github/session_transport.py, docs/adr/0006-github-session-requests-go-through-gidgethub.md:17, openspec/changes/archive/2026-11-05-3506-retry-get-on-lost-connection/design.md]
    • Chosen: The session's _request retry branch. It holds the ledger wait, the jittered backoff and the per-attempt budget, so a connect failure joins one path that every caller uses.
    • Rejected: The httpx2 transport's retries option. It resends every method, so it would resend a POST, and it cannot use the ledger wait or DEFAULT_GH_MAX_RETRIES.
    • Rejected: A retry in the intake store. Each caller would repeat it, and the listing is only one of the reads that fail on a connect.
  • Does the change resend a write after a connect failure?: No. A connect failure on a POST sends one request and raises GitHubUnreadError, because a ConnectTimeout cannot tell whether the request reached GitHub, and a resend could file a comment or an issue twice. (best practice) [sources: docs/adr/0006-github-session-requests-go-through-gidgethub.md:17, src/devops_cli/exceptions/git.py:154]
    • Chosen: Retry a GET only. A read has no side effect, so a resend is safe, and a write stays unretried as ADR 0006 states.
    • Rejected: Retry every method. A connect timeout on a POST leaves the outcome unknown, and a resend can apply the write twice.
  • How many resends does one GET make, and what waits between them?: At most DEFAULT_GH_MAX_RETRIES more times for each gidgethub attempt, after the same jittered backoff and ledger wait as the lost-connection resend. One GET therefore still sends at most nine requests. (best practice) [sources: docs/adr/0006-github-session-requests-go-through-gidgethub.md:17, src/devops_cli/config/defaults.py:796, openspec/changes/archive/2026-11-05-3506-retry-get-on-lost-connection/design.md]
    • Chosen: The same budget for each attempt. It keeps the nine-request bound of ADR 0006 and needs no state across gidgethub's attempts.
    • Rejected: One budget shared across attempts. gidgethub does not pass that state to _request, so the branch cannot count the resends of an earlier attempt.
  • How do ADR 0006 and the two specs record the new rule?: The change adds a dated Status History entry to ADR 0006 and writes a spec delta for github-session-retry and github-session-timeouts. openspec archive writes the specs from those deltas. (best practice) [sources: CONTEXT.md, docs/adr/0006-github-session-requests-go-through-gidgethub.md, openspec/changes/archive/2026-11-05-3506-retry-get-on-lost-connection/specs/github-session-retry/spec.md]
    • Chosen: Amend ADR 0006 in place with a Status History entry. ADR 0001, 0002 and 0003 amend in place with a dated Status History entry, and the rule is one clause of an accepted ADR.
    • Rejected: A new ADR that supersedes ADR 0006. It would supersede the whole session design for one clause, and a person would then re-read rules that do not change.
    • Rejected: Leave ADR 0006 and the specs as they are. The specs would state that a connect failure is not retried while the code retries it.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/github
    status/new
    value/medium
    effort/medium
    on Nov 15, 2026
  2. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    ContributorAuthor
    • Priority: P1-High. A short connect failure stops an intake run and the user must run the command again.
    • Related: fix(ai): a short connect failure to the gateway stops intake #4753, which asks for a different change. The candidate is split from #4753; both report a short connect failure that stops intake, but #4753 covers the AI gateway path and this item covers the GitHub listing.
  3. added
    priority/p1-high
    on Nov 15, 2026
  4. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    ContributorAuthor

    Waiting for the alternatives check to run. The next refine round looks at the item again after the check records a verdict.

  5. added
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 15, 2026
  6. removed
    status/in-review
    on Nov 15, 2026
  7. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    ContributorAuthor

    Live since 2026-11-15 13:55 UTC

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

    effort/mediumpriority/p1-highscope/githubsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions