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:
mateo-berri 2026-05-22 22:14:15 +00:00
parent 459c1973b4
commit 20764dd342
No known key found for this signature in database

View file

@ -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"