Skip to content

fix(source-control): retry GitHub HTTPS clones over SSH when HTTPS auth fails - #47239

Merged
t3dotgg merged 1 commit into
mainfrom
t3/fix-issue-47159
Dec 2, 2026
Merged

t3dotgg merged 1 commit into
mainfrom
t3/fix-issue-47159

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Dec 2, 2026

Copy link
Copy Markdown
Member

Cloning a private GitHub repository over HTTPS fails on machines whose Git access is set up for SSH (e.g. gh logged in with git_protocol: ssh and no HTTPS Git credential helper), even though repository lookup already succeeded. Fixes #47159.

Mirroring the existing SSH-to-HTTPS clone fallback (#23170), GitHub HTTPS clones now retry once over SSH when Git rejects HTTPS authentication, leaving origin on SSH so subsequent fetches and pushes keep working. Explicit protocol: "https" requests, credential-bearing URLs, plain HTTP URLs, non-auth errors, and non-GitHub hosts keep their current behavior. When both HTTPS and SSH fail, the error reports both failures along with setup guidance (gh auth setup-git or adding an SSH key).

Proof: vp run check:changed passes (40/40 tests in SourceControlRepositoryService.test.ts, with the two new retry tests failing before the fix and passing after); verified end-to-end with real Git hitting GitHub HTTPS 401 -> automatic SSH clone + post-clone git fetch, and inside a controlling PTY with an unverified host key confirming the SSH retry exits cleanly instead of hanging.

Reviewed with sol-loop: 4 passes with GPT-6.2 Sol. Sol verdict: approved

Created with Gemini 4 Neon in Antigravity.

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Dec 2, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — Eligible GitHub HTTPS clone failures now automatically retry over SSH using the server's available SSH authentication. This changes default clone behavior and requires confirmation that the automatic protocol fallback is intended.

You can add or adjust custom eligibility rules. Learn more.

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 21.5 KiB 21.5 KiB 0 B (0.0%) 24.4 KiB ✅
Codex Live turn messages 1 1 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.9 KiB 21.9 KiB 0 B (0.0%) 24.4 KiB ✅
Claude Live turn messages 1 1 0 (0.0%) 8 ✅

Other scenarios

All 64 scenario measurements match main.

All 64 scenario measurements
Provider Scenario Metric Main baseline This PR Impact PR ceiling
Codex short turn resume WebSocket decoded 10.5 KiB 10.5 KiB 0 B (0.0%) 12.7 KiB ✅
Codex short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn running, cold open HTTP decoded 281.7 KiB 281.7 KiB 0 B (0.0%) 302.7 KiB ✅
Codex long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Codex long turn running, history page HTTP decoded 92.5 KiB 92.5 KiB 0 B (0.0%) 107.4 KiB ✅
Codex long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Codex long turn finished, cold open HTTP decoded 381.5 KiB 381.5 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, socket cold open WebSocket decoded 381.6 KiB 381.6 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, work page HTTP decoded 78.3 KiB 78.3 KiB 0 B (0.0%) 200.2 KiB ✅
Codex long turn finished, work page rows 75 75 0 (0.0%) 150 ✅
Codex idle thread resume WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell snapshot HTTP decoded 42.4 KiB 42.4 KiB 0 B (0.0%) 53.7 KiB ✅
Codex fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Codex fleet shell subscribe WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Codex fleet shell resume check rows 0 0 0 0 ✅
Codex stale shell reload HTTP decoded 42.4 KiB 42.4 KiB 0 B (0.0%) 53.7 KiB ✅
Codex stale shell reload rows 27 27 0 (0.0%) 27 ✅
Codex stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Codex stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex stale todo list cold open HTTP decoded 72.4 KiB 72.4 KiB 0 B (0.0%) 83.0 KiB ✅
Codex stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Codex stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅
Claude short turn resume WebSocket decoded 10.6 KiB 10.6 KiB 0 B (0.0%) 12.7 KiB ✅
Claude short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn running, cold open HTTP decoded 283.3 KiB 283.3 KiB 0 B (0.0%) 302.7 KiB ✅
Claude long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Claude long turn running, history page HTTP decoded 93.4 KiB 93.4 KiB 0 B (0.0%) 107.4 KiB ✅
Claude long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Claude long turn finished, cold open HTTP decoded 384.2 KiB 384.2 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, socket cold open WebSocket decoded 384.3 KiB 384.3 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, work page HTTP decoded 79.2 KiB 79.2 KiB 0 B (0.0%) 200.2 KiB ✅
Claude long turn finished, work page rows 75 75 0 (0.0%) 150 ✅
Claude idle thread resume WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell snapshot HTTP decoded 43.0 KiB 43.0 KiB 0 B (0.0%) 53.7 KiB ✅
Claude fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Claude fleet shell subscribe WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Claude fleet shell resume check rows 0 0 0 0 ✅
Claude stale shell reload HTTP decoded 43.0 KiB 43.0 KiB 0 B (0.0%) 53.7 KiB ✅
Claude stale shell reload rows 27 27 0 (0.0%) 27 ✅
Claude stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Claude stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude stale todo list cold open HTTP decoded 73.4 KiB 73.4 KiB 0 B (0.0%) 83.0 KiB ✅
Claude stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Claude stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅

Baseline: 902d26d · PR result: ed95aeb · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The clone service now retries eligible SSH failures over HTTPS and GitHub HTTPS authentication failures over SSH. It restricts retries based on the requested protocol, URL, host, and failure reason. Failed retries return details from both attempts and, for SSH retries, GitHub authentication guidance.

Changes: Clone protocol fallback

Layer / File(s) Summary
Fallback eligibility and error details
apps/server/src/sourceControl/SourceControlRepositoryService.ts
The service selects HTTPS fallback for eligible SSH failures and SSH fallback for eligible GitHub HTTPS authentication failures. It excludes explicit protocol requests and unsupported URL cases. Failed retries include details from both attempts, with GitHub authentication guidance for SSH retries.
Retry execution and validation
apps/server/src/sourceControl/SourceControlRepositoryService.ts, apps/server/src/sourceControl/SourceControlRepositoryService.test.ts, docs/user/source-control.md
Clone execution accepts an environment override. SSH retries disable GUI askpass prompts. Tests cover retry success, combined failures, and cases that do not retry. The clone instructions describe both fallback directions.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant SourceControlRepositoryService
  participant Git
  Caller->>SourceControlRepositoryService: cloneRepository(remoteUrl)
  SourceControlRepositoryService->>Git: runClone(primary URL)
  Git-->>SourceControlRepositoryService: primary failure
  SourceControlRepositoryService->>Git: runClone(fallback URL and environment)
  Git-->>SourceControlRepositoryService: retry result
  SourceControlRepositoryService-->>Caller: redacted URL or combined error
Loading

Possibly related issues

Possibly related PRs

  • pingdotgg/t3code#46696: Both changes affect error composition for authentication failures during clone retries.
  • pingdotgg/t3code#31693: Both changes affect credential guidance in clone errors, including combined SSH and HTTPS failures.

Suggested reviewers: macroscopeapp, saphid, juliusmarminge

Merge Risk: Minimal · up to ed95a

Cloning a private GitHub repository over HTTPS now retries once over SSH when authentication fails, and failures report both attempts with setup guidance. Explicit HTTPS requests, URLs with credentials, plain HTTP and non-GitHub hosts keep their existing behavior. No actionable merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(source-control): retry GitHub HTTPS clones over SSH when HTTPS auth fails" matches the main change. The changeset adds an HTTPS-to-SSH clone fallback for GitHub authentication failures …
Description check Passed The description covers the problem (private GitHub HTTPS clones fail on SSH-configured machines), the change (one SSH retry after HTTPS auth failure, with the listed exclusions and combined error repo…
Linked Issues check Passed Issue #47159 is closed. The linked-issue context marks it as historical context only, not a requirement for this pull request. No active directly linked issue remains, so no linked-issue coding requir…
Out of Scope Changes check Passed With no active linked-issue requirements, the scope reference is the current PR description. Based on the whole-PR summary (merge base 902d26d to head ed95aeb), the changes implement that stated int…
Full details: Title check

Explanation

The title "fix(source-control): retry GitHub HTTPS clones over SSH when HTTPS auth fails" matches the main change. The changeset adds an HTTPS-to-SSH clone fallback for GitHub authentication failures in SourceControlRepositoryService, with tests and a docs update. It is a conventional commit title and is specific enough for a reviewer scanning history. It is slightly long at 77 characters.

Full details: Description check

Explanation

The description covers the problem (private GitHub HTTPS clones fail on SSH-configured machines), the change (one SSH retry after HTTPS auth failure, with the listed exclusions and combined error reporting), a scope reference (fixes #47159, and it cites the prior SSH-to-HTTPS fallback #23170), and verification (focused test results, end-to-end checks, and a PTY check). It follows the template sections in order. The Verification section gives observed results, not just 'tests pass'. The template asks for a conventional commit title, which the PR meets. The Scope section does not say whether a maintainer requested the PR. The description also ends with a model/harness line, which the template requests when an agent was used.

Full details: Linked Issues check

Explanation

Issue #47159 is closed. The linked-issue context marks it as historical context only, not a requirement for this pull request. No active directly linked issue remains, so no linked-issue coding requirements apply. The PR objectives describe the SSH-retry approach that the issue proposed as one option. That option is not a separate requirement. The assessment does not treat the issue's other proposed approaches as objectives.

Full details: Out of Scope Changes check

Explanation

With no active linked-issue requirements, the scope reference is the current PR description. Based on the whole-PR summary (merge base 902d26d to head ed95aeb), the changes implement that stated intent: (1) SourceControlRepositoryService.ts adds a one-time GitHub HTTPS-to-SSH retry for authentication failures, disables GUI askpass for the SSH retry, adds an environment override for clone execution, returns the redacted URL used on retry, and reports combined failure details with setup guidance; (2) SourceControlRepositoryService.test.ts adds tests for the retry, the combined error, and the non-triggering cases (explicit HTTPS, embedded credentials, plain HTTP, non-auth errors, non-GitHub hosts); (3) docs/user/source-control.md documents the new fallback direction. All changes connect to the clone fallback. No unrelated change appears in the summary. This assessment relies on the summary and did not read the source diff, so it does not verify the exact code paths.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 902d26d and ed95aeb.

Files selected for processing: 3

  • apps/server/src/sourceControl/SourceControlRepositoryService.test.ts
  • apps/server/src/sourceControl/SourceControlRepositoryService.ts
  • docs/user/source-control.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@t3dotgg
t3dotgg merged commit 76c8661 into main Dec 2, 2026
37 checks passed
@t3dotgg
t3dotgg deleted the t3/fix-issue-47159 branch December 2, 2026 05:04
imetn added a commit to imetn/t4code that referenced this pull request Dec 2, 2026
…ingdotgg#45341

Ported prerequisite pingdotgg#45341 (open-popups) and 27 of 28 upstream commits
from b4b58d2..7538a0f, preserving all locked T4 customizations,
zero telemetry, and T4 branding:
- Bounded command projection reads (pingdotgg#47115)
- Move threads between projects & recover missing workspace folders (pingdotgg#47234)
- Mention menu highlight update (pingdotgg#47210, enabling files mention in test for T4 Lock pingdotgg#18)
- Mobile image-chip-without-text send (pingdotgg#47173)
- Antigravity Argon pricing (pingdotgg#47202), OpenCode 64-char MCP tool names (pingdotgg#43800)
- GitHub HTTPS->SSH clone fallback (pingdotgg#47239), open popup coordination (pingdotgg#47167)
- Plus 19 additional upstream fixes across server, web, mobile, and providers
- Auto-synced all 30 GT v12 i18n catalogs via sync:t4-i18n (0 untranslated)
- Deferred pingdotgg#47163 (depends on unported workflow-subjects) in .t4-upstream-sync.json
imetn added a commit to imetn/t4code that referenced this pull request Dec 2, 2026
- M1: match inflected T3 brand forms (e.g. Swedish genitive 'T3 Codes') in
  scripts/sync-t4-i18n.ts and scripts/check-t4-branding.ts (+ tests), and
  restore 'T4 Codes' in sv.json (web + desktop).
- M2: check v11SimpleCarryIndex before upstream direct using three-way
  divergence rules in scripts/sync-t4-i18n.ts (+ tests), and restore all 19
  T4-curated zh translations (incl. {action}(回车), {host}令牌, {provider}令牌,
  and 子智能体正在运行) plus curated web de/sv variable overrides.
- m1: add GitHub HTTPS -> SSH fallback sentence to docs/user/source-control.md (pingdotgg#47239).
- m2: port pingdotgg#47034 (cf475c4) command palette popup trigger focus return + browser test.
- N3: port apps/web/src/i18n/runtime.test.ts covering browser languagechange.
- N1: update .t4-upstream-sync.json history count (30 PRs) and notes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub clone of a private repo fails over HTTPS although the repo lookup already authenticated with gh

1 participant