Skip to content

fix(google): honor Gemini Live new-session activation deadlines - #117490

Merged
vincentkoc merged 1 commit into
mainfrom
codex/qa402-google-live-session-activation-deadline
Aug 2, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
codex/qa402-google-live-session-activation-deadline

Conversation

@steipete

@steipete steipete commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Google Live browser Talk sessions were rejected during startup because the Google provider returned an epoch-seconds expiration while the Gateway and persisted session owner require epoch milliseconds. A naive 30-minute conversion also misrepresents token validity: Google permits creating a new Live connection for only 60 seconds, even though an already established session remains valid for 30 minutes.

Why This Change Was Made

The provider now returns the existing newSessionExpiresAtMs value as its browser-session expiration. Google SDK requests retain their independent ISO expiration fields: newSessionExpireTime remains 60 seconds, expireTime remains 30 minutes, and all token constraints, authentication, cancellation, and protocol shapes stay unchanged.

User Impact

Google Live Talk can start normally, and delayed microphone permission or other startup delays cannot cause OpenClaw to treat an already-expired new-connection token as valid. Existing connected Live sessions retain their full 30-minute lifetime.

Evidence

  • Authentic fake-clock regression reproduced the revoked 30-minute candidate accepting an expired new-session token after 60,001 ms; the corrected provider returns the exact 60-second epoch-millisecond deadline and preserves both Google SDK ISO expirations.
  • node scripts/run-vitest.mjs extensions/google/realtime-voice-provider.test.ts: 50/50 passed.
  • Four entirely fresh independent hostile source reviews: zero P0-P3 findings.
  • Genuine gpt-5.6-sol high autoreview with --max-priority P3: zero findings, confidence 0.99.
  • Native TruffleHog 3.96 TXT and JSON scans: zero secrets; targeted formatting and whitespace checks passed.
  • Type-aware lint has one unchanged pre-existing RealtimeVoiceBridgeCreateRequest warning on the clean baseline; no clean typecheck is claimed.
  • Live exact-head verification on August 2, 2026:
    • A real Google token mint returned provider-websocket / google-live-bidi, a 13-digit epoch-millisecond expiry, and an activation delta of exactly 60,000 ms.
    • The browser Google Live WebSocket reached setupComplete, accepted a JPEG video frame, invoked describe_view, and accepted the matching function response using gemini-3.1-flash-live-preview.
    • OpenAI regression proof also passed: backend bridge connected, PCM audio talkback returned the requested single word, and browser WebRTC connected with remote audio.
    • The browser relay adapter exercised talk.client.toolCall, audio append, tool-result submission, close, listening/thinking states, and user/assistant transcripts.
    • No credentials, private endpoints, or raw provider payloads were retained in this evidence.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 3:44 AM ET / 07:44 UTC.

ClawSweeper review

What this changes

The Google provider now returns the existing 60-second Gemini Live new-session activation deadline in epoch milliseconds for browser Talk sessions, with a fake-clock regression test preserving the separate 30-minute connected-session token lifetime.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

The patch correctly repairs a current Google Live startup rejection, but this PR carries the protected maintainer label and has a fresh assignee, so it should remain open for explicit maintainer handling rather than automated cleanup. The updated body provides sufficiently specific redacted exact-head live proof, and the source/test review found no discrete patch defect.

Priority: P1
Reviewed head: 4b1d397221825c20b309f9f978ce556d3d4471dd
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused provider-boundary correction with targeted regression coverage and concrete redacted live behavior evidence; only the protected-owner merge decision remains.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The updated PR body reports a redacted exact-head Google token mint with a 13-digit expiry and exact 60,000 ms activation delta, plus a browser Live WebSocket run through setupComplete, video input, and a tool round-trip; it directly exercises the changed runtime behavior without exposing credentials.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The updated PR body reports a redacted exact-head Google token mint with a 13-digit expiry and exact 60,000 ms activation delta, plus a browser Live WebSocket run through setupComplete, video input, and a tool round-trip; it directly exercises the changed runtime behavior without exposing credentials.
Evidence reviewed 6 items Current-main defect: Current main returns Math.floor(expiresAtMs / 1000) even though its caller compares the value directly with Date.now(), making the 13-digit millisecond clock immediately exceed the returned epoch-seconds value.
Gateway contract: Gateway subtracts a five-second minimum TTL from session.expiresAt and compares it directly to Date.now() before creating the durable client voice-session entry; this establishes the millisecond contract and confirms the producer is the correct repair owner.
Proposed canonical repair: The PR changes only the Google provider return value to the already-calculated newSessionExpiresAtMs, preserving the existing SDK token fields: 60 seconds for a new connection and 30 minutes for an established session.
Findings None None.
Security None None.

How this fits together

The Google plugin mints a browser-facing Gemini Live token and reports its usable connection deadline to Gateway Talk. Gateway uses that deadline before persisting a client-owned voice session, while the browser connects directly to Google over the provider WebSocket.

flowchart LR
  A[Browser Talk request] --> B[Gateway Talk session creation]
  B --> C[Google provider token mint]
  C --> D[60-second connection deadline]
  D --> E[Gateway startup deadline check]
  E --> F[Persisted client voice session]
  F --> G[Browser Google Live WebSocket]
Loading

Decision needed

Question Recommendation
Should the assigned Google/voice owner accept the provider-confirmed 60-second new-connection deadline as the Gateway startup deadline and land this focused repair? Accept the provider deadline: Land the focused repair so expired Gemini Live connection credentials are rejected before a phantom browser Talk session is persisted.

Why: The patch is source-consistent and live-proven, but the protected maintainer label and availability-sensitive connection deadline require an explicit owner decision rather than automated disposition.

