Skip to content

Commit e6c8ee4

Browse files
fix(server): a provider's runtime text-generation opt-out survives the registry
The registry replaced each snapshot's supportsTextGeneration with the static operation list, so an Antigravity profile with global hooks, or an uninstalled or signed-out instance, still advertised text generation and writers stopped falling back to the default model. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 92568fe commit e6c8ee4

2 files changed

Lines changed: 15 additions & 12 deletions

File tree

‎apps/server/src/provider/ProviderRegistry.test.ts‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,12 @@ it.layer(
427427
});
428428

429429
describe("ProviderRegistry.layer", () => {
430-
it.effect(
431-
"publishes operation capabilities from the runtime instead of stale probe flags",
432-
() =>
430+
it.effect.each([
431+
["replaces stale snapshot operations", true, ["generateConversationSummary"]],
432+
["keeps a runtime unavailable flag", false, []],
433+
] as const)(
434+
"publishes operation capabilities from the runtime: %s",
435+
([, snapshotSupportsTextGeneration, expectedOperations]) =>
433436
Effect.gen(function* () {
434437
const instanceId = ProviderInstanceId.make("writer");
435438
const driverKind = ProviderDriverKind.make("muse");
@@ -443,7 +446,7 @@ it.layer(
443446
auth: { status: "authenticated" },
444447
checkedAt: "2026-06-10T00:00:00.000Z",
445448
models: [],
446-
supportsTextGeneration: false,
449+
supportsTextGeneration: snapshotSupportsTextGeneration,
447450
textGenerationOperations: ["generateReviewGuide"],
448451
});
449452
const instance: ProviderInstance = {
@@ -475,8 +478,8 @@ it.layer(
475478
yield* Effect.gen(function* () {
476479
const registry = yield* ProviderRegistry.ProviderRegistry;
477480
const providers = yield* registry.refresh();
478-
expect(providers[0]?.supportsTextGeneration).toBe(true);
479-
expect(providers[0]?.textGenerationOperations).toEqual(["generateConversationSummary"]);
481+
expect(providers[0]?.supportsTextGeneration).toBe(expectedOperations.length > 0);
482+
expect(providers[0]?.textGenerationOperations).toEqual(expectedOperations);
480483
}).pipe(
481484
Effect.provide(
482485
ProviderRegistry.layer.pipe(

‎apps/server/src/provider/ProviderRegistry.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -329,14 +329,14 @@ const correlateSnapshotWithSource = (
329329
),
330330
);
331331
}
332+
if (source.textGenerationOperations === undefined) return Effect.succeed(snapshot);
333+
// A runtime `false` (Antigravity with global hooks, unauthenticated) still wins over the static list.
334+
const operations =
335+
snapshot.supportsTextGeneration === false ? [] : source.textGenerationOperations;
332336
return Effect.succeed({
333337
...snapshot,
334-
...(source.textGenerationOperations === undefined
335-
? {}
336-
: {
337-
supportsTextGeneration: source.textGenerationOperations.length > 0,
338-
textGenerationOperations: source.textGenerationOperations,
339-
}),
338+
supportsTextGeneration: operations.length > 0,
339+
textGenerationOperations: operations,
340340
});
341341
};
342342

0 commit comments

Comments
 (0)