rcourtman
2390987e12
Account Anthropic prompt-cache usage instead of dropping it
...
The Anthropic client logged cache_creation_input_tokens and
cache_read_input_tokens and then returned only input_tokens and
output_tokens, so every cached Patrol run reached the usage ledger, the
cost preview, the budget check and the weekly digest with its cache
buckets missing. Pulse #2350 reproduced the loss on both the Chat and
ChatStream paths, and #2118 's reporter was told to trust the provider's
billing view over Pulse's totals until this was fixed.
Both response paths now carry the two buckets as fields disjoint from
InputTokens (streaming assigns them from message_start and the final
cumulative message_delta rather than summing). The agentic loops, Patrol
responses and run records sum them beside the ordinary totals, the usage
ledger and its persisted copies keep them, and cost.EstimateUsageUSD
prices each bucket at Anthropic's published cache rates (5-minute write
1.25x, read 0.1x of the input rate), falling back to the input rate for
providers without a known cache price. Spend summaries, the digest spend,
the cost projection medians and the usage export expose the buckets and
price them the same way. InputTokens keeps its meaning everywhere, so the
telemetry token buckets are unchanged.
2026-10-03 09:31:34 +01:00
..
2026-09-23 06:01:17 +01:00
2026-07-25 00:21:35 +01:00
2026-03-18 16:06:30 +00:00
2026-10-03 09:31:34 +01:00
2026-03-18 16:06:30 +00:00
2026-05-21 15:15:23 +01:00
2026-10-03 09:31:34 +01:00
2026-09-02 00:19:08 +01:00
2026-05-15 12:22:52 +01:00
2026-08-13 21:56:53 +01:00
2026-05-25 18:02:28 +01:00
2026-03-29 14:18:20 +01:00
2026-03-18 16:06:30 +00:00
2026-09-24 17:43:50 +01:00
2026-08-06 15:51:06 +01:00
2026-07-16 15:17:45 +01:00
2026-03-18 16:06:30 +00:00
2026-10-03 09:31:34 +01:00
2026-04-01 14:47:58 +01:00
2026-09-07 17:24:25 +01:00
2026-07-16 13:40:38 +01:00
2026-10-01 19:56:47 +01:00
2026-09-07 17:24:25 +01:00
2026-05-01 20:28:11 +01:00
2026-07-16 15:17:45 +01:00
2026-03-30 13:34:08 +01:00
2026-03-30 13:34:08 +01:00
2026-01-25 21:08:44 +00:00
2026-05-07 01:24:57 +01:00
2026-05-07 01:24:57 +01:00
2025-12-29 13:49:04 +00:00
2026-03-18 16:06:30 +00:00
2026-07-19 15:11:01 +01:00
2026-07-19 15:11:01 +01:00
2026-07-19 15:11:01 +01:00
2026-09-02 07:02:51 +01:00
2026-09-02 07:02:51 +01:00
2025-12-29 13:49:04 +00:00
2026-01-01 22:29:15 +00:00
2025-12-12 11:29:47 +00:00
2026-03-18 16:06:30 +00:00
2025-12-12 14:26:10 +00:00
2026-10-03 09:31:34 +01:00
2026-10-03 09:31:34 +01:00
2026-05-10 21:57:39 +01:00
2026-09-24 11:52:30 +01:00
2026-07-25 00:21:35 +01:00
2026-07-11 11:25:52 +01:00
2026-09-02 07:02:51 +01:00
2026-05-17 21:59:39 +01:00
2026-08-10 19:53:08 +01:00
2026-04-09 20:15:17 +01:00
2026-01-25 21:08:44 +00:00
2026-09-02 07:02:51 +01:00
2026-09-02 07:02:51 +01:00
2026-07-12 05:23:02 +01:00
2026-07-13 21:51:33 +01:00
2026-05-12 22:23:55 +01:00
2026-05-12 22:23:55 +01:00
2026-01-30 19:02:14 +00:00
2026-07-30 15:47:55 +01:00
2026-01-30 19:02:14 +00:00
2026-09-02 07:55:42 +01:00
2026-09-02 07:02:51 +01:00
2026-09-07 17:24:25 +01:00
2026-01-30 19:02:14 +00:00
2026-06-23 17:26:15 +01:00
2026-06-10 09:38:52 +01:00
2026-06-09 21:42:21 +01:00
2026-05-13 11:35:24 +01:00
2026-05-13 05:42:25 +01:00
2026-09-01 12:20:52 +01:00
2026-09-01 12:20:52 +01:00
2026-06-30 10:37:54 +01:00
2026-09-02 07:55:42 +01:00
2026-07-13 16:05:44 +01:00
2026-07-17 17:29:22 +01:00
2026-06-09 21:42:21 +01:00
2026-05-13 01:13:38 +01:00
2026-03-30 13:34:08 +01:00
2026-05-13 02:41:45 +01:00
2026-09-02 07:02:51 +01:00
2026-09-02 07:02:51 +01:00
2026-03-18 16:06:30 +00:00
2026-08-14 01:41:46 +01:00
2026-02-01 10:12:23 +00:00
2026-06-23 17:26:15 +01:00
2026-06-23 17:26:15 +01:00
2026-06-09 21:42:21 +01:00
2026-05-13 04:18:27 +01:00
2026-05-13 04:18:27 +01:00
2026-09-07 17:24:25 +01:00
2026-09-24 11:52:30 +01:00
2026-09-24 11:52:30 +01:00
2026-09-08 02:08:15 +01:00
2026-09-06 21:23:01 +01:00
2026-07-10 21:22:06 +01:00
2026-07-23 22:19:35 +01:00
2026-08-06 18:11:51 +01:00
2026-07-28 12:17:25 +01:00
2026-08-06 18:11:51 +01:00
2026-03-18 16:06:30 +00:00
2026-03-18 17:22:24 +00:00
2026-07-20 20:45:39 +01:00
2026-09-24 11:52:30 +01:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2025-12-29 13:49:04 +00:00
2025-12-12 09:45:57 +00:00
2026-03-18 16:06:30 +00:00
2026-06-08 07:21:38 +01:00
2026-07-10 00:14:01 +01:00
2026-07-24 12:35:31 +01:00
2026-07-06 10:08:36 +01:00
2026-08-28 11:35:41 +01:00
2026-09-24 11:52:30 +01:00
2026-09-24 11:52:30 +01:00
2026-09-06 03:59:37 +01:00
2026-02-01 18:07:41 +00:00
2026-10-03 09:31:34 +01:00
2026-07-17 23:23:38 +01:00
2026-08-14 01:41:46 +01:00
2026-08-14 01:41:46 +01:00
2026-08-21 21:05:54 +01:00
2026-07-14 19:23:36 +01:00
2026-10-03 09:31:34 +01:00
2026-10-03 09:31:34 +01:00
2026-05-07 18:24:47 +01:00
2026-09-06 03:59:37 +01:00
2026-10-03 09:31:34 +01:00
2026-10-03 09:31:34 +01:00
2026-07-18 11:59:05 +01:00
2026-08-17 20:02:47 +01:00
2026-06-27 22:18:09 +01:00
2026-07-14 22:33:40 +01:00
2026-09-06 21:23:01 +01:00
2026-08-06 15:51:06 +01:00
2026-02-04 19:56:12 +00:00
2026-08-14 01:41:46 +01:00
2026-10-03 09:31:34 +01:00
2026-08-14 03:11:10 +01:00
2026-08-21 21:05:54 +01:00
2026-09-06 03:59:37 +01:00
2026-05-01 20:28:11 +01:00
2026-06-10 09:38:52 +01:00
2026-02-01 16:27:25 +00:00
2026-09-04 09:30:11 +01:00
2026-07-19 15:11:02 +01:00
2026-07-19 15:11:02 +01:00
2026-09-02 07:55:42 +01:00
2026-09-02 07:55:42 +01:00
2026-08-06 18:11:51 +01:00
2026-09-05 22:29:48 +01:00
2026-10-03 09:31:34 +01:00
2026-08-15 20:58:49 +01:00
2026-09-21 17:18:32 +01:00
2026-09-21 17:18:32 +01:00
2026-08-14 12:52:51 +01:00
2026-09-21 17:18:32 +01:00
2026-08-14 12:52:51 +01:00
2026-09-04 09:11:02 +01:00
2026-09-21 17:18:32 +01:00
2026-09-10 18:21:29 +01:00
2026-08-15 13:12:30 +01:00
2026-09-02 07:55:42 +01:00
2026-05-01 20:28:11 +01:00
2026-05-01 20:28:11 +01:00
2026-07-22 16:29:44 +01:00
2026-08-15 00:57:51 +01:00
2026-09-05 22:29:48 +01:00
2026-08-17 20:02:47 +01:00
2026-03-30 13:34:08 +01:00
2026-08-15 11:37:02 +01:00
2026-07-14 22:33:40 +01:00
2026-08-17 20:02:47 +01:00
2026-10-03 09:31:34 +01:00
2026-07-28 12:17:25 +01:00
2026-09-05 22:29:48 +01:00
2026-09-05 22:29:48 +01:00
2026-08-15 11:37:02 +01:00
2026-03-18 16:06:30 +00:00
2026-06-29 18:17:24 +01:00
2026-03-18 16:06:30 +00:00
2026-06-29 18:17:24 +01:00
2026-08-19 18:10:35 +01:00
2026-08-19 18:10:35 +01:00
2026-03-18 16:06:30 +00:00
2026-06-09 21:47:14 +01:00
2026-01-24 22:41:43 +00:00
2026-09-06 03:59:37 +01:00
2026-07-15 20:42:17 +01:00
2026-07-15 20:42:17 +01:00
2026-05-13 00:28:24 +01:00
2026-08-14 03:11:10 +01:00
2026-08-15 12:38:41 +01:00
2026-10-03 09:31:34 +01:00
2025-12-12 14:11:28 +00:00
2026-05-10 19:30:54 +01:00
2026-05-10 19:30:54 +01:00
2026-05-10 21:23:12 +01:00
2026-10-03 09:31:34 +01:00
2026-05-10 21:08:51 +01:00
2026-10-03 09:31:34 +01:00
2026-06-09 09:43:21 +01:00
2026-06-09 09:43:21 +01:00
2026-06-08 15:21:51 +01:00
2026-06-09 09:43:21 +01:00
2026-03-19 04:07:47 +00:00
2026-03-19 04:07:47 +00:00
2026-03-18 16:06:30 +00:00
2026-03-30 13:34:08 +01:00
2026-08-02 20:30:38 +01:00
2026-03-18 16:06:30 +00:00
2025-12-10 08:35:24 +00:00
2026-08-29 08:18:16 +01:00
2026-07-22 16:29:44 +01:00
2026-06-08 03:48:33 +01:00
2026-07-17 17:29:22 +01:00
2026-05-15 16:28:17 +01:00
2026-09-06 20:09:54 +01:00
2026-07-12 13:29:21 +01:00
2026-07-12 13:29:21 +01:00
2026-07-31 17:57:26 +01:00
2026-10-03 09:31:34 +01:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00