Skip to content

fix: extract interaction_id from SSE events for Interactions API chaining#5208

Open
enjoykumawat wants to merge 1 commit intogoogle:mainfrom
enjoykumawat:fix/sse-interaction-id-propagation
Open

fix: extract interaction_id from SSE events for Interactions API chaining#5208
enjoykumawat wants to merge 1 commit intogoogle:mainfrom
enjoykumawat:fix/sse-interaction-id-propagation

Conversation

@enjoykumawat
Copy link
Copy Markdown

Summary

  • Fix interaction_id extraction from SSE streaming events so function calling works with StreamingMode.SSE + Interactions API
  • SSE events carry the ID in event.interaction.id (start/complete events) or event.interaction_id (status_update), not event.id as the code assumed

Root Cause

call_interactions_api() checked event.id to extract the interaction ID during SSE streaming, but SSE event types (InteractionStartEvent, InteractionStatusUpdate, ContentDelta, etc.) don't have a top-level id attribute:

SSE Event Type Has id? Has interaction_id? Has interaction.id?
ContentDelta No No No
ContentStop No No No
InteractionStatusUpdate No Yes No
InteractionStartEvent No No Yes
InteractionCompleteEvent No No Yes

As a result, current_interaction_id was never set, all session events had interaction_id=None, and _find_previous_interaction_id() could not chain interactions — causing a 400 error on the second LLM call.

Test Plan

  • Test InteractionStartEvent ID extraction via event.interaction.id
  • Test InteractionStatusUpdate ID extraction via event.interaction_id
  • Test ContentDelta correctly returns no ID
  • Test interaction_id propagation to status_update LlmResponse
  • All existing interaction tests pass

Fixes #5169

…ning

SSE streaming events carry the interaction ID in different attributes
than the non-streaming Interaction response:
- InteractionStartEvent/CompleteEvent: event.interaction.id
- InteractionStatusUpdate: event.interaction_id

The code only checked event.id which doesn't exist on SSE event types,
so current_interaction_id was never set during streaming. This caused
_find_previous_interaction_id() to fail, breaking function calling
with StreamingMode.SSE + Interactions API.

Fixes google#5169
@adk-bot adk-bot added the core [Component] This issue is related to the core interface and implementation label Apr 8, 2026
@rohityan rohityan self-assigned this Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core [Component] This issue is related to the core interface and implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: StreamingMode.SSE breaks Interactions API function calling — interaction_id not propagated to session events

3 participants