Skip to content

Pre-flight GitHub check fails on EOF under OpenShell 0.1.x (not retried) #7862

Closed

Description

@waynesun09

Problem

Since the move to OpenShell 0.1.2 (#7233), e2e fails intermittently in TestAdminInstallUninstall at the triage run's pre-flight check:

• Checking GitHub API connectivity from sandbox
✗ GitHub API unreachable from sandbox
Error: pre-flight connectivity check: GitHub API connectivity check failed (exit 1):
... Get "https://api.github.com/rate_limit": EOF

Sandbox creation and bootstrap succeed just before it. Seen at least three times on 2026-09-30, one of which removed a PR from the merge queue:

  • merge-queue run 36702113213
  • run 36703682265
  • run 36706250060

The same failure also hit the #7847 run on 2026-09-29.

What the logs show

The sandbox log (collected under output/fs-tri-*/logs/openshell-sandbox.log) of the failing run has no event for api.github.com. In passing runs of the same check, the sandbox logs three lines at that moment:

CONFIG:PUBLISHED Policy DNS mapped api.github.com resolved=140.82.x.x synthetic=198.18.0.2 ports=443
NET:OPEN ALLOWED /usr/bin/gh(0) -> api.github.com:443 [policy:_provider_github_ro engine:opa]
HTTP:GET ALLOWED GET http://api.github.com:443/rate_limit [policy:_provider_github_ro engine:l7]

In the failing run none of them appear, not even the Policy DNS mapping, and the gateway log has no warnings or errors. The connection is dropped before OpenShell 0.1's policy DNS maps the host, so gh sees EOF. That matches upstream ai-openshell/openshell#3577: a request to a hostname that is not (yet) in the policy DNS map terminates the connection instead of getting a clean denial. OpenShell 0.0.116 had no policy DNS layer, so this is new with the migration.

Why it isn't retried

internal/cli/preflight_github.go retries the check twice (after 2 s and 5 s), but isRetryablePreflightGitHubFailure only treats HTTP 403, connection refused and timed out as retryable. EOF falls through to non-retryable, so the run fails on the first attempt; the failing log has no attempt 1/3 … retrying line.

Proposed fix

  • Treat a connection-level EOF and connection reset by peer as retryable in isRetryablePreflightGitHubFailure, and give them a retry reason in preflightGitHubRetryReason. A fresh attempt re-resolves through the policy DNS, and the existing 2 s / 5 s delays should cover a transient miss.
  • Add unit tests: the observed output (Get "https://api.github.com/rate_limit": EOF) retries, connection reset by peer retries, and 401/404 still do not.

This mitigates the transient case only. If the policy DNS mapping never succeeds, the check still fails after three attempts with the same diagnostic, which is the right outcome.

Activity

  1. fullsend-ai-triage commented on Sep 30, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 11:32 AM UTC · Completed 11:35 AM UTC

    Commit: ec88ac7 · View workflow run →

    Runtime: claude · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $0.33

  2. added
    type/bug
    component/sandbox
    priority/medium
    ready-to-code
    on Sep 30, 2026
  3. fullsend-ai-triage commented on Sep 30, 2026

    @fullsend-ai-triage

    This report is exceptionally well diagnosed. Fetching internal/cli/preflight_github.go from main confirms the described gap: isRetryablePreflightGitHubFailure currently checks only for 403/Forbidden, connection-refused, and timeout substrings, with no case for a bare EOF or connection-reset-by-peer, so the failure mode described here does fall through to the non-retryable path exactly as hypothesized.

    A search of open issues and PRs for preflight-related and EOF/connection-reset keywords found no duplicate report and no in-flight PR already addressing this — #6855 (which added the original retry scaffold this issue extends) and the referenced OpenShell 0.1 migration work (#7233, #7847) are both already merged, so there's nothing blocking a fix from starting now.

    Given the proposed fix is scoped to a pure function with existing unit-test infrastructure (fake sleep/exec hooks), this should be a small, low-risk, well-contained change.


    Labels: Matches the established labeling pattern for this exact check (see #6855, #6853, #4016): a confirmed defect in the OpenShell sandbox pre-flight connectivity path.


    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
  4. fullsend-ai-coder commented on Sep 30, 2026

    @fullsend-ai-coder
    Contributor

    🤖 Finished Code · ❌ Failure (pre-flight connectivity check: GitHub API connectivity check failed (exit 1): Get "https://api.github.com/rate_limit": EOF) · Started 11:37 AM UTC · Completed 11:38 AM UTC

    Commit: ec88ac7 · View workflow run →

    Runtime: pi · Model: xai/grok-4.6 · Effort: high

  5. waynesun09 commented on Sep 30, 2026

    @waynesun09
    MemberAuthor

    /fs-code

    Do not add a Signed-off-by trailer to commits (no git commit -s); agent commits are DCO-exempt and the post-code guard rejects the trailer.

    The previous code run (36709501273) failed at this exact pre-flight check (Get "https://api.github.com/rate_limit": EOF), so this bug also hits production agent runs, not only e2e. Retrying.

    Scope, per the issue:

    1. In internal/cli/preflight_github.go, make isRetryablePreflightGitHubFailure treat a connection-level EOF (for example Get "https://api.github.com/rate_limit": EOF) and connection reset by peer as retryable. Give them a matching reason in preflightGitHubRetryReason. Keep 401/404 and other auth/config failures non-retryable.
    2. Add unit tests in internal/cli/preflight_github_test.go: the exact observed EOF output retries, connection reset by peer retries, and 401 and 404 still don't retry.
    3. No other behaviour changes; keep the existing 2 s / 5 s retry delays.
  6. fullsend-ai-coder commented on Sep 30, 2026

    @fullsend-ai-coder
    Contributor

    🤖 Finished Code · ✅ Success · Started 11:41 AM UTC · Completed 11:53 AM UTC

    Commit: ec88ac7 · View workflow run →

    Runtime: pi · Model: xai/grok-4.6 · Effort: high · Cost: $3.27

  7. added 3 commits that reference this issue on Sep 30, 2026
  8. added a commit that references this issue on Sep 30, 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

    bugcomponent/sandboxpriority/mediumready-to-codetype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions