Skip to content

Commit 5c01a17

Browse files
xiaotonngclaude
andcommitted
feat(dashboard): surface BYOK profile name in agent rows and session panel
When an agent is bound to a BYOK profile whose name differs from its raw model id, show the profile name instead of the bare model id — in the AgentTab row summary and the SessionPanel model chip — via a single backend-provided byokProfileName field. Falls back to the model id when the profile name is just the model id. Display-only; spawning still uses the binding. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent f5e0837 commit 5c01a17

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

dashboard/src/pages/agents/AgentTab.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ function brandIdForNativeSlug(slug: string | undefined | null): string {
8585

8686
interface BoundProfileInfo {
8787
profileId: string;
88+
profileName: string;
8889
providerId: string;
8990
providerName: string;
9091
providerBrand: string;
@@ -118,6 +119,7 @@ function buildBoundInfo(layer: ModelLayerSnapshot, agentId: string): BoundProfil
118119
if (!provider) return null;
119120
return {
120121
profileId: profile.id,
122+
profileName: profile.name,
121123
providerId: provider.id,
122124
providerName: provider.name,
123125
providerBrand: brandIdForProvider(provider),
@@ -689,7 +691,9 @@ function buildRowSummary(
689691
return {
690692
providerBrand: boundInfo.providerBrand,
691693
providerLabel: boundInfo.providerName,
692-
modelText: boundInfo.modelId || copy.rowSummaryNoModel,
694+
modelText: (boundInfo.profileName.trim().toLowerCase() !== boundInfo.modelId.trim().toLowerCase()
695+
? boundInfo.profileName
696+
: boundInfo.modelId) || copy.rowSummaryNoModel,
693697
effortText: agent.workflowEnabled ? 'ultra' : (boundInfo.effort || copy.rowSummaryNoEffort),
694698
};
695699
}

dashboard/src/pages/sessions/SessionPanel.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export const SessionPanel = memo(function SessionPanel({
6666
const globalEffort = agentRuntime?.selectedEffort ?? null;
6767
const globalModel = agentRuntime?.selectedModel ?? null;
6868
const byokProviderName = agentRuntime?.byokProviderName ?? null;
69+
const byokProfileName = agentRuntime?.byokProfileName ?? null;
6970
const t = useMemo(() => createT(locale), [locale]);
7071
const meta = getAgentMeta(session.agent || '');
7172
const displayState = sessionDisplayState(session);
@@ -676,7 +677,9 @@ export const SessionPanel = memo(function SessionPanel({
676677
(liveStream?.effort || session.thinkingEffort || globalEffort) || null,
677678
session.workflowEnabled ?? agentRuntime?.workflowEnabled,
678679
) || null;
679-
const displayModelShort = displayModel ? shortenModel(displayModel) : null;
680+
const displayModelShort = (byokProfileName && (!displayModel || displayModel === globalModel))
681+
? byokProfileName
682+
: (displayModel ? shortenModel(displayModel) : null);
680683
const runFailureDetail = getSessionRunFailureDetail(session, {
681684
streaming,
682685
hasLiveStream: !!liveStream,

dashboard/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export interface AgentRuntimeStatus extends AgentInfo {
6363
nativeConfig?: AgentNativeConfig | null;
6464
capabilities?: { fork?: boolean; modelSwitch?: boolean; workflow?: boolean };
6565
byokProviderName?: string | null;
66+
byokProfileName?: string | null;
6667
byokModels?: { id: string; alias: string | null }[] | null;
6768
latestVersion?: string | null;
6869
updateAvailable?: boolean;

src/dashboard/routes/agents.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ async function buildAgentStatusResponse(config = loadUserConfig(), agentOptions:
190190
const activeProfile = getActiveProfile(agentId);
191191
const byokProvider = activeProfile ? getProvider(activeProfile.providerId) : null;
192192
const byokProviderName = byokProvider?.name || null;
193+
const byokProfileName = activeProfile
194+
&& activeProfile.name.trim().toLowerCase() !== activeProfile.modelId.trim().toLowerCase()
195+
? activeProfile.name
196+
: null;
193197

194198
const nativeSelectedModel = runtimeSelectedModel || nativeConfig?.model || null;
195199
const nativeSelectedEffort = runtimeSelectedEffort || nativeConfig?.effort || null;
@@ -222,6 +226,7 @@ async function buildAgentStatusResponse(config = loadUserConfig(), agentOptions:
222226
nativeConfig,
223227
byokProviderName,
224228
byokModels,
229+
byokProfileName,
225230
capabilities: getDriverCapabilities(agentId),
226231
latestVersion: updateState?.latestVersion || null,
227232
updateAvailable: updateState?.updateAvailable || false,

0 commit comments

Comments
 (0)