diff --git a/webview-ui/src/components/chat/ContextCondenseRow.tsx b/webview-ui/src/components/chat/ContextCondenseRow.tsx index 9664b03e00..c2fdba802d 100644 --- a/webview-ui/src/components/chat/ContextCondenseRow.tsx +++ b/webview-ui/src/components/chat/ContextCondenseRow.tsx @@ -11,6 +11,11 @@ export const ContextCondenseRow = ({ cost, prevContextTokens, newContextTokens, const { t } = useTranslation() const [isExpanded, setIsExpanded] = useState(false) + // Handle null/undefined token values to prevent crashes + const prevTokens = prevContextTokens ?? 0 + const newTokens = newContextTokens ?? 0 + const displayCost = cost ?? 0 + return (