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
Fix: run response-phase pipeline before SSE passthrough streaming
streamPassthrough previously skipped RunResponse (matching
handleStreamingResponse), which silently bypassed header/status response
gates on SSE responses — e.g. opa's response-phase deny and
litellm-budgettrack's cost accounting would not run for a streamed
response.
Run RunResponse before the first byte in streamPassthrough and honor a
deny. This is safe only here: the path is reached exclusively when no
StreamingResponder is configured, so RunResponse cannot double-dispatch a
plugin that also implements OnResponseFrame, and the plugins reachable
here use status/headers only (never pctx.ResponseBody). Body-level
response inspection on a stream still requires implementing
StreamingResponder.
Add tests: a response-phase deny short-circuits before any SSE byte is
written, and a non-denying header-level OnResponse still runs while the
stream is delivered verbatim.
Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>
0 commit comments