fix: show token alert popover during agent responses and agent failure cases (#3536)

This commit is contained in:
Zane
2025-07-23 09:33:11 -07:00
committed by GitHub
parent 82528841ba
commit 3d5f395ce6
3 changed files with 15 additions and 9 deletions
+11 -1
View File
@@ -382,7 +382,7 @@ export default function ChatInput({
useEffect(() => {
clearAlerts();
// Only show token alerts if we have loaded the real token limit
// Always show token alerts if we have loaded the real token limit and have tokens
if (isTokenLimitLoaded && tokenLimit && numTokens && numTokens > 0) {
if (numTokens >= tokenLimit) {
// Only show error alert when limit reached
@@ -409,6 +409,16 @@ export default function ChatInput({
},
});
}
} else if (isTokenLimitLoaded && tokenLimit) {
// Always show context window info even when no tokens are present (start of conversation)
addAlert({
type: AlertType.Info,
message: 'Context window',
progress: {
current: 0,
total: tokenLimit,
},
});
}
// Add tool count alert if we have the data