Files
hermes-agent/contributors/emails/xingkai98@126.com
Xingkai98 36c987ea6e fix: reasoning-only streams whose deltas carry reasoning only in model_extra no longer fail as empty
The chat-completions stream intake read reasoning from `delta.reasoning_content`
/ `delta.reasoning` attributes only. OpenAI-compatible gateways that expose the
field as an unknown extra land it in the SDK's `delta.model_extra`, so a
reasoning-only stream accumulated nothing and either tripped
"Provider returned an empty stream with no finish_reason" or dropped the
reasoning entirely on finish_reason=length. Mirror the `model_extra` fallback
the non-streaming path (and the streaming reasoning_details/refusal readers)
already use, for both carrier keys.

Salvages #56789 by @Xingkai98 (ported onto the phase-split intake; the original
test asserted a synthetic "stop" on a finish-less stream, which current main
deliberately reports as a drop, so the invariant test uses finish_reason=length
from the issue's SSE trace).

Fixes #56516
2026-09-19 09:50:10 -07:00

2 lines
10 B
Plaintext