fix(ai): capture usage from choice.usage for non-standard OpenAI-compatible providers
Some OpenAI-compatible providers (e.g., Moonshot/Kimi) return usage data in chunk.choices[0].usage instead of the standard chunk.usage. Extract usage parsing into a helper and check choice.usage as fallback. closes #2017
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
### Fixed
|
||||
|
||||
- Fixed GitHub Copilot device-code login polling to respect OAuth slow-down intervals, wait before the first token poll, and include a clearer clock-drift hint in WSL/VM environments when repeated slow-downs lead to timeout.
|
||||
- Fixed usage statistics not being captured for OpenAI-compatible providers that return usage in `choice.usage` instead of the standard `chunk.usage` (e.g., Moonshot/Kimi) ([#2017](https://github.com/badlogic/pi-mono/issues/2017))
|
||||
|
||||
## [0.57.1] - 2026-03-07
|
||||
|
||||
|
||||
Reference in New Issue
Block a user