Repository navigation
feat(live): filter internal _adk_live artifact parts from live session history - #7346
Merged
Merged
Conversation
`GeminiLlmConnection.send_history()` replays session history to a new Live connection on reconnect and agent transfer. It already dropped audio, which is transcribed and is not supported by the Live API in client content turns. It now also drops internal `_adk_live` artifact references (`artifact://` URIs under `_adk_live/`, of any MIME type). `save_live_blob` writes them to the session, and the model cannot resolve them. All other parts are replayed as before, including inline image and video and user-supplied file references such as `gs://` images. The public `filter_audio_parts()` is unchanged; `send_history()` uses a new private helper. PiperOrigin-RevId: 994729487
copybara-service
Bot
force-pushed
the
copybara/990462563
branch
from
October 7, 2026 00:26
0b74d0b to
f03d23d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(live): filter internal _adk_live artifact parts from live session history
When
RunConfig.save_live_blob=Trueis enabled, live sessions persist realtimeaudio, image, and video blobs to
BaseArtifactServiceand record internalartifact://.../_adk_live/...FileDatareferences (including single-framemedia files and multi-frame
application/ziparchives) on session events.Those internal
artifact://URIs cannot be resolved by the Gemini Live API'ssend_client_contentendpoint when session history is replayed on reconnect oragent transfer.
This change adds
is_adk_live_artifact_part()inutils/content_utils.pyandupdates
filter_audio_parts()(used byGeminiLlmConnection.send_history())to strip internal
_adk_liveartifactFileDataparts while preserving text,inline media blobs, and external
gs:///https://FileDataparts.Testing Plan:
tests/unittests/utils/test_content_utils.pycoveringis_adk_live_artifact_part()(multi-frame.zip, single-frame.jpeg,parameterized/uppercase MIME strings,
Nonefields, externalgs://URIs,and inline blobs) and
filter_audio_parts().test_send_history_filters_out_adk_live_artifact_partsintests/unittests/models/test_gemini_llm_connection.py.