Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/google/adk/flows/llm_flows/base_llm_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,15 @@ async def _postprocess_live(
async for event in agen:
yield event

# Handle session resumption updates for cross-connection resumption.
# Must be before skip condition - resumption updates have no content.
if llm_response.live_session_resumption_update:
model_response_event.live_session_resumption_update = (
llm_response.live_session_resumption_update
)
yield model_response_event
return
Comment on lines +736 to +751
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This new logic is a great addition for enabling cross-connection session resumption. To ensure this feature remains robust and to prevent future regressions, it would be beneficial to add a unit test for this new code path in _postprocess_live. A test could verify that when an llm_response contains a live_session_resumption_update, the invocation_context is updated correctly and the corresponding event is yielded.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please add a unit test.


# Skip the model response event if there is no content and no error code.
# This is needed for the code executor to trigger another loop.
# But don't skip control events like turn_complete or transcription events.
Expand Down
Loading