feat(google): add Gemini TTS provider#67515
Conversation
Greptile SummaryThis PR adds a Two minor items worth a look before merge: the Confidence Score: 5/5Safe to merge; no logic or security defects found in the new speech provider path. All remaining findings are P2: a planning document committed to the repo root, and an unrelated type-narrowing change. Neither affects runtime correctness or security. The core implementation — key resolution, WAV wrapping, URL validation, and registration — is correct and consistent with existing providers. plan.md (should be removed); extensions/google/index.ts (unexplained type change)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7db083a1ac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
7db083a to
da2c085
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: da2c085c9e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
obviyus
left a comment
There was a problem hiding this comment.
Verified the Google Gemini TTS registration and synthesis path, including targeted coverage for provider registration, WAV/PCM output, and config-backed provider selection.
Maintainer follow-up: added the Unreleased changelog entry, fixed auto-selection so models.providers.google.apiKey counts during primary TTS provider selection, and narrowed Google-specific directive aliases to avoid shadowing by higher-priority providers.
Local gate: pnpm test src/plugins/contracts/tts.config.contract.test.ts extensions/google/speech-provider.test.ts extensions/google/plugin-registration.contract.test.ts and pnpm check.
|
Landed on main. Thanks @barronlroth. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f1d391371
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return normalizeResolvedSecretInputString({ | ||
| value: cfg?.models?.providers?.google?.apiKey, | ||
| path: "models.providers.google.apiKey", |
There was a problem hiding this comment.
Handle SecretRef model-provider keys in Google TTS auth fallback
resolveGoogleTtsModelProviderApiKey reads models.providers.google.apiKey with normalizeResolvedSecretInputString, which throws on unresolved SecretRef inputs instead of treating them as not-yet-resolved values. Since both isConfigured and synthesis call this path, a config that stores the Google model-provider key as a SecretRef will make Google TTS fail during provider selection/runtime checks before any request is sent, even though the fallback path is documented as supported.
Useful? React with 👍 / 👎.
…roth) * Add Google Gemini TTS provider * Remove committed planning artifact * Explain Google media provider type shape * google: distill Gemini TTS provider * fix: add Google Gemini TTS provider (openclaw#67515) (thanks @barronlroth) * fix: honor cfg-backed Google TTS selection (openclaw#67515) (thanks @barronlroth) * fix: narrow Google TTS directive aliases (openclaw#67515) (thanks @barronlroth) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
…roth) * Add Google Gemini TTS provider * Remove committed planning artifact * Explain Google media provider type shape * google: distill Gemini TTS provider * fix: add Google Gemini TTS provider (openclaw#67515) (thanks @barronlroth) * fix: honor cfg-backed Google TTS selection (openclaw#67515) (thanks @barronlroth) * fix: narrow Google TTS directive aliases (openclaw#67515) (thanks @barronlroth) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
…roth) * Add Google Gemini TTS provider * Remove committed planning artifact * Explain Google media provider type shape * google: distill Gemini TTS provider * fix: add Google Gemini TTS provider (openclaw#67515) (thanks @barronlroth) * fix: honor cfg-backed Google TTS selection (openclaw#67515) (thanks @barronlroth) * fix: narrow Google TTS directive aliases (openclaw#67515) (thanks @barronlroth) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
…roth) * Add Google Gemini TTS provider * Remove committed planning artifact * Explain Google media provider type shape * google: distill Gemini TTS provider * fix: add Google Gemini TTS provider (openclaw#67515) (thanks @barronlroth) * fix: honor cfg-backed Google TTS selection (openclaw#67515) (thanks @barronlroth) * fix: narrow Google TTS directive aliases (openclaw#67515) (thanks @barronlroth) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
…roth) * Add Google Gemini TTS provider * Remove committed planning artifact * Explain Google media provider type shape * google: distill Gemini TTS provider * fix: add Google Gemini TTS provider (openclaw#67515) (thanks @barronlroth) * fix: honor cfg-backed Google TTS selection (openclaw#67515) (thanks @barronlroth) * fix: narrow Google TTS directive aliases (openclaw#67515) (thanks @barronlroth) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
…roth) * Add Google Gemini TTS provider * Remove committed planning artifact * Explain Google media provider type shape * google: distill Gemini TTS provider * fix: add Google Gemini TTS provider (openclaw#67515) (thanks @barronlroth) * fix: honor cfg-backed Google TTS selection (openclaw#67515) (thanks @barronlroth) * fix: narrow Google TTS directive aliases (openclaw#67515) (thanks @barronlroth) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
…roth) * Add Google Gemini TTS provider * Remove committed planning artifact * Explain Google media provider type shape * google: distill Gemini TTS provider * fix: add Google Gemini TTS provider (openclaw#67515) (thanks @barronlroth) * fix: honor cfg-backed Google TTS selection (openclaw#67515) (thanks @barronlroth) * fix: narrow Google TTS directive aliases (openclaw#67515) (thanks @barronlroth) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
…roth) * Add Google Gemini TTS provider * Remove committed planning artifact * Explain Google media provider type shape * google: distill Gemini TTS provider * fix: add Google Gemini TTS provider (openclaw#67515) (thanks @barronlroth) * fix: honor cfg-backed Google TTS selection (openclaw#67515) (thanks @barronlroth) * fix: narrow Google TTS directive aliases (openclaw#67515) (thanks @barronlroth) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
…roth) * Add Google Gemini TTS provider * Remove committed planning artifact * Explain Google media provider type shape * google: distill Gemini TTS provider * fix: add Google Gemini TTS provider (openclaw#67515) (thanks @barronlroth) * fix: honor cfg-backed Google TTS selection (openclaw#67515) (thanks @barronlroth) * fix: narrow Google TTS directive aliases (openclaw#67515) (thanks @barronlroth) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
…roth) * Add Google Gemini TTS provider * Remove committed planning artifact * Explain Google media provider type shape * google: distill Gemini TTS provider * fix: add Google Gemini TTS provider (openclaw#67515) (thanks @barronlroth) * fix: honor cfg-backed Google TTS selection (openclaw#67515) (thanks @barronlroth) * fix: narrow Google TTS directive aliases (openclaw#67515) (thanks @barronlroth) --------- Co-authored-by: Ayaan Zaidi <[email protected]>
Summary
googleprovider id.generateContentwithresponseModalities: ["AUDIO"], preserve Gemini audio tags in the transcript, wrap 24 kHz PCM as WAV for normal TTS, and return PCM directly for Talk/telephony.messages.tts.providers.google.apiKey,models.providers.google.apiKey,GEMINI_API_KEY, andGOOGLE_API_KEY.contracts.speechProviders: ["google"]and update docs/plan for config, output format, Cloud-vs-Gemini key semantics, and native voice-note limitations.Closes #67458
Security
https://generativelanguage.googleapis.comand does not add Cloud Text-to-Speech, OAuth, or auth-profile reuse in this phase.x-goog-api-keyheaders.Validation
pnpm test:extension googlepnpm test:contracts:pluginspnpm exec oxlint --type-aware -- extensions/google/index.ts extensions/google/speech-provider.ts extensions/google/speech-provider.test.ts extensions/google/plugin-registration.contract.test.ts extensions/google/test-api.ts test/helpers/plugins/plugin-registration-contract-cases.tsgit diff --checkpnpm tsgocurrently fails on pre-existing TelegramAbortSignaltype mismatches inextensions/telegram/src/bot.ts:193andextensions/telegram/src/bot.ts:195; no Google TTS type errors were reported before that blocker.AI Assistance