fix(ai): preserve cache_write_tokens in completions stream usage closes #2802

This commit is contained in:
Mario Zechner
2026-04-04 21:39:11 +02:00
parent a7acef92a7
commit 6044cabb15
4 changed files with 185 additions and 8 deletions

View File

@@ -2,6 +2,10 @@
## [Unreleased]
### Fixed
- Fixed OpenAI-compatible completions streaming usage to preserve `prompt_tokens_details.cache_write_tokens` and normalize OpenRouter `cached_tokens` to previous-request cache hits only, preventing cache read/write double counting in `usage` and cost calculation ([#2802](https://github.com/badlogic/pi-mono/issues/2802))
## [0.65.0] - 2026-04-03
### Added