Skip to content

fix: include rewind_before_invocation_id in VertexAiSessionService.append_event#4978

Open
yuting0624 wants to merge 3 commits intogoogle:mainfrom
yuting0624:fix/4930-vertex-session-rewind
Open

fix: include rewind_before_invocation_id in VertexAiSessionService.append_event#4978
yuting0624 wants to merge 3 commits intogoogle:mainfrom
yuting0624:fix/4930-vertex-session-rewind

Conversation

@yuting0624
Copy link

Summary

Fixes #4930

VertexAiSessionService.append_event() was not including rewind_before_invocation_id in the actions dict sent to the Vertex AI Agent Engine API. This caused rewind events to lose their target invocation ID when persisted, making session rewind non-functional for Agent Engine deployments.

Changes

  • src/google/adk/sessions/vertex_ai_session_service.py: Added rewind_before_invocation_id to the actions dict in append_event() (3 lines)
  • tests/unittests/sessions/test_vertex_ai_session_service.py: Added test_append_event_with_rewind to verify the field round-trips correctly through append and get

Root Cause

The actions dict construction in append_event() explicitly maps each field from EventActions to the API payload, but rewind_before_invocation_id was omitted. Other fields like transfer_to_agent, state_delta, skip_summarization, etc. were all present.

…pend_event (google#4930)

VertexAiSessionService.append_event() was not including
rewind_before_invocation_id in the actions dict sent to the
Vertex AI API. This caused rewind events to lose their target
invocation ID when persisted, making session rewind non-functional
for Agent Engine deployments.

Added the missing field to the actions dict and a round-trip test.

Fixes google#4930
@adk-bot
Copy link
Collaborator

adk-bot commented Mar 24, 2026

Response from ADK Triaging Agent

Hello @yuting0624, thank you for your contribution!

It looks like the pyink-check is failing. You can fix this by running the auto-formatting script from the root of the repository:

./autoformat.sh

This will ensure your changes adhere to the project's coding style. Thanks!

@adk-bot adk-bot added the services [Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc label Mar 24, 2026
@rohityan rohityan self-assigned this Mar 24, 2026
@rohityan rohityan added the request clarification [Status] The maintainer need clarification or more information from the author label Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

request clarification [Status] The maintainer need clarification or more information from the author services [Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VertexAiSessionService.append_event drops rewind_before_invocation_id, breaking rewind filtering on subsequent reads

3 participants