Commit 2769276
committed
fix(billing): scope rate limit display per-provider, remove unsolicited advice
Problem: Rate limit info was stored globally in session state, causing
wrong provider's rate limit to appear in /usage (e.g. GitHub Copilot's
weekly limit showing when viewing Z.AI billing). Also included unsolicited
model advice ("Use GLM-4.7 for routine tasks") which is not appropriate.
Solution:
- Add _get_current_provider() helper to ResponseHandler to retrieve current
provider from session state
- Store rate limits in $state->{rate_limits}{$provider}{...} instead of
flat $state->{rate_limit_code}/$state->{rate_limit_until}
- Update _display_copilot_billing and _display_zai_billing to read from
provider-scoped rate limit data
- Remove GLM-5.x explanation line (already shown in Cost Rate field)
- Remove "Use GLM-4.7 for routine tasks" advice (unsolicited)
Files changed:
- lib/CLIO/Core/API/ResponseHandler.pm (4 locations updated)
- lib/CLIO/UI/Commands/Billing.pm (rate limit reads + removed advice)1 parent f2d6b36 commit 2769276
2 files changed
Lines changed: 56 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
57 | 76 | | |
58 | 77 | | |
59 | 78 | | |
| |||
413 | 432 | | |
414 | 433 | | |
415 | 434 | | |
416 | | - | |
| 435 | + | |
| 436 | + | |
417 | 437 | | |
418 | 438 | | |
419 | | - | |
420 | | - | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
421 | 443 | | |
422 | 444 | | |
423 | 445 | | |
| |||
506 | 528 | | |
507 | 529 | | |
508 | 530 | | |
509 | | - | |
510 | | - | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
511 | 536 | | |
512 | 537 | | |
513 | 538 | | |
| |||
895 | 920 | | |
896 | 921 | | |
897 | 922 | | |
| 923 | + | |
898 | 924 | | |
899 | 925 | | |
900 | | - | |
901 | | - | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
902 | 930 | | |
903 | 931 | | |
904 | 932 | | |
| |||
982 | 1010 | | |
983 | 1011 | | |
984 | 1012 | | |
985 | | - | |
| 1013 | + | |
| 1014 | + | |
986 | 1015 | | |
987 | 1016 | | |
988 | | - | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
989 | 1020 | | |
990 | 1021 | | |
991 | 1022 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
| |||
239 | 241 | | |
240 | 242 | | |
241 | 243 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
| 244 | + | |
| 245 | + | |
247 | 246 | | |
248 | | - | |
249 | 247 | | |
250 | 248 | | |
251 | | - | |
252 | | - | |
253 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
254 | 253 | | |
255 | 254 | | |
256 | 255 | | |
| |||
447 | 446 | | |
448 | 447 | | |
449 | 448 | | |
450 | | - | |
451 | | - | |
452 | 449 | | |
453 | | - | |
| 450 | + | |
454 | 451 | | |
455 | | - | |
456 | | - | |
457 | | - | |
| 452 | + | |
| 453 | + | |
458 | 454 | | |
459 | 455 | | |
460 | | - | |
461 | | - | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
462 | 459 | | |
463 | | - | |
| 460 | + | |
464 | 461 | | |
465 | 462 | | |
466 | 463 | | |
| |||
0 commit comments