joaomarcos
e331b834fe
fix(usage): preserve OpenAI-wire cache writes at canonical accounting boundary ( #85706 )
...
Salvaged from PR #85702 by @JoaoMarcos44, composed onto the mapping-safe
_usage_get reads (PR #74591 by @RelaxJonh) and the flat cached_tokens /
Anthropic-name fallbacks (PRs #66105 , #52571 ):
- cache-write precedence in the chat_completions branch:
details.cache_write_tokens > details.cache_creation_input_tokens >
usage.cache_creation_input_tokens > usage.cache_write_tokens
- codex_responses branch reads details.cache_write_tokens (GPT-5.6+
documented name) with cache_creation_tokens fallback (from PR #70522 )
- _usage_count(): clamp malformed negative counters to 0
- all reads in every branch are mapping-safe via _usage_get
2026-08-13 22:09:37 -07:00
..
2026-08-01 21:17:51 -04:00
2026-08-08 18:11:02 -07:00
2026-07-24 11:45:57 -07:00
2026-08-12 19:13:32 -07:00
2026-08-14 12:41:26 +10:00
2026-08-07 10:11:05 -07:00
2026-07-22 10:58:22 -07:00
2026-08-13 23:15:25 +05:30
2026-08-14 00:59:38 +05:30
2026-08-13 02:03:40 -07:00
2026-08-13 12:30:29 -07:00
2026-08-02 10:02:33 -07:00
2026-07-26 23:41:54 -07:00
2026-08-09 16:13:52 +05:30
2026-07-21 13:54:11 -05:00
2026-07-23 11:45:07 -07:00
2026-07-22 18:08:59 -05:00
2026-07-29 11:53:39 -07:00
2026-07-29 11:53:39 -07:00
2026-08-10 10:45:44 -07:00
2026-08-12 19:13:32 -07:00
2026-08-13 12:31:02 -07:00
2026-08-13 01:51:24 -07:00
2026-08-12 12:42:39 +05:30
2026-07-29 15:28:15 -07:00
2026-07-26 18:06:21 -07:00
2026-08-09 16:20:48 +05:30
2026-08-08 23:09:45 +05:30
2026-08-12 18:41:59 -07:00
2026-08-13 10:45:15 -07:00
2026-08-13 23:10:16 +05:30
2026-08-12 11:04:45 -07:00
2026-08-08 19:17:02 -07:00
2026-08-08 12:32:23 -07:00
2026-07-28 21:36:23 +00:00
2026-08-08 15:10:35 +05:30
2026-08-03 18:21:17 +05:30
2026-08-06 03:16:26 +05:30
2026-08-13 09:34:36 -07:00
2026-08-13 09:36:02 -07:00
2026-08-08 05:21:09 -07:00
2026-08-12 11:04:45 -07:00
2026-08-05 17:21:01 -07:00
2026-07-26 20:59:16 -07:00
2026-07-29 15:28:15 -07:00
2026-08-08 14:49:28 -07:00
2026-08-12 19:13:32 -07:00
2026-08-14 03:31:22 +05:30
2026-08-14 02:04:24 +05:30
2026-08-02 22:15:20 +05:30
2026-07-26 12:54:45 -07:00
2026-08-08 05:09:43 -07:00
2026-07-29 11:53:39 -07:00
2026-07-23 08:19:14 -07:00
2026-08-13 23:43:15 +05:30
2026-08-13 23:15:25 +05:30
2026-08-07 16:57:11 +05:30
2026-08-13 23:10:16 +05:30
2026-08-13 23:10:16 +05:30
2026-08-14 02:03:54 +05:30
2026-08-14 03:31:22 +05:30
2026-08-13 03:04:45 -07:00
2026-07-24 17:10:39 -07:00
2026-07-22 12:10:58 -05:00
2026-08-02 15:01:11 -07:00
2026-08-12 16:25:20 -07:00
2026-08-12 18:38:25 -07:00
2026-08-13 01:06:51 -05:00
2026-08-09 15:25:12 +05:30
2026-08-13 15:24:47 +05:30
2026-08-06 22:02:37 -05:00
2026-08-12 13:37:04 -04:00
2026-08-13 23:10:16 +05:30
2026-08-08 23:46:17 -07:00
2026-08-13 10:45:15 -07:00
2026-08-08 23:46:17 -07:00
2026-07-29 10:13:50 -07:00
2026-08-02 09:59:52 -07:00
2026-08-02 16:16:36 -07:00
2026-08-13 09:36:02 -07:00
2026-07-29 12:20:34 -07:00
2026-08-09 15:25:12 +05:30
2026-07-29 15:28:15 -07:00
2026-08-06 03:16:26 +05:30
2026-08-08 15:10:24 +05:30
2026-08-02 22:15:20 +05:30
2026-08-03 20:43:34 +05:30
2026-07-22 08:11:09 +05:30
2026-08-12 16:34:58 -07:00
2026-08-06 23:08:23 -05:00
2026-08-09 04:33:58 -05:00
2026-08-03 22:53:32 +05:30
2026-08-13 09:34:36 -07:00
2026-08-13 09:34:36 -07:00
2026-07-24 11:45:57 -07:00
2026-08-12 19:01:30 -07:00
2026-08-12 19:13:32 -07:00
2026-08-12 19:13:32 -07:00
2026-08-13 23:15:25 +05:30
2026-08-08 12:31:19 -07:00
2026-08-08 11:24:45 -07:00
2026-07-26 17:47:51 -07:00
2026-08-13 22:09:37 -07:00
2026-08-07 10:11:05 -07:00
2026-08-12 01:15:25 -07:00
2026-08-08 14:49:28 -07:00
2026-08-12 19:13:32 -07:00
2026-08-12 19:13:32 -07:00