Repository navigation
Commit b41c0c9
fix(acp): respect provider currency in usage_update instead of hardcoding USD
The usage_update ACP event hardcodes currency: "USD" regardless of the
provider's actual currency configuration. This causes non-USD providers
(e.g. EUR-priced custom providers) to report incorrect currency labels.
Add an optional `currency` field to the ProviderCost schema (defaults to
"USD" when omitted for backward compatibility). Thread the configured
currency through to both usage_update call sites (usage.ts layer and
service.ts ACP client) using a cached lookup pattern matching the
existing contextLimit implementation.
Fixes anomalyco#38667
Signed-off-by: kagura-agent <[email protected]>1 parent b471c2b commit b41c0c9
3 files changed
Lines changed: 76 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
| 619 | + | |
619 | 620 | | |
620 | 621 | | |
621 | 622 | | |
| |||
636 | 637 | | |
637 | 638 | | |
638 | 639 | | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
639 | 660 | | |
640 | 661 | | |
641 | 662 | | |
| |||
665 | 686 | | |
666 | 687 | | |
667 | 688 | | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
668 | 695 | | |
669 | 696 | | |
670 | 697 | | |
| |||
673 | 700 | | |
674 | 701 | | |
675 | 702 | | |
676 | | - | |
| 703 | + | |
677 | 704 | | |
678 | 705 | | |
679 | 706 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
125 | 133 | | |
126 | 134 | | |
127 | 135 | | |
| |||
180 | 188 | | |
181 | 189 | | |
182 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
183 | 223 | | |
184 | 224 | | |
185 | 225 | | |
| |||
205 | 245 | | |
206 | 246 | | |
207 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
208 | 254 | | |
209 | 255 | | |
210 | 256 | | |
| |||
213 | 259 | | |
214 | 260 | | |
215 | 261 | | |
216 | | - | |
| 262 | + | |
217 | 263 | | |
218 | 264 | | |
219 | 265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1059 | 1059 | | |
1060 | 1060 | | |
1061 | 1061 | | |
| 1062 | + | |
1062 | 1063 | | |
1063 | 1064 | | |
1064 | 1065 | | |
| |||
0 commit comments