From 720ec1c77b868b8a7cb78c31908e4228aab9832f Mon Sep 17 00:00:00 2001 From: Matt Cowger Date: Mon, 18 May 2026 22:22:48 -0700 Subject: [PATCH] fix(frontend): read provider-reported cost from both SSE and usage.cost_details formats The tooltip only read data.request_cost_usd, which works for SSE : cost comments but not for the newer usage.cost_details path where the value is stored at data.cost_details.total_cost. This caused the tooltip to show /bin/bash while the actual log row displayed the correct cost. --- packages/frontend/src/components/ui/CostToolTip.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/components/ui/CostToolTip.tsx b/packages/frontend/src/components/ui/CostToolTip.tsx index 2cc04587..27f93b97 100644 --- a/packages/frontend/src/components/ui/CostToolTip.tsx +++ b/packages/frontend/src/components/ui/CostToolTip.tsx @@ -113,12 +113,14 @@ export const CostToolTip: React.FC = ({ source, costMetadata, ); } else if (s === 'provider_reported') { + // Support both SSE `: cost` format (request_cost_usd) and usage.cost_details format + const reportedCost = data.request_cost_usd ?? data.cost_details?.total_cost; content = (
Source: Provider Reported
Cost: - ${formatRate(data.request_cost_usd)} + ${formatRate(reportedCost)} {data.cache_savings_usd !== undefined && ( <>