fix: guard against null timings field in streaming response

Fixes #25753
This commit is contained in:
w1nd 2026-06-06 19:58:22 +08:00
parent b1d40f3409
commit 0057f8fb1b

View file

@ -4070,7 +4070,7 @@ async def streaming_chat_response_handler(response, ctx):
# Normalize usage data to standard format
raw_usage = data.get('usage', {}) or {}
raw_usage.update(data.get('timings', {})) # llama.cpp
raw_usage.update(data.get('timings', {}) or {})
if raw_usage:
usage = normalize_usage(raw_usage)
await event_emitter(