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(live): stop live runs from writing back into the caller's RunConfig
Two places in the live path wrote into configuration the caller still owns, so
a `RunConfig` came back out of a run holding fields the caller never set, and
a `RunConfig` reused for a later run carried them into it.
The basic request processor aliased two `RunConfig` sub-models straight into
`LiveConnectConfig` rather than copying them, and live request assembly then
mutates both while the session runs: `BaseLlmFlow.run_live` stamps every
server-issued handle onto `session_resumption` when it reconnects and sets
`transparent` there on a Vertex reconnect, and sets
`initial_history_in_client_content` on `history_config` when it seeds a fresh
connection with history. Deep copy both sub-models in `_build_basic_request`.
This matches the treatment `_copy_request_scoped_fields` already gives
`llm_request.config` in the same function, and for the same reason: request
assembly must not write through into configuration the caller still owns. An
absent sub-config stays `None` rather than becoming an empty object.
`Runner.run_live` filled in its AUDIO default by assigning to the caller's
`response_modalities`, so a config that expressed no preference came back out
of the run pinned to AUDIO, and a config reused for a later text run would ask
for audio. Write that default to a copy instead. The copy is shallow: deep
copying a `RunConfig` raises `TypeError: cannot pickle` when `http_options`
holds a live httpx client, and nothing there writes through into a sub-model.
Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 966257920
0 commit comments