fix(mcp): pass the original receive to the SSE handler when no body was consumed

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
yassin 2026-09-17 20:44:24 +00:00
parent fa1c1f27d9
commit c085619f29

View file

@ -4837,7 +4837,9 @@ if MCP_AVAILABLE:
scope, receive, send, sse_body, _sse_client_ip
):
return
sse_receive: Final = _replay_consumed_messages(sse_consumed_messages, receive)
sse_receive: Final = (
_replay_consumed_messages(sse_consumed_messages, receive) if sse_consumed_messages else receive
)
async with _gateway_initialize_instructions_request_scope(
user_api_key_auth,