Skip to content

Clarify Vertex append_event Session.last_update_time after append #7338

Description

@feiiiiii5

Describe the Bug:
VertexAiSessionService.append_event commits a successful non-partial event to the caller's Session, but does not update that object's last_update_time. A subsequent get_session builds a new Session from the Vertex session resource's update_time, so the two objects can disagree after the append. I found this by reading main at def458b609c2811d137b0332b2fc7b201dddd5c0; I have not confirmed the behavior against a live Vertex service.

Steps to Reproduce:

  1. In the existing mocked test_append_event, retain the session_before_append object passed to append_event.
  2. After await session_service.append_event(session_before_append, event_to_append), call get_session for the same ID.
  3. Compare their last_update_time values. The mock advances its session resource update_time on append, while the local object is updated only by _commit_event_to_session, which appends the event and applies state.

I added that comparison locally, but could not run pytest: test collection stops because the globally installed google-genai 2.15.0 lacks types.InteractionStatus. This checkout has no uv.lock or local environment, so the proposed regression assertion is not yet verified red.

Expected Behavior:
Please clarify the contract for a caller-held Session after a successful Vertex append. If last_update_time should reflect the backend's latest session update, it should be synchronized or otherwise documented as stale until reload.

Observed Behavior:
Source inspection shows get_session reads the remote resource update_time (source), whereas append_event sends the event timestamp and then calls _commit_event_to_session without assigning session.last_update_time (source). The current mock updates the remote update_time when it receives the append (test mock). No live-service observation or passing/failing regression result is claimed here.

Environment Details:

  • ADK Library Version (pip show google-adk): not installed; source checkout at def458b609c2811d137b0332b2fc7b201dddd5c0
  • Desktop OS: macOS
  • Python Version: 3.13.3

Model Information:

  • LiteLLM: N/A
  • Model: N/A; session-service mock only

Additional Context:
The Vertex session resource defines updateTime as an output-only session update time. The appendEvent method returns an empty response body. These docs do not establish that the server's updateTime equals the event's client timestamp, so directly assigning event.timestamp may give a different value from a reload. Would you prefer a post-append fetch of the server timestamp, a local approximate timestamp with an explicit contract, or a documented reload requirement? I can prepare the regression test and fix once the intended contract is clear.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

services[Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions