This is a problem for AI providers like claude and codex too, FWIW. The hardcoded timeout causes the healthcheck to fail on a slow wrapper.
[Bug]: installed hosting CLI reported as missing when the PATH entry is slower than the 5s discovery probe#10728
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
Make the name
ghresolve on the server'sPATHto a wrapper script that is slower than 5s, rather than to the real binary. Version managers do this routinely. A minimal stand-in:bash1 # ~/.local/bin/gh, earlier on PATH than the real binary 2 #!/bin/bash 3 sleep 10 4 exec /path/to/real/gh "$@" Confirm the CLI itself is healthy and authenticated by calling the real binary directly.
Open Settings → Source Control and choose Rescan server environment.
Expected behavior
Either GitHub is reported as available, or the row explains that the probe timed out — something that points at the real problem.
Actual behavior
GitHub is reported as:
Not available on this server: Install the GitHub command-line tool (
gh) via https://cli.github.com/ or your package manager.
The CLI is installed, on PATH, and authenticated. The message is actively misleading: it tells the user to install software they already have, and it names PATH as the cause when PATH resolution succeeded.
The mechanism is in SourceControlProviderDiscovery.ts. probeCli runs <executable> --version with DEFAULT_PROBE_TIMEOUT_MS = 5_000 and maps any failure to status: "missing". probeSourceControlProvider then discards the captured cause and substitutes a fixed string:
| 1 | auth: unknownAuth("Hosting integration command was not found on the server PATH.") |
So a timeout, a non-zero exit, and a genuine ENOENT are all reported to the user as "not found on PATH". The same 5s budget applies to glab and az; az already carries probeTimeoutMs: 20_000 with a comment noting that "gh and glab answer in ~0.3s" — an assumption that holds for the real binaries but not for wrappers in front of them.
Impact
Major degradation or frequent failure
Version or commit
main @ 349ce301
Environment
- Arch Linux (kernel 7.1.9), x86_64
- T3 Code dev server from
main - GitHub CLI 2.100.0, installed and authenticated
- Node 26.8.1
Logs or stack traces
| 1 | # The real binary is fine: |
| 2 | $ /home/user/.local/share/mise/installs/gh/latest/.../bin/gh --version |
| 3 | gh version 2.100.0 (2026-09-03) # 180ms |
| 4 | |
| 5 | # The name on PATH is not. Five consecutive runs, 30s timeout each: |
| 6 | $ for i in 1 2 3 4 5; do timeout 30 gh --version; echo "rc=$?"; done |
| 7 | rc=124 |
| 8 | rc=124 |
| 9 | rc=124 |
| 10 | rc=124 |
| 11 | rc=124 |
| 12 | |
| 13 | # Left to run to completion, it never returns and burns CPU: |
| 14 | $ time gh --version |
| 15 | real 7m3.987s |
| 16 | user 3m44.518s |
| 17 | sys 4m16.829s |
Related issues
- #7618 reports the same user-visible symptom on macOS, but through a different root cause: there the server's
PATHgenuinely lacks the CLI's directory (spawn gh ENOENT, Finder-launched.appwithPATH=/usr/bin:/bin:/usr/sbin:/sbin). This report is the opposite case —PATHresolution succeeds and the probe times out on what it found. Both surface as the same "installgh" message, which is part of why the message is a problem.
Workaround
Ensure the name on PATH resolves to the real binary, by removing the wrapper or reordering PATH. There is currently no way to tell T3 Code which executable to use, so the only fix available to the user is to change their system.
Reproduced on ed9b7ca9c5, Ubuntu Linux, using the real dev server and web client with isolated empty state. A PATH wrapper waits 10 seconds before running /usr/bin/gh; the real binary answers --version immediately. Settings → Source Control → Rescan server environment logs a 5000 ms version-probe timeout, but the GitHub row tells the user to install gh. No authentication probe is reached.