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
5 changes: 5 additions & 0 deletions .changeset/brave-ties-say.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@inkeep/agents-manage-ui": patch
---

Distinguish between same agent name in cost page
23 changes: 16 additions & 7 deletions agents-manage-ui/src/components/cost/cost-dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ export function CostDashboard({ tenantId, projectId, startTime, endTime }: CostD
isLoading={summariesLoading}
error={summariesError}
groupLabel="Agent"
formatGroupKey={(agentId) => agentNamesById.get(agentId) || agentId}
formatGroupKey={(agentId) => {
const name = agentNamesById.get(agentId);
return name ? `${name} (${agentId})` : agentId;
}}
/>
<UsageBreakdownTable
title="Cost by Provider"
Expand Down Expand Up @@ -360,8 +363,10 @@ function UsageBreakdownTable({
<TableBody>
{data.map((row) => (
<TableRow key={row.groupKey}>
<TableCell className="font-mono text-sm">
{formatGroupKey ? formatGroupKey(row.groupKey) : row.groupKey}
<TableCell className="font-mono text-sm max-w-[300px]">
<span className="block truncate" title={row.groupKey}>
{formatGroupKey ? formatGroupKey(row.groupKey) : row.groupKey}
</span>
</TableCell>
<TableCell className="text-right font-medium">
{formatCost(row.totalEstimatedCostUsd)}
Expand Down Expand Up @@ -485,11 +490,15 @@ function UsageEventsTable({
<TableCell className="text-right text-muted-foreground">
{formatTokens(event.outputTokens)}
</TableCell>
<TableCell className="font-mono text-xs">
{event.agentName || event.agentId || '—'}
<TableCell className="font-mono text-xs" title={event.agentId || undefined}>
{event.agentName && event.agentId
? `${event.agentName} (${event.agentId})`
: event.agentName || event.agentId || '—'}
</TableCell>
<TableCell className="font-mono text-xs">
{event.subAgentName || event.subAgentId || '—'}
<TableCell className="font-mono text-xs" title={event.subAgentId || undefined}>
{event.subAgentName && event.subAgentId
? `${event.subAgentName} (${event.subAgentId})`
: event.subAgentName || event.subAgentId || '—'}
</TableCell>
<TableCell>
<Badge variant="outline" className="font-mono text-xs">
Expand Down
Loading