diff --git a/litellm/llms/custom_httpx/llm_http_handler.py b/litellm/llms/custom_httpx/llm_http_handler.py index df06bd8d3fe..1b0ee1b9be5 100644 --- a/litellm/llms/custom_httpx/llm_http_handler.py +++ b/litellm/llms/custom_httpx/llm_http_handler.py @@ -5227,7 +5227,13 @@ class BaseLLMHTTPHandler: session_configuration_request=None, ) if synthetic_session is not None: - await websocket.send_text(json.dumps(synthetic_session)) + synthetic_session_str = json.dumps(synthetic_session) + # Record before sending so the synthetic session.created is + # captured in the session log alongside provider-driven + # events; without this it would be silently absent from + # success_handler / async_success_handler payloads. + realtime_streaming.store_message(synthetic_session_str) + await websocket.send_text(synthetic_session_str) realtime_streaming._session_created_sent_to_client = True verbose_logger.debug( "Sent synthetic session.created to client to unblock connection"