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:
- In the existing mocked
test_append_event, retain the session_before_append object passed to append_event.
- After
await session_service.append_event(session_before_append, event_to_append), call get_session for the same ID.
- 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.
Describe the Bug:
VertexAiSessionService.append_eventcommits a successful non-partial event to the caller'sSession, but does not update that object'slast_update_time. A subsequentget_sessionbuilds a newSessionfrom the Vertex session resource'supdate_time, so the two objects can disagree after the append. I found this by readingmainatdef458b609c2811d137b0332b2fc7b201dddd5c0; I have not confirmed the behavior against a live Vertex service.Steps to Reproduce:
test_append_event, retain thesession_before_appendobject passed toappend_event.await session_service.append_event(session_before_append, event_to_append), callget_sessionfor the same ID.last_update_timevalues. The mock advances its session resourceupdate_timeon 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.0lackstypes.InteractionStatus. This checkout has nouv.lockor local environment, so the proposed regression assertion is not yet verified red.Expected Behavior:
Please clarify the contract for a caller-held
Sessionafter a successful Vertex append. Iflast_update_timeshould reflect the backend's latest session update, it should be synchronized or otherwise documented as stale until reload.Observed Behavior:
Source inspection shows
get_sessionreads the remote resourceupdate_time(source), whereasappend_eventsends the event timestamp and then calls_commit_event_to_sessionwithout assigningsession.last_update_time(source). The current mock updates the remoteupdate_timewhen it receives the append (test mock). No live-service observation or passing/failing regression result is claimed here.Environment Details:
pip show google-adk): not installed; source checkout atdef458b609c2811d137b0332b2fc7b201dddd5c0Model Information:
Additional Context:
The Vertex session resource defines
updateTimeas an output-only session update time. The appendEvent method returns an empty response body. These docs do not establish that the server'supdateTimeequals the event's client timestamp, so directly assigningevent.timestampmay 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.