Commit 5311e0c
committed
fix: Make context token counter more reliable
- Only consider API requests with valid token information
- Skip messages with invalid/missing token data
- Prevent counter from resetting on action approval messages
- Ensure both tokensIn and tokensOut are valid numbers
This makes the context token counter more stable and accurate
by only updating on valid API responses with complete token data.1 parent 97fe13d commit 5311e0c
File tree
1 file changed
+12
-4
lines changed1 file changed
+12
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
| |||
0 commit comments