Commit 86eb383
committed
fix: prevent context token counter flickering during API requests
Maintains the last valid context token count between API requests by:
- Adding tracking of last valid context tokens
- Using last known value as fallback when current request lacks token data
- Only updating when new valid token counts are available
This prevents the context counter from flickering to "-" during tool calls
and API request transitions, improving the UI stability.1 parent 9056a59 commit 86eb383
File tree
1 file changed
+10
-4
lines changed1 file changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| |||
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
74 | 82 | | |
75 | 83 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 84 | + | |
| 85 | + | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
| |||
0 commit comments