Repository navigation
fix(google): accept base64url provider media - #116204
Patrick-Erichsen merged 7 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 6, 2026, 8:38 PM ET / August 7, 2026, 00:38 UTC. ClawSweeper reviewWhat this changesThe PR converts URL-safe Base64 media from Google Live, speech, image, music, and video responses before existing strict media validation. Merge readinessKeep open for maintainer review. Current main rejects URL-safe Base64 at all five Google media boundaries; the PR’s Google-local adapter is the right repair shape, but exact-head CI failures and direct verification of the pinned SDK/parser contract remain unresolved. Priority: P2 Review scores
Verification
How this fits togetherGoogle’s bundled provider plugin receives inline media from Google APIs and converts it into audio or generated-media outputs. This change sits at the provider boundary immediately before shared strict Base64 validation. flowchart LR
A[Google media response] --> B[Google provider adapter]
B --> C{One Base64 alphabet?}
C -->|URL-safe| D[Standard alphabet form]
C -->|Mixed| E[Provider error]
D --> F[Strict media validation]
F --> G[Audio and generated-media output]
Decision needed
Why: The trace exercises the patched production callback with real-session PCM but synthesizes the URL-safe payload; unavailable dependency sources and DNS prevent independently proving the upstream wire behavior. Before merge
Agent review detailsSecurityNone. PR surfaceSource +38, Tests +185. Total +223 across 11 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land only after confirming the SDK/parser contract and obtaining green exact-head checks, while retaining the Google-local one-pass normalization and unchanged shared strict validation. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main’s strict validator rejects URL-safe characters at each affected Google path. The supplied live bridge trace exercises the repaired callback, though it does not directly observe Google emitting URL-safe text. Is this the best way to solve the issue? Yes, conditionally: adapting ProtoJSON only in the Google plugin preserves the shared strict validator and avoids changing other providers. The upstream parser contract still needs direct confirmation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ec023a433614. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (19 earlier review cycles; latest 8 shown)
|
85b2ecc to
02cf2be
Compare
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
Patrick-Erichsen
left a comment
There was a problem hiding this comment.
Approved for landing at exact head ba449c3a3c4fa95e0b93aaec7d9432cbf7a8c128, subject to the remaining exact-head CI and ClawSweeper mechanical gates.
Dependency contract is now directly verified:
- OpenClaw pins
@google/genai2.13.0 inextensions/google/package.json:8. - That exact SDK parses the Live WebSocket JSON and assigns the parsed fields without decoding bytes: https://github.com/googleapis/js-genai/blob/v2.13.0/src/live.ts#L38-L64
- Its generated bytes transformer returns the input string unchanged: https://github.com/googleapis/js-genai/blob/v2.13.0/src/_base_transformers.ts#L7-L12
- The official ProtoJSON mapping explicitly accepts either standard or URL-safe base64, with or without padding: https://protobuf.dev/programming-guides/json/#representation-of-each-type
- Fresh autoreview is clean (0.98 confidence), and the final tree preserves the reviewed 11-file patch exactly.
This satisfies the prior ClawSweeper dependency-contract rank-up move. The exact-head CI run is still completing: https://github.com/openclaw/openclaw/actions/runs/31136519467
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
Merged via squash.
|
* origin/main: (58 commits) fix(test): restart shared gateway after migration convergence (openclaw#120089) fix(ui): make active-run steering reliable (openclaw#120083) fix(telegram): preserve voice fallback text test(swift): preserve queued websocket frames (openclaw#120106) fix: reject missing oxlint shard selectors (openclaw#120096) test(channels): align prerelease fallback catalog spec (openclaw#120092) fix(node-cli): warn when systemd user lingering is disabled after install (openclaw#118430) fix(diagnostics): preserve CLI turn usage totals (openclaw#120100) fix(gateway): derive lock and coordinator paths from the resolved state dir (openclaw#120110) fix(release): isolate private Telegram QA harness (openclaw#120088) test(agents): exercise execution attribution ingress guard fix(gateway): defer attribution until admission succeeds refactor(agents): centralize exact execution attribution fix(google): accept base64url provider media (openclaw#116204) fix(plugins): warn when registerHook uses a typed hook event name (openclaw#118601) fix(canvas): serve Content-Length on A2UI HEAD responses (openclaw#117961) fix(gateway): make doctor dreaming timestamp comparators NaN-safe (openclaw#118749) fix(heartbeat): explain target-none skips (openclaw#119689) fix(security): stop recommending retired install-policy bypasses (openclaw#120011) fix(plugins): preserve startup release during repair (openclaw#120085) ... # Conflicts: # CHANGELOG.md # src/config/sessions/session-accessor.sqlite-transcript-write.ts
* fix(google): accept base64url in Live audio * fix(google): normalize base64url in one pass * fix(google): normalize base64url at every Google media boundary * fix(google): normalize image media and avoid double music validation * test(google): exercise URL-safe base64 fixtures --------- Co-authored-by: Patrick Erichsen <[email protected]>
What Problem This Solves
Fixes Google provider media responses (Live voice, TTS, video, music, image) being rejected when ProtoJSON uses the URL-safe Base64 alphabet.
Related: #106969
Why This Change Was Made
Google provider responses carry inline media through ProtoJSON, whose bytes fields accept either the standard or the URL-safe Base64 alphabet. Every Google inbound-media boundary — Live voice, TTS, video, music, and image — now converts
-/_to+//before the shared strict canonical validator, so no Google surface rejects a valid URL-safe payload while the malformed-media guard stays intact. Alphabet conversion is separate from validation: music and image assets are converted once at the Google boundary and then validated exactly once by their shared asset helpers, and the shared media validator is unchanged.User Impact
Google Live voice, TTS, video, music, and image generation can all accept valid Base64url provider media without weakening their malformed-media guards.
Evidence
Real Google Live callback through the patched bridge
pnpm exec tsx proof-google-live-base64url.ts(source below) connected a real Google Live session with a redactedGEMINI_API_KEY, and the model produced speech. Real PCM audio crossed the production bridge callback on the exact reviewed head; the same production callback accepted the URL-safe form of those same bytes with an identical SHA-256, while the strict validator onmainrejects it and the mixed-alphabet negative control still terminates the session with the named malformed-audio error.[-_]→+//); mixed-alphabet input is rejected before validation, and music/image payloads are validated exactly once by their shared asset helpers.@google/genai2.13.0 parses Live WebSocket messages withJSON.parse+Object.assignand performs no Base64 alphabet transformation (node_modules/@google/genai/dist/node/index.cjs:14443), so a URL-safe payload reaches the bridge unchanged and ProtoJSON parsers accept standard or URL-safe Base64 with or without padding.proof-google-live-base64url.ts
AI-assisted: built with Codex