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
4 changes: 2 additions & 2 deletions web/packages/agenta-entities/src/secret/core/cardCopy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import {SecretKind} from "./types"
* would then read past. Strip it and let the separator do the work.
*/
export const credentialStatusLine = (message: string, modelCount: number | null): string => {
const verdict = message.trim().replace(/\.$/, "")
const verdict = message.trim()
if (modelCount === null) return verdict
return `${verdict} · ${modelCount} ${modelCount === 1 ? "model" : "models"} fetched`
return `${verdict.replace(/\.$/, "")} · ${modelCount} ${modelCount === 1 ? "model" : "models"} fetched`
}

/** The header's live count — checked against fetched, never a claim about defaults. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe("credentialStatusLine", () => {

it("says nothing about a fetch that did not happen", () => {
expect(credentialStatusLine("OpenAI rejected this key (401).", null)).toBe(
"OpenAI rejected this key (401)",
"OpenAI rejected this key (401).",
)
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {useMemo, useState} from "react"

import {
activeModelsCount,
type DiscoveryStatus,
modelListView,
relativeFetchTime,
type ModelOption,
Expand All @@ -35,8 +36,12 @@ export interface ActiveModelsSectionProps {
onAddManual: (id: string) => void
/** What the manual row offers to add against — the API's list, or one endpoint's. */
manualPlaceholder: string
/** Used in the fallback note when discovery did not return the provider's own list. */
title: string
/** Set only when a live fetch answered — drives the timestamp line and the re-fetch action. */
fetchedAt?: string | null
/** Shows whether the list came from discovery or a bundled fallback. */
discoveryStatus?: DiscoveryStatus | null
onRefetch?: () => void
refetching?: boolean
}
Expand All @@ -58,7 +63,9 @@ const ActiveModelsSection = ({
onClear,
onAddManual,
manualPlaceholder,
title,
fetchedAt,
discoveryStatus,
onRefetch,
refetching,
}: ActiveModelsSectionProps) => {
Expand All @@ -84,6 +91,13 @@ const ActiveModelsSection = ({
setManualId("")
}

const catalogNote =
discoveryStatus === "fetched"
? null
: discoveryStatus == null
? `Showing Agenta's shipped catalog. ${title}'s own list has not been fetched yet.`
: `Showing Agenta's shipped catalog. ${title}'s own list was not fetched.`
Comment on lines +94 to +99

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Render the catalog note only for an actual catalog fallback.

discoveryStatus !== "fetched" does not prove that the displayed options came from Agenta's shipped catalog. Credential-set providers are documented as discovery- and manual-entry-only, so this text can claim a catalog is shown when it is not. Pass an explicit fallback flag and gate this note on that flag.


Comment on lines +94 to +100
return (
<section className="flex min-h-0 flex-1 flex-col gap-2">
<div className="flex shrink-0 items-baseline justify-between gap-2">
Expand Down Expand Up @@ -121,6 +135,12 @@ const ActiveModelsSection = ({
/>
</div>

{catalogNote ? (
<p className="m-0 border-0 border-b border-solid border-colorSplit px-3 py-2 text-colorTextTertiary">
{catalogNote}
</p>
) : null}

{visible.length === 0 ? (
<p className="m-0 border-0 border-b border-solid border-colorSplit px-3 py-3 text-colorTextSecondary">
{options.length === 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ const ProviderConnectionCard = ({

const credentialStatus = probe?.credential.status ?? null
const discovered = probe?.discovery.status === "fetched"
const discoveryStatus = probe?.discovery.status ?? null

// Standard providers name a family the harness catalog knows; the credential-set kinds carry
// whatever the endpoint serves, so their list comes from discovery and manual entry alone.
Expand Down Expand Up @@ -469,8 +470,10 @@ const ProviderConnectionCard = ({
>
{credentialFailed ? (
<WarningCircle size={14} className="mt-0.5 shrink-0" />
) : (
) : credentialStatus === "valid" ? (
<span className="mt-1.5 size-1.5 shrink-0 rounded-full bg-colorSuccess" />
) : (
<span className="mt-1.5 size-1.5 shrink-0 rounded-full bg-colorWarning" />
Comment on lines 470 to +476
Comment on lines +473 to +476

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use non-success text styling for unconfirmed credentials.

The new amber dot is inside a parent span that still uses text-colorSuccess for every non-failed status. An unknown or pending verdict can therefore appear with green status text. Apply the same valid/failed/other classification to the parent text color.

)}
<span>
{statusLine}
Expand Down Expand Up @@ -514,6 +517,8 @@ const ProviderConnectionCard = ({
<ActiveModelsSection
options={modelOptions}
manualPlaceholder={manualModelPlaceholderForKind(kind)}
title={title}
discoveryStatus={discoveryStatus}
onToggle={toggleModel}
onSelectAll={() => setCheckedModels(modelOptions.map((option) => option.id))}
onClear={() => setCheckedModels([])}
Expand Down
Loading