Skip to content
Open
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
19 changes: 18 additions & 1 deletion apps/web/src/components/chat/ProviderHealthBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { type ServerProviderStatus } from "@t3tools/contracts";
import { memo } from "react";
import { Alert, AlertDescription, AlertTitle } from "../ui/alert";
import { CircleAlertIcon } from "lucide-react";
import { PROVIDER_OPTIONS } from "~/session-logic";
import { ensureSentenceEnds } from "~/lib/utils";

export const ProviderHealthBanner = memo(function ProviderHealthBanner({
status,
Expand All @@ -17,6 +19,8 @@ export const ProviderHealthBanner = memo(function ProviderHealthBanner({
? `${status.provider} provider is unavailable.`
: `${status.provider} provider has limited availability.`;

const opts = PROVIDER_OPTIONS.find((opt) => opt.value === status.provider);

return (
<div className="pt-3 mx-auto max-w-3xl">
<Alert variant={status.status === "error" ? "error" : "warning"}>
Expand All @@ -25,7 +29,20 @@ export const ProviderHealthBanner = memo(function ProviderHealthBanner({
{status.provider === "codex" ? "Codex provider status" : `${status.provider} status`}
</AlertTitle>
<AlertDescription className="line-clamp-3" title={status.message ?? defaultMessage}>
{status.message ?? defaultMessage}
{ensureSentenceEnds(status.message ?? defaultMessage)}
{opts?.docsUrl ? (
<>
{" "}
<a
className="underline underline-offset-4 text-foreground hover:text-primary"
href={opts.docsUrl}
target="_blank"
rel="noreferrer"
>
Installation Guide
</a>
</>
) : null}
</AlertDescription>
</Alert>
</div>
Expand Down
8 changes: 8 additions & 0 deletions apps/web/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ export const newProjectId = (): ProjectId => ProjectId.makeUnsafe(randomUUID());
export const newThreadId = (): ThreadId => ThreadId.makeUnsafe(randomUUID());

export const newMessageId = (): MessageId => MessageId.makeUnsafe(randomUUID());

export const ensureSentenceEnds = (value: string): string => {
const trimmed = value.trim();
if ([".", "!", "?"].includes(trimmed.at(-1) ?? "")) {
return trimmed;
}
return `${trimmed}.`;
};
22 changes: 19 additions & 3 deletions apps/web/src/session-logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,26 @@ export const PROVIDER_OPTIONS: Array<{
value: ProviderPickerKind;
label: string;
available: boolean;
docsUrl: string | null;
Copy link
Contributor

@Bashamega Bashamega Mar 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is always docs, so why make it nullable?

}> = [
{ value: "codex", label: "Codex", available: true },
{ value: "claudeCode", label: "Claude Code", available: false },
{ value: "cursor", label: "Cursor", available: false },
{
value: "codex",
label: "Codex",
available: true,
docsUrl: "https://developers.openai.com/codex/cli/#cli-setup",
},
{
value: "claudeCode",
label: "Claude Code",
available: false,
docsUrl: "https://code.claude.com/docs/en/quickstart#step-1-install-claude-code",
},
{
value: "cursor",
label: "Cursor",
available: false,
docsUrl: "https://cursor.com/docs/cli/installation#installation",
},
];

export interface WorkLogEntry {
Expand Down