Skip to content

fix(session): persist Event.NodeInfo through Vertex AI backend#1017

Open
wolo-lab wants to merge 4 commits into
v2from
wolo/fix-vertex-nodeinfo-rawevent
Open

fix(session): persist Event.NodeInfo through Vertex AI backend#1017
wolo-lab wants to merge 4 commits into
v2from
wolo/fix-vertex-nodeinfo-rawevent

Conversation

@wolo-lab

Copy link
Copy Markdown
Contributor

Problem

The Vertex AI session backend only round-tripped event fields that have a dedicated SessionEvent column (Content, Actions, EventMetadata). On write everything else was silently dropped, and on read it was never reconstructed: Output, NodeInfo, IsolationScope, RequestedInput and Routes.
This became correctness-critical once the workflow engine moved to event-scan resume reconstruction (ReconstructRunState / rehydrateCache), where NodeInfo.Path identifies the emitting node. A workflow paused and resumed against a Vertex-persisted session resumed incorrectly because NodeInfo was gone. The in-memory and SQL backends already preserved these fields; Vertex was the last gap.

Solution

Persist the full event in SessionEvent.raw_event (proto field 12, the same field adk-python uses) and prefer it on read, falling back to the legacy field-based reconstruction for events written before raw_event support.

  • eventNeedsRawEvent — raw_event is attached only when the event carries one of the column-less fields (Output, NodeInfo, IsolationScope, RequestedInput, Routes). Plain events keep their existing wire format, so the recorded rpcreplay fixtures stay valid (none of them sets those fields).
  • eventToRawEvent / eventFromRawEvent — JSON round-trip into structpb.Struct and back. On read, identity fields (ID, Timestamp, InvocationID, Author) are taken from the envelope.

@wolo-lab wolo-lab self-assigned this Jun 14, 2026
@wolo-lab wolo-lab force-pushed the wolo/fix-vertex-nodeinfo-rawevent branch from 11ec338 to 4f6edc3 Compare June 14, 2026 12:27
The Vertex AI session backend only round-tripped fields with a dedicated
SessionEvent column (Content, Actions, EventMetadata), silently dropping
Output, NodeInfo, IsolationScope, RequestedInput and Routes. With the
workflow engine now reconstructing resume state from session history,
NodeInfo is load-bearing, so a Vertex-persisted session resumed
incorrectly.

Persist the full event in SessionEvent.raw_event (the same field
adk-python uses) and prefer it on read, falling back to the legacy
field-based reconstruction for older events. raw_event is only attached
when the event carries state without a dedicated column, so plain events
keep their existing wire format and the recorded replay fixtures stay
valid.

The raw_event payload uses Go's own JSON encoding for now; byte-level
camelCase parity with adk-python (cross-runtime interop) is tracked
separately. Integers in the any-typed Output and StateDelta fields come
back as float64 after the round-trip; this matches the SQL backend's
existing contract (both JSON-encode those fields the same way) and is now
documented and pinned by a test.
@wolo-lab wolo-lab force-pushed the wolo/fix-vertex-nodeinfo-rawevent branch from 4f6edc3 to f583e56 Compare June 14, 2026 13:19
@wolo-lab wolo-lab requested a review from baptmont June 15, 2026 05:56
@wolo-lab wolo-lab marked this pull request as ready for review June 15, 2026 05:56
@wolo-lab wolo-lab requested review from kdroste-google and removed request for baptmont June 15, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant