Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion apps/mobile/src/features/threads/ThreadComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,11 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer
? "assertive"
: "polite"
}
className="px-3 py-2 text-xs text-foreground"
className={
selectedProviderStatus.compatibilityAdvisory.status === "broken"
? "bg-danger px-3 py-2 text-xs text-danger-foreground"
: "px-3 py-2 text-xs text-foreground"
}
>
{selectedProviderStatus.compatibilityAdvisory.message}
</Text>
Expand Down
8 changes: 5 additions & 3 deletions apps/server/src/provider/model-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": 1,
"updatedAt": "2026-09-28T20:00:00Z",
"updatedAt": "2026-09-29T01:03:44Z",
"compatibility": [
{
"driver": "codex",
Expand Down Expand Up @@ -43,9 +43,11 @@
{
"driver": "opencode",
"t3CodeRange": ">=0.0.42",
"recommendedRange": ">=1.14.19",
"recommendedRange": ">=1.14.19 <2.0.0",
"recommendedVersion": "1.14.19",
"ranges": [
{ "range": ">=1.14.19", "status": "supported" },
{ "range": ">=2.0.0", "status": "broken" },
{ "range": ">=1.14.19 <2.0.0", "status": "supported" },
{ "range": "<1.14.19", "status": "broken" }
]
},
Expand Down
18 changes: 0 additions & 18 deletions apps/server/src/provider/providerCompatibility.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,6 @@ describe("provider compatibility", () => {
}
});

it("supports Codex 0.156 and marks Codex without Thread.projectId broken", () => {
const bundled = ModelManifest.BUNDLED_MODEL_MANIFEST.compatibility;
for (const [t3CodeVersion, codexVersion, expected] of [
["0.0.42", "0.148.0", "broken"],
["0.0.42", "0.149.0", "unsupported"],
["0.0.42", "0.155.0", "unsupported"],
["0.0.42", "0.156.0", "supported"],
["0.0.43-nightly.20260924.2200", "0.153.3", "unsupported"],
["0.0.43-nightly.20260924.2200", "0.156.1", "supported"],
] as const) {
assert.strictEqual(
resolveProviderCompatibility(bundled, driver, codexVersion, t3CodeVersion)?.status,
expected,
`T3 Code ${t3CodeVersion} with Codex ${codexVersion}`,
);
}
});

it("compares Cursor build dates without treating semver prereleases as stable", () => {
const cursor = ProviderDriverKind.make("cursor");
const cursorPolicy: ProviderCompatibilityPolicy = {
Expand Down
6 changes: 5 additions & 1 deletion apps/server/src/provider/providerMaintenanceRunner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,11 @@ const makeTestRunner = (
manifest: ModelManifest.ModelManifestData = {
version: 1,
currentModels: {},
compatibility: [{ driver: CODEX_DRIVER, t3CodeRange: ">=0.0.42", ranges: [] }],
compatibility: [CODEX_DRIVER, CURSOR_DRIVER, OPENCODE_DRIVER].map((driver) => ({
driver,
t3CodeRange: ">=0.0.42",
ranges: [],
})),
},
) =>
Effect.service(ProviderMaintenanceRunner.ProviderMaintenanceRunner).pipe(
Expand Down
54 changes: 54 additions & 0 deletions apps/web/src/components/chat/ProviderStatusBanner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,60 @@ describe("compatibility banners", () => {
).toBeNull();
});

it("shows downgrade guidance instead of a broken OpenCode inventory timeout", () => {
const message = "This provider version is known to be incompatible. Use 1.14.19.";
const broken: ServerProvider = {
...provider,
driver: ProviderDriverKind.make("opencode"),
version: "2.0.3",
status: "error",
auth: { status: "unknown" },
message: "Failed to load OpenCode provider inventory: Timed out waiting for server start.",
compatibilityAdvisory: {
status: "broken",
message,
recommendedVersion: "1.14.19",
recommendedRange: ">=1.14.19 <2.0.0",
},
};
expect(shouldShowProviderStatusBanner(broken, null)).toBe(true);
const timeoutOnly: ServerProvider = {
...broken,
compatibilityAdvisory: {
...broken.compatibilityAdvisory!,
status: "supported",
message: null,
},
};
expect(shouldShowProviderStatusBanner(broken, getProviderStatusBannerKey(timeoutOnly))).toBe(
true,
);
expect(shouldShowProviderStatusBanner(broken, getProviderStatusBannerKey(broken))).toBe(false);
expect(
shouldShowProviderStatusBanner(
{
...broken,
compatibilityAdvisory: { ...broken.compatibilityAdvisory!, message: "Use 1.14.20." },
},
getProviderStatusBannerKey(broken),
),
).toBe(true);
expect(getProviderStatusMessage(broken)).toBe(message);
expect(
getProviderStatusMessage({
...broken,
compatibilityAdvisory: {
...broken.compatibilityAdvisory!,
status: "supported",
message: null,
},
}),
).toBe(broken.message);
expect(getProviderStatusMessage({ ...broken, auth: { status: "unauthenticated" } })).toBe(
broken.message,
);
});

it("keeps authentication failures ahead of compatibility warnings even without a probe message", () => {
const unauthenticated: ServerProvider = {
...provider,
Expand Down
32 changes: 23 additions & 9 deletions apps/web/src/components/chat/ProviderStatusBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,25 @@ import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
/** Unsupported and broken versions fail mid-turn, so they warn even when ready. */
function getIncompatibleVersion(status: ServerProvider) {
const compatibility = status.compatibilityAdvisory;
return compatibility?.status === "unsupported" || compatibility?.status === "broken"
if (status.status === "error" && status.auth.status === "unauthenticated") return null;
return compatibility?.status === "broken" ||
(status.status === "ready" && compatibility?.status === "unsupported")
? compatibility
: null;
}

export function getProviderStatusBannerKey(status: ServerProvider | null): string | null {
if (!status || status.status === "disabled") return null;
if (status.status === "ready") {
const incompatible = getIncompatibleVersion(status);
return incompatible
? [status.instanceId, incompatible.status, status.version ?? ""].join("\u0000")
: null;
const incompatible = getIncompatibleVersion(status);
if (incompatible) {
return [
status.instanceId,
incompatible.status,
status.version ?? "",
incompatible.message ?? "",
].join("\u0000");
}
if (status.status === "ready") return null;
// Antigravity checks saved credentials when a session starts. Its local
// health check leaves auth unknown after a restart, which is not a failure.
if (
Expand Down Expand Up @@ -53,8 +59,15 @@ export function hasProviderSetup(status: ServerProvider): boolean {
);
}

/** Keep the environment's error intact in both the banner and model picker. */
/** Broken-version guidance takes precedence over startup failures it can cause. */
export function getProviderStatusMessage(status: ServerProvider): string {
if (
status.auth.status !== "unauthenticated" &&
status.compatibilityAdvisory?.status === "broken" &&
status.compatibilityAdvisory.message
) {
return status.compatibilityAdvisory.message;
}
if (status.message) return status.message;
const providerName = status.displayName?.trim() || formatProviderDriverKindLabel(status.driver);
if (!status.installed && hasProviderSetup(status)) {
Expand Down Expand Up @@ -90,14 +103,15 @@ export const ProviderStatusBanner = memo(function ProviderStatusBanner({

const providerName = status.displayName?.trim() || formatProviderDriverKindLabel(status.driver);
const isUnauthenticated = status.status === "error" && status.auth.status === "unauthenticated";
const incompatible = status.status === "ready" ? getIncompatibleVersion(status) : null;
const incompatible = getIncompatibleVersion(status);
const title = isUnauthenticated
? `${providerName} is unauthenticated`
: incompatible
? `${providerName} ${status.version ?? ""} is ${incompatible.status === "broken" ? "known to be broken" : "unsupported"}`
: `${providerName} provider status`;
const message = incompatible?.message ?? getProviderStatusMessage(status);
const isWarning = status.status === "warning" || incompatible !== null;
const isWarning =
incompatible?.status !== "broken" && (status.status === "warning" || incompatible !== null);

return (
<div className="pointer-events-auto mx-auto w-fit max-w-[calc(100%-2rem)] pt-3">
Expand Down
Loading