You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inference parser: Select the OnResponse reader from the response, not the request's stream flag #1706
InferenceParser.OnResponse uses the request's stream flag to select the response reader. The terminal-frame arm of OnResponseFrame uses the response: settle.IsEventStream(pctx) || inference.CarriesSSEFraming(body). The two arms disagree when a gateway sends JSON to a streaming request, or SSE to a non-streaming request. In that case, OnResponse uses the wrong reader. It loses the completion and the usage, and only a gateway cost header can price the response.
Impact today
None on a live path. Pipeline.RunResponse skips a plugin that implements StreamingResponder, so no listener calls this OnResponse. Only a direct caller (a test, or a future caller) reaches it.
Fix decision
In OnResponse, select the reader with the same rule as the terminal-frame arm of OnResponseFrame. Add a test for each of the two mismatched cases.
The base code had the same behaviour. CodeRabbit found it on #1703. That PR is a pure move, so the fix is not in it.
Activity
Fix: Select the OnResponse reader from the response