test(router): end the scripted stream with a finish reason

Since #47665 a stream that ends without a finish_reason raises
MidStreamFallbackError; the core suite's scripted stream never sent one, so
test_streaming_acompletion_yields_the_host_stream_chunks_with_routing_hidden_params
fails on main for both cores.
This commit is contained in:
narmstrong-berry 2026-10-31 22:46:21 +00:00
parent 6375c5b1a3
commit eabbbc41e7
No known key found for this signature in database

View file

@ -414,6 +414,8 @@ def _scripted_stream(*texts: str) -> Callable[..., CustomStreamWrapper]:
async def chunks() -> AsyncIterator[ModelResponseStream]:
for text in texts:
yield ModelResponseStream(choices=[{"index": 0, "delta": {"role": "assistant", "content": text}}])
# A stream that ends without a finish reason fails since #47665.
yield ModelResponseStream(choices=[{"index": 0, "delta": {}, "finish_reason": "stop"}])
yield ModelResponseStream(choices=[{"index": 0, "delta": {}, "finish_reason": "stop"}])
logging_obj: Final = LiteLLMLogging(