diff --git a/web/src/components/AssistantChat/StatusBar.tsx b/web/src/components/AssistantChat/StatusBar.tsx index c1e14945..557a967c 100644 --- a/web/src/components/AssistantChat/StatusBar.tsx +++ b/web/src/components/AssistantChat/StatusBar.tsx @@ -177,6 +177,13 @@ export function StatusBar(props: { const percentageUsed = Math.min(100, Math.round((props.contextSize / maxContextSize) * 100)) return `ctx ${formatTokenCount(props.contextSize)}/${formatTokenCount(maxContextSize)} (${percentageUsed}%)` }, [props.contextSize, props.contextWindow, props.model, props.agentFlavor]) + const compactContextUsageLabel = useMemo(() => { + if (props.contextSize === undefined) return null + const maxContextSize = props.contextWindow ?? getContextBudgetTokens(props.model, props.agentFlavor) + if (!maxContextSize) return `ctx ${formatTokenCount(props.contextSize)}` + const percentageLeft = Math.max(0, Math.round(100 - (props.contextSize / maxContextSize) * 100)) + return `ctx ${formatTokenCount(maxContextSize).toUpperCase()}, ${percentageLeft}% left` + }, [props.contextSize, props.contextWindow, props.model, props.agentFlavor]) const cacheHitLabel = useMemo(() => { if (!props.contextCacheRead || props.contextCacheRead <= 0) return null return `cache ${formatTokenCount(props.contextCacheRead)}` @@ -211,51 +218,56 @@ export function StatusBar(props: { : null return ( -