Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- Sign
glabin to a self-hosted GitLab only (e.g.glab auth login --hostname git.example.com). Leave glab's default host unchanged, soglab config get hoststill printsgitlab.com. - In T3 Code, start a new project from a repository, choose GitLab and enter a bare project path that exists on the self-hosted instance, e.g.
group/project. - Submit the lookup.
Expected behavior
T3 Code finds the project on the self-hosted GitLab that glab is signed in to and shows its clone URLs, as it does when glab's default host is set to that instance.
Actual behavior
The lookup fails with:
Source control repository operation lookupRepository failed for gitlab: The source control operation could not be completed.
The server runs glab api projects/group%2Fproject from the user's home directory. That directory isn't a git repo, so glab has no remote to read a host from and falls back to its default host, gitlab.com. The project isn't there, so the call returns 404.
GitLabCli.getRepositoryCloneUrls builds the args as ["api", "projects/<encoded path>"] with no --hostname. Other GitLab calls already pass a host: readLinkSubject uses ["api", "--hostname", input.url.host, endpoint], and the auth probe uses glab auth status --hostname. The lookup should pass the host too, chosen in this order:
- the host in the URL, if the user entered a full URL (see [Bug]: New-project repository lookup fails for self-hosted GitLab when given a full URL — entire URL is sent as the project path to
glab api projects/<encoded-url>#7849); - otherwise the signed-in GitLab host from
glab auth status, or a host picker if there are several.
The error message also misleads. glab's 404 is classified as not-found, and because GitLabCli.execute sets notFoundDetail: "Merge request not found.", the trace says "Merge request not found" for a repository lookup. The UI shows only the generic message (see #22342).
Impact
Blocks work completely
Version or commit
T3 Code (Beta) 0.1.3, stable channel (desktop)
Environment
macOS (Darwin 27.0), T3 Code desktop 0.1.3 (Electron 44.9.3), glab 1.124.0, self-hosted GitLab. glab auth status: signed in to the self-hosted host; gitlab.com has no token. glab config get host → gitlab.com.
Logs or stack traces
VcsProcessExitError: VCS process failed in GitLabCli.execute: glab (/Users/<user>) exited with 1 - Merge request not found.
at GitLabCli.getRepositoryCloneUrls
at GitLabSourceControlProvider.getRepositoryCloneUrls
at SourceControlRepositoryService.lookupRepository
-> GitLabCliCommandError: GitLab CLI failed in execute: GitLab CLI command failed.
-> SourceControlProviderError: Source control provider gitlab failed in getRepositoryCloneUrls: GitLab CLI command failed.
-> SourceControlRepositoryError: Source control repository operation lookupRepository failed for gitlab: The source control operation could not be completed.
# Same call, run by hand from ~:
$ glab api "projects/group%2Fproject"
ERROR 404 Not Found.
$ GITLAB_HOST=git.example.com glab api "projects/group%2Fproject"
{"id":178,"path_with_namespace":"group/project", ...} # 200 OKWorkaround
Make the self-hosted instance glab's global default host:
glab config set --global host git.example.comAfter that, the bare group/project lookup works. (Without --global, glab config set host fails outside a git repo with "not a Git repository".)
Related issues
- [Bug]: New-project repository lookup fails for self-hosted GitLab when given a full URL — entire URL is sent as the project path to
glab api projects/<encoded-url>#7849: same lookup, but given a full URL; the whole URL is sent as the project path. Its workaround assumes glab's default host is already the self-hosted one, which is the precondition this issue is about. - GitLab errors hide glab's stderr behind a generic "GitLab CLI command failed" #22342: glab's stderr is hidden behind a generic "GitLab CLI command failed".
Filed by
Claude Code (claude-opus-5-5)
Activity
tiborrr commentedon Nov 10, 2026
Additional reproduction (self-hosted GitLab + WSL)
Confirming the same failure on another machine.
Environment
t3 v0.1.8(WSL2 / Ubuntu 24.04)glabsigned in only to self-hostedgitlab.easytrip-transport-services.comglab config get host→gitlab.comgitlab.comhas no token (401 Unauthorized)UI
Add project → Clone from GitLab → repository lookup toast:
CLI check (matches this issue)
So lookup without
--hostname/GITLAB_HOSTstill hits gitlab.com and fails, while the signed-in self-hosted host works when forced. Same root cause as described above.