Before merge

  • Resolve merge risk (P1) - The repaired behavior intentionally rejects a new Google Live connection once fewer than five seconds remain in Google’s 60-second activation window; this is the correct fail-fast boundary, but a maintainer should explicitly accept that startup behavior before landing.
Agent review details

Security

None.

PR surface

Source 0, Tests +26. Total +26 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 1 26 0 +26
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 27 1 +26

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Land with the activation deadline (recommended)
    Accept Google’s 60-second new-session limit as the Gateway admission deadline; delayed startup fails visibly before a durable voice session is created.

Technical review

Best possible solution:

Merge the provider-owned fix after the assigned maintainer confirms that Gateway should continue using Google’s new-session activation deadline only for startup admission while the Google token retains its separate 30-minute connected-session lifetime.

Do we have a high-confidence way to reproduce the issue?

Yes, from current source: Gateway compares session.expiresAt directly to Date.now(), while current Google code returns epoch seconds. The PR’s fake-clock test isolates the 60,001 ms boundary, and its updated body reports an exact-head live Google token and browser WebSocket verification.

Is this the best way to solve the issue?

Yes. Returning the existing provider-owned newSessionExpiresAtMs repairs the unit mismatch at its producer and preserves the distinct 30-minute SDK token expiry rather than adding downstream conversion or a fallback.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1e9a620a28d6.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The updated PR body reports a redacted exact-head Google token mint with a 13-digit expiry and exact 60,000 ms activation delta, plus a browser Live WebSocket run through setupComplete, video input, and a tool round-trip; it directly exercises the changed runtime behavior without exposing credentials.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The updated PR body reports a redacted exact-head Google token mint with a 13-digit expiry and exact 60,000 ms activation delta, plus a browser Live WebSocket run through setupComplete, video input, and a tool round-trip; it directly exercises the changed runtime behavior without exposing credentials.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: The current epoch-seconds value makes normal Google Live browser Talk startup reject a valid newly minted session.
  • merge-risk: 🚨 availability: This changes the deadline that determines whether a Google Live browser session may start, so an incorrect provider contract would affect Talk availability.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The updated PR body reports a redacted exact-head Google token mint with a 13-digit expiry and exact 60,000 ms activation delta, plus a browser Live WebSocket run through setupComplete, video input, and a tool round-trip; it directly exercises the changed runtime behavior without exposing credentials.
  • proof: sufficient: Contributor real behavior proof is sufficient. The updated PR body reports a redacted exact-head Google token mint with a 13-digit expiry and exact 60,000 ms activation delta, plus a browser Live WebSocket run through setupComplete, video input, and a tool round-trip; it directly exercises the changed runtime behavior without exposing credentials.

Evidence

What I checked:

  • Current-main defect: Current main returns Math.floor(expiresAtMs / 1000) even though its caller compares the value directly with Date.now(), making the 13-digit millisecond clock immediately exceed the returned epoch-seconds value. (extensions/google/realtime-voice-provider.ts:1202, 1e9a620a28d6)
  • Gateway contract: Gateway subtracts a five-second minimum TTL from session.expiresAt and compares it directly to Date.now() before creating the durable client voice-session entry; this establishes the millisecond contract and confirms the producer is the correct repair owner. (src/gateway/server-methods/talk-client.ts:370, 1e9a620a28d6)
  • Proposed canonical repair: The PR changes only the Google provider return value to the already-calculated newSessionExpiresAtMs, preserving the existing SDK token fields: 60 seconds for a new connection and 30 minutes for an established session. (extensions/google/realtime-voice-provider.ts:1202, 4b1d39722182)
  • Regression coverage: The added fake-clock test verifies both SDK ISO expirations, advances past 60 seconds, and asserts the browser-session deadline is exactly the new-session millisecond timestamp. Test cleanup restores real timers after each case. (extensions/google/realtime-voice-provider.test.ts:620, 4b1d39722182)
  • Feature-history routing: Recent local history identifies a shared realtime-session lifecycle refactor and a concentrated set of Google realtime fixes; the area history is led by Peter Steinberger and Vincent Koc. (extensions/google/realtime-voice-provider.ts:1124, 131b9e390480)
  • Release/current-main status: The PR head is not an ancestor of current main and no local tag contains it, so the repair remains unmerged and is not part of the latest released version v2026.7.1. (4b1d39722182)

Likely related people:

  • steipete: The PR author also appears repeatedly in the Google realtime provider history and authored the recent shared realtime-session lifecycle refactor. (role: recent area contributor and lifecycle-refactor author; confidence: high; commits: 4b1d39722182, 131b9e390480; files: extensions/google/realtime-voice-provider.ts, src/gateway/server-methods/talk-client.ts)
  • vincentkoc: Local feature history shows substantial Google realtime work by Vincent Koc, and the GitHub timeline assigns this PR to that account on August 2, 2026. (role: recent Google realtime contributor and assigned reviewer; confidence: high; commits: 213c05182f2, 53d227970e1; files: extensions/google/realtime-voice-provider.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-08-01T16:38:14.295Z sha 4b1d397 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-01T21:14:07.302Z sha 4b1d397 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-01T21:21:29.150Z sha 4b1d397 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-02T07:21:29.952Z sha 4b1d397 :: needs real behavior proof before merge. :: none

@vincentkoc vincentkoc self-assigned this Aug 2, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 2, 2026
@vincentkoc
vincentkoc merged commit b620caa into main Aug 2, 2026
109 of 126 checks passed
@vincentkoc
vincentkoc deleted the codex/qa402-google-live-session-activation-deadline branch August 2, 2026 07:50
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
…on-activation-deadline

fix(google): honor Gemini Live new-session activation deadlines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: google maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants