Skip to content

Forgejo provider clone selects HTTPS and fails on an SSH-only setup #37428

Open

Description

@mchataigner

Correction to the original report

Follow-up screenshots clarify the observed UI sequence: the user selected Forgejo / Gitea repository and entered owner/repo, not a full SSH URL, for this attempt. The original report conflated that observed failure with a separate explicit-URL preservation problem identified in source inspection and a local regression test. The reproduction below supersedes the original steps.

The user had also reported an earlier unsuccessful attempt with an SSH URL, but the exact entry point and input sequence for that earlier attempt have not been established. It should not be treated as an end-to-end reproduction of explicit-URL rewriting.

Before submitting

Area

apps/web — Add Project → Forgejo / Gitea repository

Steps to reproduce

Host and repository names below are placeholders.

  1. Have a self-hosted Forgejo repository accessible using SSH, with no usable noninteractive HTTPS Git credentials.
  2. Verify that ssh -T forgejo@forgejo.example, git ls-remote ssh://forgejo@forgejo.example/owner/repo.git, and git clone ssh://forgejo@forgejo.example/owner/repo.git succeed in a terminal. forgejo is this server's configured SSH username.
  3. In Add Project, select Forgejo / Gitea repository.
  4. Enter owner/repo and press Lookup.
  5. The destination/confirmation screen shows https://forgejo.example/owner/repo.git under Repository. There is no SSH/HTTPS selection shown.
  6. Choose Clone. The clone fails with the HTTPS authentication error below.

The screenshots establish a fresh provider lookup, rather than merely retrying an old failed clone.

Expected behavior / requested outcome

Be able to clone through the Forgejo provider flow using the server's working SSH access, with its actual SSH username and port. An explicit transport choice could preserve the existing HTTPS default while allowing SSH for this setup. Maintainers should decide whether this belongs in an Ideas discussion as a protocol-selection request, as with #20787.

Actual behavior

Repository lookup succeeds and the client selects the HTTPS clone URL. Git then fails because it cannot obtain HTTPS credentials noninteractively. Successful Forgejo lookup does not establish that Git can authenticate over HTTPS.

Impact

Cloning through the Forgejo provider flow is blocked on this setup. Terminal SSH cloning succeeds, so work is possible outside this flow.

Version or commit

Observed with Nix-packaged T3 Code 0.1.8. Source investigation used the source associated with that installed Nix derivation.

The same default URL-selection logic was also inspected on upstream main at 6b7027b1f43eebc4c7edf5304236a0775b2d8928; the UI sequence was not independently reproduced on that commit.

Environment

T3 server on NixOS/Linux, Node.js 26.13.1, self-hosted Forgejo. Failure observed in the web client UI. Browser version was not recorded.

Logs or stack traces

fatal: could not read Username for 'https://forgejo.example': terminal prompts disabled

Terminal SSH authentication, listing repository refs, and cloning all succeeded. No credentials or private host/repository names are included here.

Source investigation and patch limitation

getDefaultCloneUrl selects repository.url or repository.sshUrl according to the provider's defaultCloneTransport. Forgejo defaults to HTTPS. Both CommandPalette.tsx and AddProjectScreen.tsx use that helper after lookup. Mobile behavior is inferred from source, not verified on a device.

A separate local patch preserves explicitly pasted clone URLs through provider lookup. Its regression test failed before that patch and passed afterward; the nine focused tests, affected-package type checks, changed-file lint/format checks, and web build passed.

That patch does not fix the owner/repo sequence shown in the new screenshots, because it intentionally leaves the provider default unchanged for shorthand input. It has not been deployed and is not evidence that the observed flow is fixed.

Related issues

#20787 discusses the same default-transport / missing-choice problem for GitHub and was closed as a feature request. The observed Forgejo shorthand flow may warrant the same classification. #13350 discusses clone transport selection for GitLab.

Workaround

Clone in a terminal and open the existing folder; this worked. The requested outcome is to make the provider clone flow usable with SSH access rather than relying on that workaround.

Activity

  1. changed the title [-][Bug]: Forgejo clone flow replaces an explicitly pasted SSH URL with HTTPS[/-] [+]Forgejo provider clone selects HTTPS and fails on an SSH-only setup[/+] on Nov 16, 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions