Repository navigation
fix(sessions): preserve original Event.id from raw_event in VertexAiSessionService (v1) - #6545
chelsealong wants to merge 4 commits into
Conversation
…essionService _from_api_event overwrote the ADK event id with the Vertex resource name, so the same logical event reported a different id depending on whether it was seen via streaming or via a reload. Fall back to the resource name only when raw_event carries no id, which keeps older data working. Port of google#6531 to the v1 line, requested by @ashubham on that PR.
|
@wuliang229 — the The failing test is This PR only touches Happy to rebase once |
|
@wuliang229 — following up on your approval from 2026-08-07. The only thing that stalled this was the I've just updated the branch from current I also closed #6996, which was an accidental duplicate of this same fix. |
Ports #6531 to the
v1line, as requested by @ashubham there ("The fix works, can we please port to 1.x as well").Problem
_from_api_eventoverwrote the ADKEvent.idwith the last segment of the Vertex event resource name, so the same logical event reported a different id depending on how it was observed — one value while streaming, another after a reload. Anything keyed onEvent.idacross a reload boundary saw them as two distinct events.Fix
Stop clobbering
idin theevent_dict.update({...})call and fall back to the resource name only whenraw_eventcarries no id:Older data without a
raw_eventid keeps the previous behaviour.Evidence
Identical source change to #6531 (verified with a diff of both patches). Added the same regression test,
test_get_session_preserves_original_event_id_from_raw_event, which puts a distinct id inraw_eventand assertsget_sessionreturns it rather than the resource name.Branch is cut from current
upstream/v1.Prepared with the help of Claude Code (Anthropic's AI coding assistant); I reviewed the diff and the test output before pushing.