mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
fix(realtime): record synthetic session.created in deferred-setup mode
The deferred-setup path emits a synthetic session.created directly to the client websocket but did not run it through RealTimeStreaming's store_message, so the event was missing from the session log used by success_handler / async_success_handler. Call store_message before forwarding so the synthetic event lands in the same log stream as provider-driven events.
This commit is contained in:
parent
459c1973b4
commit
20764dd342
1 changed files with 7 additions and 1 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue