fix(google): skip context replay on resumed realtime sessions - #2462
Open
rosetta-livekit-bot[bot] wants to merge 2 commits into
Open
rosetta-livekit-bot[bot] wants to merge 2 commits into
rosetta-livekit-bot[bot] wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: 5a9d30e The changes in this PR will be included in the next version bump. This PR includes changesets to release 38 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| super(realtimeModel); | ||
|
|
||
| this.options = realtimeModel._options; | ||
| this.sessionResumptionHandle = this.options.sessionResumption?.handle; |
Contributor
There was a problem hiding this comment.
🟡 Transparent resumption never activates
When sessionResumption.transparent is enabled, the constructor retains only handle. buildConnectConfig therefore omits the flag, so reconnects cannot use server consumption indexes.
Prompt for agents
Preserve the complete caller-provided sessionResumption configuration in RealtimeSession instead of extracting only its handle. buildConnectConfig must forward fields such as transparent while replacing or adding the latest server-issued handle. Also account for transparent mode's lastConsumedClientMessageIndex contract if the plugin claims transparent reconnect behavior.
Was this helpful? React with 👍 or 👎 to provide feedback.
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.
Summary
sessionResumptionconfiguration and a Google plugin patch changesetAuthoritative source: livekit/agents#6000
Source diff coverage
livekit-plugins/livekit-plugins-google/livekit/plugins/google/realtime/realtime_api.pytoplugins/google/src/realtime/realtime_api.ts. Python channel event subclasses and async session flow are represented by TypeScript queue metadata, pending context state, handle snapshots, and async context diffing. The target lacked the existing Python caller-provided session resumption option, so that prerequisite was added and reflected inplugins/google/etc/agents-plugin-google.api.md.tests/test_plugin_google_realtime.pytoplugins/google/src/realtime/realtime_api.test.ts. All eight tests added by source PR #6000 were ported using Vitest and fake Google Live sockets; no additional behavioral scenarios were added.Validation
pnpm test plugins/google(84 passed, 2 skipped)pnpm buildpnpm --filter @livekit/agents-plugin-google lint(passes with 3 existing warnings)pnpm --filter @livekit/agents-plugin-google api:checkRoot
pnpm lintwas also run, but the repository baseline currently fails on the unrelated existingplugins/openai/src/ws/llm.ts:127no-misused-promiseserror.cue-cliruntime validation could not be run because this environment has LiveKit credentials but noGOOGLE_API_KEYor workspace.env. The ported fake Live socket tests validate reconnect, tool-result, queued-send, and failed-send behavior without provider credentials.