The best way to control Claude Code, Codex and more from any computer or phone
fix(server): let slow provider CLIs raise their discovery probe budget (#6223)
Co-authored-by: Julius Marminge <jmarminge@gmail.com>
Carlos Jimenez committed
Aug 15, 2026 at 05:07 UTC
d715c2e56bb718d2225cc0f07cc65e6c637dc229
2 files changed
+16
-3
apps/server/src/sourceControl/AzureDevOpsSourceControlProvider.ts
+4
@@ -45,6 +45,10 @@ export const discovery = {
45
executable: "az",
46
versionArgs: ["--version"],
47
authArgs: ["account", "show", "--query", "user.name", "-o", "tsv"],
48
+ // `az` boots a fresh Python interpreter on every invocation, so even `az --version`
49
+ // takes ~6s on Windows and overruns the default budget, leaving the provider reported
50
+ // as missing on machines where it is installed. `gh` and `glab` answer in ~0.3s.
51
+ probeTimeoutMs: 20_000,
52
parseAuth: parseAzureAuth,
53
installHint:
54
"Install the Azure command-line tools (`az`), then enable Azure DevOps support with `az extension add --name azure-devops`.",
apps/server/src/sourceControl/SourceControlProviderDiscovery.ts
+12
-3
@@ -33,6 +33,7 @@ export type SourceControlCliDiscoverySpec = SourceControlDiscoverySpecBase & {
33
readonly executable: string;
34
readonly versionArgs: ReadonlyArray<string>;
35
readonly authArgs: ReadonlyArray<string>;
36
+ readonly probeTimeoutMs?: number;
37
readonly parseAuth: (input: SourceControlAuthProbeInput) => SourceControlProviderAuth;
38
readonly refineUnknownRemote?: (
39
input: SourceControlUnknownRemoteRefinementInput,
@@ -52,6 +53,14 @@ type SourceControlCliRemoteRefinementSpec = SourceControlCliDiscoverySpec & {
53
readonly refineUnknownRemote: NonNullable<SourceControlCliDiscoverySpec["refineUnknownRemote"]>;
54
};
55
56
+// Most provider CLIs answer `--version` in well under a second, so a short budget keeps
57
+// discovery snappy. Specs whose CLI is known to be slower can raise it via probeTimeoutMs.
58
+const DEFAULT_PROBE_TIMEOUT_MS = 5_000;
59
+
60
+function probeTimeoutMs(spec: SourceControlCliDiscoverySpec): number {
61
+ return spec.probeTimeoutMs ?? DEFAULT_PROBE_TIMEOUT_MS;
62
+}
63
+
64
interface DiscoveryProbeResult {
65
readonly kind: SourceControlProviderKind;
66
readonly label: string;
@@ -167,7 +176,7 @@ function probeCli(input: {
176
command: input.spec.executable,
177
args: input.spec.versionArgs,
178
cwd: input.cwd,
170
- timeoutMs: 5_000,
179
+ timeoutMs: probeTimeoutMs(input.spec),
180
maxOutputBytes: 8_000,
181
appendTruncationMarker: true,
182
})
@@ -244,7 +253,7 @@ export function probeSourceControlProvider(input: {
253
args: spec.authArgs,
254
cwd: input.cwd,
255
allowNonZeroExit: true,
247
- timeoutMs: 5_000,
256
+ timeoutMs: probeTimeoutMs(spec),
257
maxOutputBytes: 8_000,
258
appendTruncationMarker: true,
259
})
@@ -287,7 +296,7 @@ export const refineUnknownRemoteProvider = Effect.fn("refineUnknownRemoteProvide
296
args: spec.authArgs,
297
cwd: input.cwd,
298
allowNonZeroExit: true,
290
- timeoutMs: 5_000,
299
+ timeoutMs: probeTimeoutMs(spec),
300
maxOutputBytes: 8_000,
301
appendTruncationMarker: true,
302
})