From 3597a592f3b37a2e7f333a608ecacd608c5a3df4 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Fri, 20 Nov 2026 20:03:44 +0000 Subject: [PATCH 1/2] test(server): text generation must not run a disabled provider Repro for #39863: a disabled selected instance is not treated as unusable, so text generation runs it instead of falling back or failing clearly. Co-Authored-By: Claude Opus 5.5 --- .../CodexTextGeneration.test.ts | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/apps/server/src/textGeneration/CodexTextGeneration.test.ts b/apps/server/src/textGeneration/CodexTextGeneration.test.ts index 9fc0e43f4f6e2..dc3d5914a8297 100644 --- a/apps/server/src/textGeneration/CodexTextGeneration.test.ts +++ b/apps/server/src/textGeneration/CodexTextGeneration.test.ts @@ -664,6 +664,8 @@ const PREFLIGHT_PRIMARY_STATES = [ "signed out, fallback failed", "cannot generate text", "model cannot generate text", + "disabled", + "disabled, fallback disabled for project", ] as const; it.effect.each(PREFLIGHT_PRIMARY_STATES)("text generation preflight: %s", (primaryState) => @@ -724,6 +726,9 @@ it.effect.each(PREFLIGHT_PRIMARY_STATES)("text generation preflight: %s", (prima ], } : {}), + ...(primaryState.startsWith("disabled") && instanceId === primary + ? { enabled: false, status: "disabled" } + : {}), ...(primaryState === "exhausted" && instanceId === primary ? { usageLimits: { @@ -771,7 +776,7 @@ it.effect.each(PREFLIGHT_PRIMARY_STATES)("text generation preflight: %s", (prima }, }, defaultModelSelection: threadDefault, - ...(primaryState === "not installed, fallback disabled for project" + ...(primaryState.endsWith("fallback disabled for project") ? { projectSettingsOverrides: { [projectId]: { providerInstances: { [fallback]: { enabled: false } } }, @@ -787,15 +792,21 @@ it.effect.each(PREFLIGHT_PRIMARY_STATES)("text generation preflight: %s", (prima ), ), ); - expect( - yield* service.generateThreadTitle({ + const generated = yield* service + .generateThreadTitle({ cwd: "/tmp", message: "hello", linkedContext: "", modelSelection: selection, projectId, - }), - ).toEqual({ title: "Generated title" }); + }) + .pipe(Effect.exit); + if (primaryState === "disabled, fallback disabled for project") { + expect(Exit.isFailure(generated)).toBe(true); + expect(calls).toEqual([]); + return; + } + expect(generated).toEqual(Exit.succeed({ title: "Generated title" })); expect(calls).toEqual([ primaryState === "ready" || primaryState === "pending" || From a2dae49e51a26c801a25ff8810763ad5a02f68ac Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Fri, 20 Nov 2026 20:13:14 +0000 Subject: [PATCH 2/2] fix(server): text generation no longer runs a disabled provider A disabled text generation selection, including the implicit Codex default, now falls back to an enabled provider that can generate text, and fails with a clear message when there is none. Fixes pingdotgg/t3code#39863 Co-Authored-By: Claude Opus 5.5 --- apps/server/src/textGeneration/TextGeneration.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/server/src/textGeneration/TextGeneration.ts b/apps/server/src/textGeneration/TextGeneration.ts index c91aa0623d8fb..f994b7743c503 100644 --- a/apps/server/src/textGeneration/TextGeneration.ts +++ b/apps/server/src/textGeneration/TextGeneration.ts @@ -104,9 +104,11 @@ export const make = Effect.gen(function* () { ); const now = DateTime.toEpochMillis(yield* DateTime.now); const selected = snapshots.find((provider) => provider.instanceId === selection.instanceId); + const selectedDisabled = selected?.enabled === false; // Only a failed probe counts: a pending one is also not installed yet. const unusable = textGeneratorCannotRun || + selectedDisabled || (selected?.enabled === true && (!isProviderTextGenerationCapable(selected) || selected.models.find((model) => model.slug === selection.model) @@ -152,6 +154,13 @@ export const make = Effect.gen(function* () { "Review guides need a coding agent that can read the checkout. None is ready. Pick Codex or Claude as the review guide model in Settings → Source control & issues.", }); } + if (selectedDisabled && selection.instanceId === selected.instanceId) { + return yield* new TextGenerationError({ + operation, + detail: + "No text generation provider is available. Enable a provider that can generate text in Settings → Providers.", + }); + } return yield* installationGate.execute( selection.instanceId, resolveInstance(registry, operation, selection.instanceId).pipe(