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
- On a Linux server install (0.1.11), have only
git,ghandglabinstalled.tea,fj,cafe,originandjjare not onPATH. - Use only GitLab: Settings has
offeredSourceControlProviders: { "gitlab": true }, and Forgejo/Gitea and the others were never turned on. - Leave the server running with a client connected and read
~/.t3/userdata/logs/server.trace.ndjson, or open the diagnostics view.
Expected behavior
A provider that is not installed, or that the user never turned on, should not spawn processes or record failures on every discovery sweep. When <cli> --version fails with ENOENT, discovery should report "not installed" once and skip the auth command for that CLI. Ideally, providers the user hasn't turned on should not be probed at all, or should be probed only when the Source Control settings page is open.
Actual behavior
Every discovery sweep spawns the version command and the auth command of every CLI spec, including ones that are not installed. In packages/source-control-core/src/server/discovery.ts, probeCli and auth run together with Effect.all(..., { concurrency: "unbounded" }) (the comment says "The auth check does not depend on the version output, so both spawn at once."). So a missing binary fails twice, and each failure is recorded as failed spans (NonBlockingSpawner.spawn → processRunner.runProcessCore → VcsProcess.spawn → VcsProcess.runUnbounded → VcsProcess.run). The error is caught and becomes "missing" or "unknown auth", so nothing breaks. But it fills the trace and shows up in diagnostics as an error:
VcsProcessSpawnError: VCS process failed to spawn in source-control.discovery.auth: tea (/home/<user>)
at VcsProcessSpawnError.fromProcessSpawnError (file:///home/<user>/.t3/runtime/versions/0.1.11/t3:36329:11)
at Object.ProcessSpawnError (file:///home/<user>/.t3/runtime/versions/0.1.11/t3:190505:56)
at Object.evaluate
Counts from one server over about 3 hours (15:58 to 19:06 UTC, the whole retained trace window):
| Spawn that failed with ENOENT | Count |
|---|---|
tea --version, tea login status --output json |
145 each |
fj version, fj auth list |
145 each |
cafe --version, cafe ... auth status --json |
145 each |
origin --version, origin auth status --json |
145 each |
jj --version |
145 |
tea login list --output json (ForgejoCli.execute, from repository refinement) |
108 |
That is a sweep about every 75 seconds, with 9 failed spawns per sweep, or roughly 1,300 spawn failures, each recorded as about 5 failed spans. With the default trace retention (10 × 10 MB) the retained window is only about 3 hours on this machine, and this noise is a large part of it.
Related, not duplicates:
- SSH-alias remotes re-probe every forge CLI on each sweep; no way to mark a host as plain git #40005 / fix(server): stop re-probing forge CLIs for plain-git remotes every 5 minutes #40053 cut re-probing of unknown remotes (the
ForgejoCli.execute: tealine above). This report is about the discovery sweep itself, which still probes every installed-or-not CLI on every pass on 0.1.11, and onmainat 8261b23 the concurrent probe plus auth is unchanged. - [Bug]: VCS spawn error fires even with Git integration disabled and git not installed #10351 was the same pattern for
gitwhen the Git integration is turned off.
Suggestions:
- (a) Run the auth command only after the version probe succeeds, so a missing CLI costs one spawn, not two.
- (b) Cache "not installed" for a CLI until
PATHchanges or the user presses refresh, instead of re-spawning every sweep. - (c) Skip discovery for providers that aren't turned on (
offeredSourceControlProviders), or only sweep them while Settings → Source Control is open. - (d) Record an expected ENOENT from a discovery probe as a non-error span, so it doesn't appear in diagnostics as an error.
Impact
Cosmetic issue
Version or commit
0.1.11 (server)
Environment
Ubuntu Server 26.04 (x64), T3 Code server run as a systemd user service, connected through T3 Connect. Installed CLIs: git, gh, glab. Not installed: tea, fj, cafe, origin, jj.
Logs or stack traces
{"name":"NonBlockingSpawner.spawn", ..., "exit":{"_tag":"Failure","cause":"PlatformError: NotFound: ChildProcess.spawn (tea login list --output json) ..."}}
{"name":"VcsProcess.run", ..., "exit":{"_tag":"Failure","cause":"VcsProcessSpawnError: VCS process failed to spawn in source-control.discovery.auth: tea (/home/<user>) ..."}}
Activity
fix(server): source control discovery no longer spawns CLIs that are …