inference: number parallel tool-call SSE indexes instead of always 0 Live streaming dropped Enum.with_index and hardcoded index 0 on every tool_calls delta. The CLI then concatenated names and ids. Number the calls 0, 1, 2 as they go out, and do not merge two finished calls that share a wire index in the OpenRouter decoder.
inference: number parallel tool-call SSE indexes instead of always 0
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 475 · 2026-08-28T05:43:45.907072Z
Changed files
-
modified
lib/openagents/providers/open_router/stream_decoder.ex -
modified
lib/openagents_web/controllers/inference_proxy_controller.ex -
modified
test/openagents/providers/open_router/stream_decoder_test.exs -
modified
test/openagents_web/controllers/inference_proxy_controller_test.exs -
modified
test/support/providers/test.ex
Diff
5 files changed, +191 -2
lib/openagents/providers/open_router/stream_decoder.ex modified +39 -1
@@ -195,8 +195,9 @@ defmodule OpenAgents.Providers.OpenRouter.StreamDecoder do
| 195 | 195 |
|
| 196 | 196 |
|
| 197 | 197 |
|
| 198 |
|
|
| 199 | 198 |
|
| 199 |
|
|
| 200 |
|
|
| 200 | 201 |
|
| 201 | 202 |
|
| 202 | 203 |
|
@@ -220,6 +221,43 @@ defmodule OpenAgents.Providers.OpenRouter.StreamDecoder do
| 220 | 221 |
|
| 221 | 222 |
|
| 222 | 223 |
|
| 224 |
|
|
| 225 |
|
|
| 226 |
|
|
| 227 |
|
|
| 228 |
|
|
| 229 |
|
|
| 230 |
|
|
| 231 |
|
|
| 232 |
|
|
| 233 |
|
|
| 234 |
|
|
| 235 |
|
|
| 236 |
|
|
| 237 |
|
|
| 238 |
|
|
| 239 |
|
|
| 240 |
|
|
| 241 |
|
|
| 242 |
|
|
| 243 |
|
|
| 244 |
|
|
| 245 |
|
|
| 246 |
|
|
| 247 |
|
|
| 248 |
|
|
| 249 |
|
|
| 250 |
|
|
| 251 |
|
|
| 252 |
|
|
| 253 |
|
|
| 254 |
|
|
| 255 |
|
|
| 256 |
|
|
| 257 |
|
|
| 258 |
|
|
| 259 |
|
|
| 260 |
|
|
| 223 | 261 |
|
| 224 | 262 |
|
| 225 | 263 |
|
lib/openagents_web/controllers/inference_proxy_controller.ex modified +10 -1
@@ -228,6 +228,7 @@ defmodule OpenAgentsWeb.InferenceProxyController do
| 228 | 228 |
|
| 229 | 229 |
|
| 230 | 230 |
|
| 231 |
|
|
| 231 | 232 |
|
| 232 | 233 |
|
| 233 | 234 |
|
@@ -637,6 +638,8 @@ defmodule OpenAgentsWeb.InferenceProxyController do
| 637 | 638 |
|
| 638 | 639 |
|
| 639 | 640 |
|
| 641 |
|
|
| 642 |
|
|
| 640 | 643 |
|
| 641 | 644 |
|
| 642 | 645 |
|
@@ -645,7 +648,7 @@ defmodule OpenAgentsWeb.InferenceProxyController do
| 645 | 648 |
|
| 646 | 649 |
|
| 647 | 650 |
|
| 648 |
|
|
| 651 |
|
|
| 649 | 652 |
|
| 650 | 653 |
|
| 651 | 654 |
|
@@ -663,6 +666,12 @@ defmodule OpenAgentsWeb.InferenceProxyController do
| 663 | 666 |
|
| 664 | 667 |
|
| 665 | 668 |
|
| 669 |
|
|
| 670 |
|
|
| 671 |
|
|
| 672 |
|
|
| 673 |
|
|
| 674 |
|
|
| 666 | 675 |
|
| 667 | 676 |
|
| 668 | 677 |
|
test/openagents/providers/open_router/stream_decoder_test.exs modified +73
@@ -125,6 +125,79 @@ defmodule OpenAgents.Providers.OpenRouter.StreamDecoderTest do
| 125 | 125 |
|
| 126 | 126 |
|
| 127 | 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 |
|
|
| 171 |
|
|
| 172 |
|
|
| 173 |
|
|
| 174 |
|
|
| 175 |
|
|
| 176 |
|
|
| 177 |
|
|
| 178 |
|
|
| 179 |
|
|
| 180 |
|
|
| 181 |
|
|
| 182 |
|
|
| 183 |
|
|
| 184 |
|
|
| 185 |
|
|
| 186 |
|
|
| 187 |
|
|
| 188 |
|
|
| 189 |
|
|
| 190 |
|
|
| 191 |
|
|
| 192 |
|
|
| 193 |
|
|
| 194 |
|
|
| 195 |
|
|
| 196 |
|
|
| 197 |
|
|
| 198 |
|
|
| 199 |
|
|
| 200 |
|
|
| 128 | 201 |
|
| 129 | 202 |
|
| 130 | 203 |
|
test/openagents_web/controllers/inference_proxy_controller_test.exs modified +42
@@ -293,6 +293,48 @@ defmodule OpenAgentsWeb.InferenceProxyControllerTest do
| 293 | 293 |
|
| 294 | 294 |
|
| 295 | 295 |
|
| 296 |
|
|
| 297 |
|
|
| 298 |
|
|
| 299 |
|
|
| 300 |
|
|
| 301 |
|
|
| 302 |
|
|
| 303 |
|
|
| 304 |
|
|
| 305 |
|
|
| 306 |
|
|
| 307 |
|
|
| 308 |
|
|
| 309 |
|
|
| 310 |
|
|
| 311 |
|
|
| 312 |
|
|
| 313 |
|
|
| 314 |
|
|
| 315 |
|
|
| 316 |
|
|
| 317 |
|
|
| 318 |
|
|
| 319 |
|
|
| 320 |
|
|
| 321 |
|
|
| 322 |
|
|
| 323 |
|
|
| 324 |
|
|
| 325 |
|
|
| 326 |
|
|
| 327 |
|
|
| 328 |
|
|
| 329 |
|
|
| 330 |
|
|
| 331 |
|
|
| 332 |
|
|
| 333 |
|
|
| 334 |
|
|
| 335 |
|
|
| 336 |
|
|
| 337 |
|
|
| 296 | 338 |
|
| 297 | 339 |
|
| 298 | 340 |
|
test/support/providers/test.ex modified +27
@@ -102,6 +102,33 @@ defmodule OpenAgents.Providers.Test do
| 102 | 102 |
|
| 103 | 103 |
|
| 104 | 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 |
|
|
| 105 | 132 |
|
| 106 | 133 |
|
| 107 | 134 |
|