Skip to content

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

Closed
enjoykumawat wants to merge 0 commit intogoogle:mainfrom
enjoykumawat:fix/sse-interaction-id-propagation
Closed

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

Conversation

@enjoykumawat
Copy link
Copy Markdown
Contributor

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

@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
@enjoykumawat enjoykumawat force-pushed the fix/sse-interaction-id-propagation branch from cb4a446 to 9d4ecbe Compare April 10, 2026 05:00
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