Repository navigation
perf(server): source control discovery runs its probes in parallel - #43651
juliusmarminge wants to merge 1 commit into
Conversation
Each forge CLI's auth command waited for its version command, and provider discovery waited for the git/jj version probes. With Azure CLI installed, `az --version` (~2.5 s) and then `az account show` (~0.6 s) ran in series behind `git --version`, so every call took 3-4 s. Once a CLI is found on PATH, its version and auth commands now run together (a `gt` that may be Graphite still waits for its version probe), and VCS and provider discovery run concurrently. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Other scenariosAll 64 scenario measurements match All 64 scenario measurements
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
server.discoverSourceControltakes 2–4 s on every call. Fleet traces for stable 0.1.12 over 24 h: 833 web calls, all ≥1.07 s, 732 of them in the 2.1–4.3 s bucket. Every Git controls mount and command palette open pays it.Cause
A 4.0 s sample trace from a host with
azinstalled:git --versionaz --versionaz account show(starts whenaz --versionends)Two waits are in series:
probeSourceControlProviderruns a CLI's auth command only after its version command answers. That PR also added the PATH check, so CLIs that aren't installed are never spawned anyway. Forazthe wait adds 0.6 s to the 2.5 s version probe.ghandglabshow the same version-then-auth chain.SourceControlDiscoverycombines the VCS probes and provider discovery withEffect.allon a record withoutconcurrency, so the forge probes started only aftergit --versionfinished (+741 ms in the trace).Fix
rejectedVersionMeansMissing(gt, which may be Graphite) still waits for the version probe before it asksauth.The total is now bounded by the slowest single command. On the sample trace that is about 2.8 s instead of 4.0 s.
az --versionitself is still the floor on hosts with Azure CLI installed.Trade-off: a CLI that is on PATH but fails to start now costs two failed spawns instead of one. The GitLab test from #42379 now asserts the reported result instead of the spawn count. CLIs that are not on PATH still spawn nothing, and
spawns nothing for a glab that is not on PATHstill covers that.Tests
SourceControlDiscovery.test.tscase,answers once the slowest probe does…, uses TestClock delays: git 1 s, CLI version 3 s, CLI auth 1 s. It asserts discovery has finished after 3 s. It fails on main, where the serial chain takes 5 s.vp run check:changedpasses. Theapps/server/src/sourceControltests pass, and so do the gitlab, forgejo, github, gitcafe, azure-devops, tanstack-source and cursor-origin package tests.Opus 5.5 via Claude Code
🤖 Generated with Claude Code