-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Token state not showing on load, or after message is finished. #5606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f19a9aa
fd801ae
a36c3fd
a28c5db
c400948
24875ed
43c9742
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -443,12 +443,12 @@ function BaseChatContent({ | |
| commandHistory={commandHistory} | ||
| initialValue={input || ''} | ||
| setView={setView} | ||
| totalTokens={tokenState?.totalTokens ?? sessionTokenCount} | ||
| totalTokens={tokenState?.totalTokens || sessionTokenCount} | ||
| accumulatedInputTokens={ | ||
| tokenState?.accumulatedInputTokens ?? sessionInputTokens ?? localInputTokens | ||
| tokenState?.accumulatedInputTokens || sessionInputTokens || localInputTokens | ||
|
||
| } | ||
| accumulatedOutputTokens={ | ||
| tokenState?.accumulatedOutputTokens ?? sessionOutputTokens ?? localOutputTokens | ||
| tokenState?.accumulatedOutputTokens || sessionOutputTokens || localOutputTokens | ||
|
||
| } | ||
|
Comment on lines
+446
to
452
|
||
| droppedFiles={droppedFiles} | ||
| onFilesProcessed={() => setDroppedFiles([])} // Clear dropped files after processing | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using logical OR (||) instead of nullish coalescing (??) means that a valid token count of 0 will be incorrectly treated as falsy and fall back to sessionTokenCount. Use ?? to only fallback on null/undefined values.