- Co-Authored-By
- Claude Fable 5 <noreply@anthropic.com>
- Claude-Session
- https://claude.ai/code/session_01GoYpb8FEmdxVErsv7ABCYi
Carry the cached-token split through usage and grants
Deploy story
What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.
- pushed
- by user · WAL seq 344 · 2026-08-25T05:50:01.943443Z
Changed files
-
modified
lib/openagents/chat/gemini/stream_decoder.ex -
modified
lib/openagents/inference.ex -
modified
lib/openagents/providers/open_ai/stream_decoder.ex -
modified
lib/openagents_web/controllers/inference_proxy_controller.ex -
modified
test/openagents/chat/gemini/stream_decoder_test.exs -
modified
test/openagents/inference_test.exs -
modified
test/openagents/providers/open_ai/stream_decoder_test.exs
Diff
7 files changed, +212 -13
lib/openagents/chat/gemini/stream_decoder.ex modified +2 -2
@@ -188,7 +188,7 @@ defmodule OpenAgents.Chat.Gemini.StreamDecoder do
| 188 | 188 |
|
| 189 | 189 |
|
| 190 | 190 |
|
| 191 |
|
|
| 191 |
|
|
| 192 | 192 |
|
| 193 | 193 |
|
| 194 | 194 |
|
@@ -246,7 +246,7 @@ defmodule OpenAgents.Chat.Gemini.StreamDecoder do
| 246 | 246 |
|
| 247 | 247 |
|
| 248 | 248 |
|
| 249 |
|
|
| 249 |
|
|
| 250 | 250 |
|
| 251 | 251 |
|
| 252 | 252 |
|
lib/openagents/inference.ex modified +24 -2
@@ -383,7 +383,19 @@ defmodule OpenAgents.Inference do
| 383 | 383 |
|
| 384 | 384 |
|
| 385 | 385 |
|
| 386 |
|
|
| 386 |
|
|
| 387 |
|
|
| 388 |
|
|
| 389 |
|
|
| 390 |
|
|
| 391 |
|
|
| 392 |
|
|
| 393 |
|
|
| 394 |
|
|
| 395 |
|
|
| 396 |
|
|
| 397 |
|
|
| 398 |
|
|
| 387 | 399 |
|
| 388 | 400 |
|
| 389 | 401 |
|
@@ -412,10 +424,20 @@ defmodule OpenAgents.Inference do
| 412 | 424 |
|
| 413 | 425 |
|
| 414 | 426 |
|
| 415 |
|
|
| 427 |
|
|
| 428 |
|
|
| 429 |
|
|
| 430 |
|
|
| 416 | 431 |
|
| 417 | 432 |
|
| 418 | 433 |
|
| 434 |
|
|
| 435 |
|
|
| 436 |
|
|
| 437 |
|
|
| 438 |
|
|
| 439 |
|
|
| 440 |
|
|
| 419 | 441 |
|
| 420 | 442 |
|
| 421 | 443 |
|
lib/openagents/providers/open_ai/stream_decoder.ex modified +17 -7
@@ -201,13 +201,21 @@ defmodule OpenAgents.Providers.OpenAI.StreamDecoder do
| 201 | 201 |
|
| 202 | 202 |
|
| 203 | 203 |
|
| 204 |
|
|
| 205 |
|
|
| 206 |
|
|
| 207 |
|
|
| 208 |
|
|
| 209 |
|
|
| 210 |
|
|
| 204 |
|
|
| 205 |
|
|
| 206 |
|
|
| 207 |
|
|
| 208 |
|
|
| 209 |
|
|
| 210 |
|
|
| 211 |
|
|
| 212 |
|
|
| 213 |
|
|
| 214 |
|
|
| 215 |
|
|
| 216 |
|
|
| 217 |
|
|
| 218 |
|
|
| 211 | 219 |
|
| 212 | 220 |
|
| 213 | 221 |
|
@@ -218,6 +226,8 @@ defmodule OpenAgents.Providers.OpenAI.StreamDecoder do
| 218 | 226 |
|
| 219 | 227 |
|
| 220 | 228 |
|
| 229 |
|
|
| 230 |
|
|
| 221 | 231 |
|
| 222 | 232 |
|
| 223 | 233 |
|
lib/openagents_web/controllers/inference_proxy_controller.ex modified +15 -1
@@ -297,12 +297,26 @@ defmodule OpenAgentsWeb.InferenceProxyController do
| 297 | 297 |
|
| 298 | 298 |
|
| 299 | 299 |
|
| 300 |
|
|
| 300 | 301 |
|
| 301 |
|
|
| 302 |
|
|
| 302 | 303 |
|
| 303 | 304 |
|
| 304 | 305 |
|
| 305 | 306 |
|
| 307 |
|
|
| 308 |
|
|
| 309 |
|
|
| 310 |
|
|
| 311 |
|
|
| 312 |
|
|
| 313 |
|
|
| 314 |
|
|
| 315 |
|
|
| 316 |
|
|
| 317 |
|
|
| 318 |
|
|
| 319 |
|
|
| 306 | 320 |
|
| 307 | 321 |
|
| 308 | 322 |
|
test/openagents/chat/gemini/stream_decoder_test.exs modified +37
@@ -239,6 +239,43 @@ defmodule OpenAgents.Chat.Gemini.StreamDecoderTest do
| 239 | 239 |
|
| 240 | 240 |
|
| 241 | 241 |
|
| 242 |
|
|
| 243 |
|
|
| 244 |
|
|
| 245 |
|
|
| 246 |
|
|
| 247 |
|
|
| 248 |
|
|
| 249 |
|
|
| 250 |
|
|
| 251 |
|
|
| 252 |
|
|
| 253 |
|
|
| 254 |
|
|
| 255 |
|
|
| 256 |
|
|
| 257 |
|
|
| 258 |
|
|
| 259 |
|
|
| 260 |
|
|
| 261 |
|
|
| 262 |
|
|
| 263 |
|
|
| 264 |
|
|
| 265 |
|
|
| 266 |
|
|
| 267 |
|
|
| 268 |
|
|
| 269 |
|
|
| 270 |
|
|
| 271 |
|
|
| 272 |
|
|
| 273 |
|
|
| 274 |
|
|
| 275 |
|
|
| 276 |
|
|
| 277 |
|
|
| 278 |
|
|
| 242 | 279 |
|
| 243 | 280 |
|
| 244 | 281 |
|
test/openagents/inference_test.exs modified +54
@@ -114,6 +114,60 @@ defmodule OpenAgents.InferenceTest do
| 114 | 114 |
|
| 115 | 115 |
|
| 116 | 116 |
|
| 117 |
|
|
| 118 |
|
|
| 119 |
|
|
| 120 |
|
|
| 121 |
|
|
| 122 |
|
|
| 123 |
|
|
| 124 |
|
|
| 125 |
|
|
| 126 |
|
|
| 127 |
|
|
| 128 |
|
|
| 129 |
|
|
| 130 |
|
|
| 131 |
|
|
| 132 |
|
|
| 133 |
|
|
| 134 |
|
|
| 135 |
|
|
| 136 |
|
|
| 137 |
|
|
| 138 |
|
|
| 139 |
|
|
| 140 |
|
|
| 141 |
|
|
| 142 |
|
|
| 143 |
|
|
| 144 |
|
|
| 145 |
|
|
| 146 |
|
|
| 147 |
|
|
| 148 |
|
|
| 149 |
|
|
| 150 |
|
|
| 151 |
|
|
| 152 |
|
|
| 153 |
|
|
| 154 |
|
|
| 155 |
|
|
| 156 |
|
|
| 157 |
|
|
| 158 |
|
|
| 159 |
|
|
| 160 |
|
|
| 161 |
|
|
| 162 |
|
|
| 163 |
|
|
| 164 |
|
|
| 165 |
|
|
| 166 |
|
|
| 167 |
|
|
| 168 |
|
|
| 169 |
|
|
| 170 |
|
|
| 117 | 171 |
|
| 118 | 172 |
|
| 119 | 173 |
|
test/openagents/providers/open_ai/stream_decoder_test.exs modified +63 -1
@@ -57,7 +57,7 @@ defmodule OpenAgents.Providers.OpenAI.StreamDecoderTest do
| 57 | 57 |
|
| 58 | 58 |
|
| 59 | 59 |
|
| 60 |
|
|
| 60 |
|
|
| 61 | 61 |
|
| 62 | 62 |
|
| 63 | 63 |
|
@@ -67,6 +67,68 @@ defmodule OpenAgents.Providers.OpenAI.StreamDecoderTest do
| 67 | 67 |
|
| 68 | 68 |
|
| 69 | 69 |
|
| 70 |
|
|
| 71 |
|
|
| 72 |
|
|
| 73 |
|
|
| 74 |
|
|
| 75 |
|
|
| 76 |
|
|
| 77 |
|
|
| 78 |
|
|
| 79 |
|
|
| 80 |
|
|
| 81 |
|
|
| 82 |
|
|
| 83 |
|
|
| 84 |
|
|
| 85 |
|
|
| 86 |
|
|
| 87 |
|
|
| 88 |
|
|
| 89 |
|
|
| 90 |
|
|
| 91 |
|
|
| 92 |
|
|
| 93 |
|
|
| 94 |
|
|
| 95 |
|
|
| 96 |
|
|
| 97 |
|
|
| 98 |
|
|
| 99 |
|
|
| 100 |
|
|
| 101 |
|
|
| 102 |
|
|
| 103 |
|
|
| 104 |
|
|
| 105 |
|
|
| 106 |
|
|
| 107 |
|
|
| 108 |
|
|
| 109 |
|
|
| 110 |
|
|
| 111 |
|
|
| 112 |
|
|
| 113 |
|
|
| 114 |
|
|
| 115 |
|
|
| 116 |
|
|
| 117 |
|
|
| 118 |
|
|
| 119 |
|
|
| 120 |
|
|
| 121 |
|
|
| 122 |
|
|
| 123 |
|
|
| 124 |
|
|
| 125 |
|
|
| 126 |
|
|
| 127 |
|
|
| 128 |
|
|
| 129 |
|
|
| 130 |
|
|
| 131 |
|
|
| 70 | 132 |
|
| 71 | 133 |
|
| 72 | 134 |
|