diff --git a/apps/mobile/src/features/threads/SubagentRow.tsx b/apps/mobile/src/features/threads/SubagentRow.tsx index bef52c4b7c756ea3e3f0ff888cc73e4831044e88..14adfdfa411b67748eeda63f73742daf008e9280 100644 --- a/apps/mobile/src/features/threads/SubagentRow.tsx +++ b/apps/mobile/src/features/threads/SubagentRow.tsx @@ -1,4 +1,5 @@ import { scopeProjectRef, scopeThreadRef } from "@t3tools/client-runtime/environment"; +import { resolveProviderInstanceDisplayName } from "@t3tools/client-runtime/state/provider-instance-display"; import { resolveSubagentMetadata } from "@t3tools/client-runtime/state/subagent-display"; import type { EnvironmentId, OrchestrationV2Subagent } from "@t3tools/contracts"; import type { ReactNode } from "react"; @@ -125,7 +126,7 @@ function SubagentMetadata(props: { size={12} /> - {provider?.displayName ? `${provider.displayName} · ` : ""} + {provider ? `${resolveProviderInstanceDisplayName(provider)} · ` : ""} {modelLabel} {workspace.map(({ label, value }) => ( diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 8879fe8f1f38e7800407167e77cde7382f0d9257..e001dad666d804439c081614384449b2a22bee2b 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -315,6 +315,7 @@ import { applyProviderInstanceSettings, deriveProviderInstanceEntries, NO_PROVIDER_MODEL_SELECTION, + shouldShowInstanceBadge, sortProviderInstanceEntries, } from "../providerInstances"; import { @@ -11111,6 +11112,13 @@ export default function ChatView(props: ChatViewProps) { {showProviderSubagentBar ? ( ) : null} {props.modelLabel} diff --git a/apps/web/src/components/chat/SubagentTooltipContent.tsx b/apps/web/src/components/chat/SubagentTooltipContent.tsx index d638736759a4368ed416e625f9e1b9023720ec4a..11a654482541f2d45e38bd49302989bf685273e0 100644 --- a/apps/web/src/components/chat/SubagentTooltipContent.tsx +++ b/apps/web/src/components/chat/SubagentTooltipContent.tsx @@ -23,12 +23,15 @@ import { ThreadHoverCard } from "../ThreadHoverCard"; import { MiddleTruncate } from "../ui/middle-truncate"; import { ProviderInstanceIcon } from "./ProviderInstanceIcon"; import { cn } from "~/lib/utils"; +import { deriveProviderInstanceEntries, shouldShowInstanceBadge } from "../../providerInstances"; /** Geometry and preview limits stay identical in lineage and timeline tooltips. */ export function SubagentTooltipContent(props: { title: string; model: string | null; provider?: ServerProvider | undefined; + /** The environment's instances; with several accounts on one provider, the card names this one. */ + providers?: ReadonlyArray | undefined; driver?: ProviderDriverKind | undefined; elapsed?: ReactNode; parentThread?: Pick | undefined; @@ -42,6 +45,9 @@ export function SubagentTooltipContent(props: { const { modelLabel, workspace: metadata } = resolveSubagentMetadata(props); const preview = subagentDetailPreview(props); const driver = props.provider?.driver ?? props.driver; + const entries = deriveProviderInstanceEntries(props.providers ?? []); + const entry = entries.find((candidate) => candidate.instanceId === props.provider?.instanceId); + const showInstanceBadge = entry !== undefined && shouldShowInstanceBadge(entry, entries); const working = ["running", "in_progress", "pending", "waiting"].includes(props.status); const failed = ["failed", "error"].includes(props.status); const StatusIcon = working @@ -57,14 +63,21 @@ export function SubagentTooltipContent(props: { {driver ? ( ) : ( )} - {modelLabel} + + {showInstanceBadge ? `${modelLabel} · ${entry.displayName}` : modelLabel} +
} status={agent.status} diff --git a/apps/web/src/components/chat/V2LifecycleRow.tsx b/apps/web/src/components/chat/V2LifecycleRow.tsx index ea453a2b0c35685b983ae15001d3ce7c05bf04dd..e2506695ca5a918b784ea4035ec1bd33ca95d4b9 100644 --- a/apps/web/src/components/chat/V2LifecycleRow.tsx +++ b/apps/web/src/components/chat/V2LifecycleRow.tsx @@ -217,6 +217,7 @@ export function V2LifecycleRow(props: { provider={props.providerStatuses.find( (provider) => provider.instanceId === item.providerInstanceId, )} + providers={props.providerStatuses} title={formatSubagentDisplayTitle(item.title ?? "Subagent")} result={item.result} progress={item.progress} @@ -374,6 +375,7 @@ export function SubagentNotificationLink(props: { provider={props.providerStatuses.find( (provider) => provider.instanceId === agent.providerInstanceId, )} + providers={props.providerStatuses} title={formatSubagentDisplayTitle(agent.title ?? "Subagent")} result={agent.result} progress={agent.progress} @@ -395,6 +397,7 @@ function SubagentTimelineLink(props: { readonly subagentId: NodeId; readonly driver: ProviderDriverKind; readonly provider: ServerProvider | undefined; + readonly providers: ReadonlyArray; readonly title: string; readonly result: string | null; readonly progress: string | undefined; @@ -538,6 +541,7 @@ function SubagentTimelineTooltip( title={formatSubagentDisplayTitle(child?.title ?? props.title)} model={props.model} provider={props.provider} + providers={props.providers} driver={props.driver} elapsed={props.elapsed} status={props.status}