hide context usage if no request sent

This commit is contained in:
tanzhenxin 2026-01-16 14:03:20 +08:00
parent f4d4844364
commit 5c6c3b2cf6
2 changed files with 43 additions and 28 deletions

View file

@ -17,6 +17,10 @@ export const ContextUsageDisplay = ({
model: string;
terminalWidth: number;
}) => {
if (promptTokenCount === 0) {
return null;
}
const percentage = promptTokenCount / tokenLimit(model);
const percentageUsed = (percentage * 100).toFixed(1);