fix(session): persist Event.NodeInfo through Vertex AI backend#1017
Open
wolo-lab wants to merge 4 commits into
Open
fix(session): persist Event.NodeInfo through Vertex AI backend#1017wolo-lab wants to merge 4 commits into
wolo-lab wants to merge 4 commits into
Conversation
11ec338 to
4f6edc3
Compare
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.
4f6edc3 to
f583e56
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.