[Bug]: Split SSH/API hostnames leave self-hosted GitLab MR links unsynced #16463
Important
Correction: the missing tea error is recovered. The verified problem is an unsynced GitLab MR link with separate SSH/API hostnames. The follow-up investigation provides the evidence and explains the separate postmerge-message settlement condition. The original report below is retained as investigation history.
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#
Observed on an existing installation; a clean-install reproduction has not been run.
- Use a self-hosted GitLab repository with different SSH and web/API hostnames. Anonymized example:
- Git remote:
git@git.example.com:group/project.git - Merge request URL:
https://gitlab.example.com/group/project/-/merge_requests/123
- Git remote:
- Authenticate
glabagainst the web/API hostname. Confirm thatglab mr view 123 --repo https://gitlab.example.com/group/project --output jsonworks. - Leave the optional Forgejo/Gitea CLI
teauninstalled. - Enable Auto-settle merged threads. Create a merge request and link its full URL to the thread using
link_pull_request. - Finish the agent turn and merge the request on GitLab.
- Inspect the linked PR status and server traces. For a controlled reproduction, leave the thread idle through a PR refresh cycle and do not send a new message after merging.
Expected behavior#
The server reads the linked GitLab merge request's status and settles the eligible idle thread after detecting the merge.
An unavailable optional Forgejo/Gitea CLI should not abort GitLab provider detection or PR synchronization.
Actual behavior#
The merge request is confirmed merged by glab, but T3's linked PR snapshot remains null and the thread remains unsettled.
The server repeatedly records ForgejoCliError caused by spawn tea ENOENT. Its stack passes through refineUnknownRemoteProvider, PullRequestService.canonicalRef, and PullRequestSyncReactor.syncGroup.
The link itself exists: list_thread_pull_requests returns it with state: null, and the persisted V2 link has snapshot: null. Auto-settle on merge is enabled. Inactivity auto-settlement is disabled.
This points to a provider-refinement failure blocking PR synchronization. I have not isolated whether resolving the SSH/API hostname difference would independently unblock GitLab detection.
Related: issue #12060 and PR #12071 cover the same probing path. That issue reports repeated probes and latency on GitHub Enterprise; this report documents an aborting missing-CLI error and an unsynced GitLab link that prevents merge settlement.
Impact#
Minor bug or occasional failure
Version or commit#
0.0.46-nightly.20261005.2702
Environment#
macOS 27.0.1, arm64; local T3 Code environment using Orchestrator V2; self-hosted GitLab; glab authenticated on the web/API host. tea is absent.
Logs or stack traces#
Abbreviated server trace excerpts. Usernames, paths, hostnames, repository names, IDs, and merge request numbers have been replaced or omitted.
ForgejoCliError:
at ForgejoCli.listLogins
at ForgejoSourceControlProvider.refineUnknownRemote
at refineUnknownRemoteProvider
at PullRequestService.canonicalRef
at PullRequestSyncReactor.syncGroup
[cause]: VcsProcessSpawnError:
VCS process failed to spawn in ForgejoCli.execute:
tea (/Users/<user>/Projects/<project>)
[cause]: PlatformError: NotFound:
ChildProcess.spawn (tea login list --output json)
[cause]: Error: spawn tea ENOENT
Independent GitLab read, reduced to relevant fields:
{"iid":123,"state":"merged","merged_at":"<non-null timestamp>"}
Screenshots, recordings, or supporting files#
No response
Workaround#
Manually settle the thread. No change that restores automatic GitLab PR synchronization has been tested.
kremec(GitHub profile, opens in a new tab) added labelsbug
kremec(GitHub profile, opens in a new tab) added labelsneeds-triage
juliusmarminge removed labelsneeds-triage
juliusmarminge added labelsvia-triage
kremec(GitHub profile, opens in a new tab) changed the title
Thanks for tracing this. I rechecked the installed
0.0.46-nightly.20261005.2702runtime, local server traces, and current main (9bd1d8009a). The original report incorrectly attributed the synchronization failure to missingtea.In a trace for the affected checkout, the relevant span exits are:
ForgejoCli.listLogins Failure ForgejoSourceControlProvider.refineUnknownRemote Success refineUnknownRemoteProvider Success PullRequestService.canonicalRef Failure: PullRequestUnavailableError PullRequestSyncReactor.syncGroup Failure: PullRequestUnavailableErrorThe terminal error says change requests cannot be browsed for the project's host. This supports the host-routing diagnosis, rather than an abort caused by the optional CLI.
I also checked the deployed GitLab refinement function with the actual authentication output. A login on the API hostname does not refine the unknown SSH hostname, even when
requestedHostis the API hostname. The deployed parser recognizes that API login. Matching logic.With
glab 1.120.0, I ran read-only checks in temporary Git repositories using the existing credentials and the same MR endpoint:- Split SSH/API hostnames, default
glab api '<endpoint>': HTTP 404, Project Not Found. - Same split-host checkout, adding
--hostname gitlab.example.com: merged MR with a merge timestamp. - Matching SSH/API hostname in the temporary origin, default command: merged MR with a merge timestamp.
Here
<endpoint>isprojects/group%2Fproject/merge_requests/123?include_diverged_commits_count=true.GITLAB_HOST,GL_HOST, andGITLAB_API_HOSTare unset, and neither hostname has a configuredssh_hostmapping. These results establish the CLI behavior for this configuration; they are not an end-to-end T3 fix test.Accepting
requestedHostduring refinement alone would not complete the routing fix: GitLab still uses the repository identity's host downstream. Only Forgejo substitutes the refined provider's base URL there. Host selection.One clarification to the settlement explanation: this is an explicit V2
pullRequestslink. A visible link withsnapshot: nulldirectly prevents settlement, and threads with visible links are excluded from the separate source-control lookup. The hostlesssummarycall therefore does not describe this link's settlement path. Snapshot check, lookup exclusion.There is also a reproduction caveat: I sent a user message after the merge. That independently makes the thread ineligible for merge-based settlement. The confirmed defect is the linked MR remaining unsynced despite being readable directly. I have not run a fresh idle-thread end-to-end reproduction or tested a fix.
I have updated the issue title to [Bug]: Split SSH/API hostnames leave self-hosted GitLab MR links unsynced. The optional-CLI probe caching issue is separate from resolving the GitLab API host.
- Split SSH/API hostnames, default
kremec(GitHub profile, opens in a new tab) closed this
kremec(GitHub profile, opens in a new tab) reopened this
Same split here on nightly 0.1.1-nightly.20261016.3218: remotes
git@ssh.nova.teachx.ai:…, web/API hostnova.teachx.ai,glablogged in to the web host only. Besides the MR links never syncing, the lookup is retried on every PR sync: 27,480PullRequestService.canonicalRefand as manyPullRequestSyncReactor.syncGroupspans failing withPullRequestUnavailableErrorin 11 hours of server trace, for one repository and its worktrees. Backing off after aprovider-unsupportedanswer, as well as the host mapping you list, would stop that.(Written by an AI agent in T3 Code on behalf of @nkoynov, from his server's trace.)
juliusmarminge added labelsneeds more info
juliusmarminge removed labelsneeds more info
Same symptom on a same-host setup (no SSH/API split), which isolates the host-label check as sufficient to reproduce.
Environment#
- T3 Code 0.1.7 (Beta), macOS + Linux
- Self-hosted GitLab at
https://<self-hosted-gitlab-host>; the hostname has nogitlabDNS label glab-compatible wrapper;glab auth status --hostname <self-hosted-gitlab-host>returns the host andLogged in- The git remote and the MR URL use the same host
Steps to reproduce#
- Link an MR URL
https://<self-hosted-gitlab-host>/<group>/<project>/-/merge_requests/<iid>to a thread. - The MR panel shows
state: null. - In the same repo:
glab mr view --output json -- <iid>returns{"state":"merged", ...}.
Why this is the same root cause#
recognizeRemotereturnsnullfor<self-hosted-gitlab-host>because it only acceptsgitlab.comor a hostname with agitlabDNS label.resolveLinkalso hard-codesinput.url.host !== "gitlab.com".- So the linked URL never reaches the GitLab provider, even though
glabis authenticated and can read the MR.
This confirms the triage in this issue: the split-host case is one variant; the host-label check alone is enough. We did not find a new root cause.
Secondary observation: the panel list path runs
glab mr list --source-branch <current-branch>, so MRs whose source branch differs from the current branch are not listed. For linked MRs, theresolveLinkhost check is the blocker.Workaround#
Read MR state via
glab mr view(or a patrol script); the panel staysnull. We did not patchapp.asar:ElectronAsarIntegritywould reject it and upgrades would overwrite it.
Sign in to join this conversation.
Note
Grok responding on behalf of Julius.
Triage#
Thanks @kremec for the detailed report and the working
glabcommand, that made the host split easy to spot. Reading currentmain(9bd1d8009a, same source-control path ascfa4f765), the missingteabinary turns out to be noise rather than the reason the snapshot stays null. The underlying problem is the split SSH and web hosts.What I found#
gitlab.comor has agitlabDNS label (packages/shared/src/sourceControl.ts), sogit.example.comstaysunknown.teaerror is recovered. Each sync still refines the unknown remote (PullRequestSyncReactor.syncGroup→summary→credentialCached→PullRequestService.canonicalRef→requireProject→refineUnknownRemoteProvider). Withteaabsent,tea login listfails withspawn tea ENOENT, butForgejoSourceControlProvider.refineUnknownRemoterecovers it (Effect.orElseSucceed(() => [])). The failedlistLoginsspan is still recorded undercanonicalRefandsyncGroup, which is the stack you saw. That's the same probe loop as #12060; #12071 caches the negative result but doesn't add a separate GitLab API host.refineUnknownGitLabRemoteaccepts the remote only whenglab auth statushas an account on the git remote host (git.example.com). A login ongitlab.example.comdoesn't match, andrequestedHostisn't used there.gitlab.example.com(parseChangeRequestUrl),requireProjectlooks for a checkout on that host, the project is stillgit.example.com/unknown, and the read fails withPullRequestUnavailableError(provider-unsupported). The link stayssnapshot: null.summarywith no host override, so the sweep logsautomatic thread settlement skipped.glab apigets no--hostname(GitLabPullRequestCli), so glab has to infergitlab.example.comfrom a remote that saysgit.example.com. Your working command passes--repo https://gitlab.example.com/group/project, which this path doesn't.glabis logged into, and the host in the linked MR URL all match, including a self-hosted name with nogitlablabel.Likely fix area#
GitLab host resolution in
refineUnknownGitLabRemote,requireProject, andGitLabPullRequestCli. Some options:requestedHost) or theglablogin hosts, rather than only the git remote host.--hostname(or--repoURL) toglab apionce the API host is known.teaprobe from recording a failed span when the binary is missing (the #12060 / #12071 area).A maintainer will decide on the fix direction.