Repository navigation
fix(session/vertexai): persist live transcriptions - #1964
Merged
baptmont merged 2 commits intoOct 26, 2026
Merged
Conversation
RunLive appends a finished transcription as an event with no Content, so InputTranscription or OutputTranscription is all the event carries. The Vertex AI backend wrote neither: they are not mapped to a SessionEvent field, and eventNeedsRawEvent did not request raw_event for them. The event was stored empty, and after a reload the contents processor had nothing to turn back into the user or model turn, so the spoken part of the conversation was missing from the model's history. Write raw_event for events that carry a transcription. adk-python keeps transcriptions in raw_event only and never uses the EventMetadata transcription fields, so events written here read back the same in both runtimes. Plain events keep the legacy wire format, so the recorded replays are unaffected.
|
Hi @DisturbedCrow, Thanks for opening #1964 and for the detailed explanation. I've reviewed the proposed changes, particularly the The approach looks well scoped. I'd like to focus my independent validation on transcription-only events without I'll keep any findings tied to reproducible tests and avoid duplicating the implementation. Thanks again for the opportunity to review this. Best regards, |
baptmont
approved these changes
Oct 26, 2026
karthik-0306
added a commit
to karthik-0306/google-adk-go
that referenced
this pull request
Oct 26, 2026
Resolves the conflict with google#1964 in session/vertexai/vertexai_test.go by keeping both sides' eventNeedsRawEvent cases: the transcription rows from upstream and the cache metadata row from this branch. Co-Authored-By: Claude Opus 5.5 <[email protected]>
karthik-0306
added a commit
to karthik-0306/google-adk-go
that referenced
this pull request
Oct 26, 2026
Resolves the conflict with google#1964 in session/vertexai/vertexai_test.go by keeping both sides' eventNeedsRawEvent cases: the transcription rows from upstream and the cache metadata row from this branch.
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.
Linked issue
Problem:
The Vertex AI session service doesn't save InputTranscription or OutputTranscription. RunLive appends finished transcriptions as their own events with no Content, and since appendEvent doesn't map those fields and eventNeedsRawEvent doesn't ask for raw_event, the events get stored empty. After the session is reloaded, those turns are missing from what the model sees. session/database had the same problem in #1655.
Solution:
eventNeedsRawEvent now returns true when an event has a transcription. The read path already prefers raw_event and decodes the whole event from it, so nothing else had to change.
I used raw_event rather than the EventMetadata transcription fields because that's what adk-python does. It always writes raw_event and never reads or writes those fields, so a session reads back the same from either runtime. Events without a transcription are written exactly as before, which keeps the recorded replays in testdata matching.
I also added the two key names to TestRawEventWireKeysAreCamelCase, since other runtimes read them.
Behavior change
On the Vertex AI session service, events with a transcription are now written with raw_event and come back with the transcription. After a reload, those turns are back in the model's context like they already are with the in-memory and database services, so prompts get a little longer. Events stored before this change stay empty, and events without a transcription are unchanged.
This is for main only. v1 has no raw_event support, so it would need a different fix there.
Testing Plan
Unit Tests:
go test ./...passes,go test -race ./session/...passes,golangci-lint run(v2.3.1) reports 0 issues andgo mod tidy -diffis empty.With your source change reverted and your tests kept, which test fails?
TestVertexAiClientTranscriptionRoundTrip (both subtests, the transcription comes back nil) and the two new cases in TestEventNeedsRawEvent.
Manual End-to-End (E2E) Tests:
I don't have an Agent Engine project, so I haven't run this against the live service. The round-trip test goes through the real gRPC client against the package's fake SessionService, and an append with no Content carried in raw_event is already covered by the recorded compaction_record_round_trips replay, so the live service accepts that shape.
Checklist
Additional context
While looking at this I noticed the legacy path (no raw_event) also doesn't map Escalate, TransferToAgent or SkipSummarization, and doesn't keep UsageMetadata. I left that out to keep this PR to the one issue, and can open a separate issue for it.