@devries-cameron20 / t3code-1 / commits / 4baba3b503
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(server): disabled providers stop checking for CLI updates (#16772)

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>

Yordis Prieto committed Oct 10, 2026 at 23:06 UTC 4baba3b50359743998502f804801c2473b4123fe
5 files changed +48 -23
apps/server/src/provider/AntigravityProvider.test.ts
+7 -15
@@ -257,31 +257,23 @@ it.layer(layerTest)("Antigravity provider snapshots", (it) => {
257 ),
258 );
259
260 - it.effect("records explicit sign-in while disabled without starting a health probe", () =>
260 + it.effect("ignores account updates while disabled", () =>
261 Effect.scoped(
262 Effect.gen(function* () {
263 const harness = yield* makeHarness({ enabled: false });
264 - const signedIn = yield* Stream.toPull(
265 - harness.provider.snapshot.streamChanges.pipe(
266 - Stream.filter(
267 - (snapshot) =>
268 - snapshot.auth.status === "authenticated" && snapshot.slashCommands.length > 0,
269 - ),
270 - ),
271 - );
264 yield* harness.provider.onSessionStarted(started);
265 yield* harness.provider.onAvailableCommands(commands);
274 - const [snapshot] = yield* signedIn;
266 + yield* harness.provider.onSignedOut;
267 + const snapshot = yield* harness.provider.snapshot.refresh;
268 expect(snapshot).toMatchObject({
269 enabled: false,
277 - installed: true,
270 + installed: false,
271 status: "disabled",
279 - auth: { status: "authenticated", type: "oauth-personal" },
272 + auth: { status: "unknown" },
273 + models: [],
274 + slashCommands: [],
275 workspaceSnapshots: [],
276 });
282 - expect(snapshot.models).toEqual(buildAntigravityModelsFromSession(sessionSetupResult));
283 - expect(snapshot.slashCommands).toEqual(expectedCommands);
284 - expect((yield* harness.provider.snapshot.refresh).models).toEqual(snapshot.models);
277 expect(yield* Ref.get(harness.probeCalls)).toBe(0);
278 }),
279 ),
apps/server/src/provider/AntigravityProvider.ts
+9 -3
@@ -132,7 +132,10 @@ interface AntigravityProviderOptions {
132 readonly auth?: { readonly type: string; readonly label: string };
133 }
134
135 -/** Health uses initialize only. Session callbacks supply account-specific metadata. */
135 +/**
136 + * Health uses initialize only. Session callbacks supply account-specific
137 + * metadata, which a disabled instance never shows.
138 + */
139 export const makeAntigravityProvider = Effect.fn("makeAntigravityProvider")(function* (
140 settings: AntigravitySettings,
141 options: AntigravityProviderOptions,
@@ -271,6 +274,7 @@ export const makeAntigravityProvider = Effect.fn("makeAntigravityProvider")(func
274 started: AcpSessionRuntime.AcpSessionRuntimeStartResult,
275 cwd?: string,
276 ) {
277 + if (!settings.enabled) return;
278 const before = yield* SubscriptionRef.get(metadata);
279 const supportsTextGeneration = yield* options.supportsTextGeneration;
280 const usageLimits =
@@ -293,7 +297,7 @@ export const makeAntigravityProvider = Effect.fn("makeAntigravityProvider")(func
297 draft: {
298 ...draft,
299 installed: true,
296 - status: settings.enabled ? "ready" : "disabled",
300 + status: "ready",
301 version: started.initializeResult.agentInfo?.version || draft.version,
302 auth: {
303 status: "authenticated",
@@ -339,6 +343,7 @@ export const makeAntigravityProvider = Effect.fn("makeAntigravityProvider")(func
343 commands: ReadonlyArray<EffectAcpSchema.AvailableCommand>,
344 cwd?: string,
345 ) {
346 + if (!settings.enabled) return;
347 const slashCommands = nativeCommands(commands);
348 const updatedAt = DateTime.formatIso(yield* DateTime.now);
349 yield* SubscriptionRef.update(metadata, (state) => {
@@ -371,6 +376,7 @@ export const makeAntigravityProvider = Effect.fn("makeAntigravityProvider")(func
376
377 const clearAccountMetadata = Effect.fn("AntigravityProvider.clearAccountMetadata")(function* () {
378 if (options.clearUsage) yield* options.clearUsage;
379 + if (!settings.enabled) return;
380 const updatedAt = DateTime.formatIso(yield* DateTime.now);
381 yield* SubscriptionRef.update(
382 metadata,
@@ -380,7 +386,7 @@ export const makeAntigravityProvider = Effect.fn("makeAntigravityProvider")(func
386 draft: {
387 ...state.draft,
388 auth: { status: "unauthenticated" },
383 - status: settings.enabled ? "warning" : "disabled",
389 + status: "warning",
390 message: SIGN_IN_MESSAGE,
391 checkedAt: updatedAt,
392 models: [],
apps/server/src/provider/Drivers/AntigravityDriver.test.ts
+4 -4
@@ -187,7 +187,7 @@ const makeHarness = Effect.fn("makeAntigravityDriverHarness")(function* (
187 const instance = yield* AntigravityDriver.create({
188 instanceId,
189 displayName: "Google test account",
190 - enabled: options.enabled ?? false,
190 + enabled: options.enabled ?? true,
191 config: { ...AntigravityDriver.defaultConfig(), ...options.config },
192 environment: [
193 { name: "PATH", value: instancePath },
@@ -292,7 +292,7 @@ it.layer(layerTest)("AntigravityDriver", (it) => {
292
293 it.effect.skipIf(windowsHost)("does not launch a process for a disabled instance", () =>
294 Effect.gen(function* () {
295 - const h = yield* makeHarness();
295 + const h = yield* makeHarness({ enabled: false });
296 const snapshot = yield* h.instance.snapshot.refresh;
297 expect(snapshot.status).toBe("disabled");
298 expect(h.acquisitions).toEqual([]);
@@ -322,13 +322,13 @@ it.layer(layerTest)("AntigravityDriver", (it) => {
322 );
323
324 it.effect.skipIf(windowsHost)(
325 - "refreshes a disabled instance through the selected executable and personal Google ACP",
325 + "refreshes through the selected executable and personal Google ACP",
326 () =>
327 Effect.gen(function* () {
328 const h = yield* makeHarness();
329 yield* h.refresh();
330 const snapshot = yield* h.instance.snapshot.getSnapshot;
331 - expect(snapshot.status).toBe("disabled");
331 + expect(snapshot.status).toBe("ready");
332 expect(snapshot.auth.status).toBe("authenticated");
333 expect(snapshot.models.map((model) => model.slug)).toEqual([
334 "gemini-test-low",
packages/provider-core/src/server/managedProvider.test.ts
+25
@@ -183,6 +183,31 @@ describe("makeManagedServerProvider", () => {
183 ).pipe(Effect.provide(layerAlwaysRunTest)),
184 );
185
186 + it.effect("does not enrich a disabled provider's snapshot", () =>
187 + Effect.scoped(
188 + Effect.gen(function* () {
189 + let enrichmentCalls = 0;
190 + const provider = yield* makeManagedServerProvider<TestSettings>({
191 + resolveMaintenance: () => Effect.succeed(maintenanceCapabilities),
192 + getSettings: Effect.succeed({ enabled: false }),
193 + streamSettings: Stream.empty,
194 + haveSettingsChanged: (previous, next) => previous.enabled !== next.enabled,
195 + refreshOnInterval: false,
196 + initialSnapshot: () => Effect.succeed({ ...initialSnapshot, enabled: false }),
197 + checkProvider: Effect.succeed({ ...refreshedSnapshot, enabled: false }),
198 + enrichSnapshot: () => {
199 + enrichmentCalls += 1;
200 + return Effect.void;
201 + },
202 + });
203 +
204 + yield* provider.refresh;
205 +
206 + assert.strictEqual(enrichmentCalls, 0);
207 + }),
208 + ).pipe(Effect.provide(layerAlwaysRunTest)),
209 + );
210 +
211 it.effect("skips periodic provider refreshes without foreground provider-status demand", () =>
212 Effect.scoped(
213 Effect.gen(function* () {
packages/provider-core/src/server/managedProvider.ts
+3 -1
@@ -106,7 +106,9 @@ export const makeManagedServerProvider = Effect.fn("makeManagedServerProvider")(
106 yield* Fiber.interrupt(previousFiber).pipe(Effect.ignore);
107 }
108
109 - if (!input.enrichSnapshot) {
109 + // Enrichment resolves binaries and package-manager state, which a disabled
110 + // provider has no use for.
111 + if (!input.enrichSnapshot || !snapshot.enabled) {
112 return;
113 }
114