Repository navigation
fix(openai): treat blank env API key as unconfigured in speech provider - #108212
Merged
Merged
Conversation
process.env.OPENAI_API_KEY set to whitespace-only (e.g. ' ') causes isConfigured to return true, but downstream synthesis fails with an unusable bearer token. Add ?.trim() to treat whitespace-only env keys as missing, matching the existing normalization in the image-generation provider (image-generation-provider.ts:347). Fixes openclaw#108186
Co-authored-by: luyifan <[email protected]>
Contributor
|
Land-ready maintainer pass complete on exact head The original three raw speech-key reads are now one normalized resolver shared by readiness, regular synthesis, and telephony synthesis. The sibling realtime-transcription readiness check now matches its already-trimmed runtime authorization path. The exact-SHA gate also exposed a stale max-lines entry left when current main deleted Proof:
Issue #108186 is linked with |
Contributor
|
Merged via squash.
|
This was referenced Jul 16, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 16, 2026
…er (openclaw#108212) * fix(openai): treat blank env API key as unconfigured in speech provider process.env.OPENAI_API_KEY set to whitespace-only (e.g. ' ') causes isConfigured to return true, but downstream synthesis fails with an unusable bearer token. Add ?.trim() to treat whitespace-only env keys as missing, matching the existing normalization in the image-generation provider (image-generation-provider.ts:347). Fixes openclaw#108186 * test(openai): cover speech env key normalization Co-authored-by: luyifan <[email protected]> * fix(openai): normalize realtime transcription env key * chore(ci): prune stale max-lines baseline --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: luyifan <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
steipete
pushed a commit
to lsr911/openclaw
that referenced
this pull request
Jul 16, 2026
A whitespace-only XIAOMI_API_KEY made the Xiaomi MiMo speech provider report configured, then sent an unusable bearer credential from synthesis. - Wrap process.env.XIAOMI_API_KEY with trimToUndefined in isConfigured so blank values are treated as not configured - Wrap process.env.XIAOMI_API_KEY with trimToUndefined in synthesize so blank values are rejected locally before any network request - Add test coverage for whitespace-only and blank env key in both paths This matches the blank-credential guard applied in the OpenAI speech provider (PR openclaw#108212).
steipete
added a commit
that referenced
this pull request
Jul 16, 2026
…er (#108558) * fix(xiaomi): treat blank env API key as unconfigured in speech provider A whitespace-only XIAOMI_API_KEY made the Xiaomi MiMo speech provider report configured, then sent an unusable bearer credential from synthesis. - Wrap process.env.XIAOMI_API_KEY with trimToUndefined in isConfigured so blank values are treated as not configured - Wrap process.env.XIAOMI_API_KEY with trimToUndefined in synthesize so blank values are rejected locally before any network request - Add test coverage for whitespace-only and blank env key in both paths This matches the blank-credential guard applied in the OpenAI speech provider (PR #108212). * refactor(xiaomi): centralize speech key resolution --------- Co-authored-by: Peter Steinberger <[email protected]>
steipete
pushed a commit
to lsr911/openclaw
that referenced
this pull request
Jul 16, 2026
A whitespace-only INWORLD_API_KEY made the Inworld speech provider report configured, then sent an unusable bearer credential from synthesis, telephony synthesis, and voice listing. - Wrap process.env.INWORLD_API_KEY with trimToUndefined in isConfigured so blank values are treated as not configured - Wrap process.env.INWORLD_API_KEY with trimToUndefined in synthesize, synthesizeTelephony, and listVoices so blank values are rejected locally before any network request - Add test coverage for whitespace-only env key in isConfigured and synthesize paths This matches the blank-credential guard pattern applied in the OpenAI (openclaw#108212), Xiaomi (openclaw#108558), and Deepgram (openclaw#108565) providers. Co-Authored-By: Claude <[email protected]>
steipete
added a commit
that referenced
this pull request
Jul 16, 2026
…der (#108783) * fix(inworld): treat blank env API key as unconfigured in speech provider A whitespace-only INWORLD_API_KEY made the Inworld speech provider report configured, then sent an unusable bearer credential from synthesis, telephony synthesis, and voice listing. - Wrap process.env.INWORLD_API_KEY with trimToUndefined in isConfigured so blank values are treated as not configured - Wrap process.env.INWORLD_API_KEY with trimToUndefined in synthesize, synthesizeTelephony, and listVoices so blank values are rejected locally before any network request - Add test coverage for whitespace-only env key in isConfigured and synthesize paths This matches the blank-credential guard pattern applied in the OpenAI (#108212), Xiaomi (#108558), and Deepgram (#108565) providers. Co-Authored-By: Claude <[email protected]> * fix(inworld): centralize speech API key resolution --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
steipete
pushed a commit
to lsr911/openclaw
that referenced
this pull request
Jul 16, 2026
The isGradiumProviderConfigured helper already uses trimToUndefined on GRADIUM_API_KEY, but synthesize and synthesizeTelephony still used the bare env var. This made whitespace-only credentials pass the missing-key guard and send unusable bearer tokens. - Wrap process.env.GRADIUM_API_KEY with trimToUndefined in synthesize - Wrap process.env.GRADIUM_API_KEY with trimToUndefined in synthesizeTelephony - Add test for whitespace-only env key rejection in synthesize This completes the blank-credential guard for the Gradium provider, matching the pattern from OpenAI (openclaw#108212), Xiaomi (openclaw#108558), Deepgram (openclaw#108565), and Inworld (openclaw#108783). Co-Authored-By: Claude <[email protected]>
steipete
added a commit
that referenced
this pull request
Jul 16, 2026
…ths (#108800) * fix(gradium): treat blank env API key as unconfigured in synthesis paths The isGradiumProviderConfigured helper already uses trimToUndefined on GRADIUM_API_KEY, but synthesize and synthesizeTelephony still used the bare env var. This made whitespace-only credentials pass the missing-key guard and send unusable bearer tokens. - Wrap process.env.GRADIUM_API_KEY with trimToUndefined in synthesize - Wrap process.env.GRADIUM_API_KEY with trimToUndefined in synthesizeTelephony - Add test for whitespace-only env key rejection in synthesize This completes the blank-credential guard for the Gradium provider, matching the pattern from OpenAI (#108212), Xiaomi (#108558), Deepgram (#108565), and Inworld (#108783). Co-Authored-By: Claude <[email protected]> * fix(gradium): centralize speech API key resolution --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
This was referenced Jul 17, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 17, 2026
…er (openclaw#108558) * fix(xiaomi): treat blank env API key as unconfigured in speech provider A whitespace-only XIAOMI_API_KEY made the Xiaomi MiMo speech provider report configured, then sent an unusable bearer credential from synthesis. - Wrap process.env.XIAOMI_API_KEY with trimToUndefined in isConfigured so blank values are treated as not configured - Wrap process.env.XIAOMI_API_KEY with trimToUndefined in synthesize so blank values are rejected locally before any network request - Add test coverage for whitespace-only and blank env key in both paths This matches the blank-credential guard applied in the OpenAI speech provider (PR openclaw#108212). * refactor(xiaomi): centralize speech key resolution --------- Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 17, 2026
…der (openclaw#108783) * fix(inworld): treat blank env API key as unconfigured in speech provider A whitespace-only INWORLD_API_KEY made the Inworld speech provider report configured, then sent an unusable bearer credential from synthesis, telephony synthesis, and voice listing. - Wrap process.env.INWORLD_API_KEY with trimToUndefined in isConfigured so blank values are treated as not configured - Wrap process.env.INWORLD_API_KEY with trimToUndefined in synthesize, synthesizeTelephony, and listVoices so blank values are rejected locally before any network request - Add test coverage for whitespace-only env key in isConfigured and synthesize paths This matches the blank-credential guard pattern applied in the OpenAI (openclaw#108212), Xiaomi (openclaw#108558), and Deepgram (openclaw#108565) providers. Co-Authored-By: Claude <[email protected]> * fix(inworld): centralize speech API key resolution --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 17, 2026
…ths (openclaw#108800) * fix(gradium): treat blank env API key as unconfigured in synthesis paths The isGradiumProviderConfigured helper already uses trimToUndefined on GRADIUM_API_KEY, but synthesize and synthesizeTelephony still used the bare env var. This made whitespace-only credentials pass the missing-key guard and send unusable bearer tokens. - Wrap process.env.GRADIUM_API_KEY with trimToUndefined in synthesize - Wrap process.env.GRADIUM_API_KEY with trimToUndefined in synthesizeTelephony - Add test for whitespace-only env key rejection in synthesize This completes the blank-credential guard for the Gradium provider, matching the pattern from OpenAI (openclaw#108212), Xiaomi (openclaw#108558), Deepgram (openclaw#108565), and Inworld (openclaw#108783). Co-Authored-By: Claude <[email protected]> * fix(gradium): centralize speech API key resolution --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
zooqueen
pushed a commit
to zooqueen/openclaw
that referenced
this pull request
Sep 11, 2026
…er (openclaw#108212) * fix(openai): treat blank env API key as unconfigured in speech provider process.env.OPENAI_API_KEY set to whitespace-only (e.g. ' ') causes isConfigured to return true, but downstream synthesis fails with an unusable bearer token. Add ?.trim() to treat whitespace-only env keys as missing, matching the existing normalization in the image-generation provider (image-generation-provider.ts:347). Fixes openclaw#108186 * test(openai): cover speech env key normalization Co-authored-by: luyifan <[email protected]> * fix(openai): normalize realtime transcription env key * chore(ci): prune stale max-lines baseline --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: luyifan <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
zooqueen
pushed a commit
to zooqueen/openclaw
that referenced
this pull request
Sep 11, 2026
…er (openclaw#108558) * fix(xiaomi): treat blank env API key as unconfigured in speech provider A whitespace-only XIAOMI_API_KEY made the Xiaomi MiMo speech provider report configured, then sent an unusable bearer credential from synthesis. - Wrap process.env.XIAOMI_API_KEY with trimToUndefined in isConfigured so blank values are treated as not configured - Wrap process.env.XIAOMI_API_KEY with trimToUndefined in synthesize so blank values are rejected locally before any network request - Add test coverage for whitespace-only and blank env key in both paths This matches the blank-credential guard applied in the OpenAI speech provider (PR openclaw#108212). * refactor(xiaomi): centralize speech key resolution --------- Co-authored-by: Peter Steinberger <[email protected]>
zooqueen
pushed a commit
to zooqueen/openclaw
that referenced
this pull request
Sep 11, 2026
…der (openclaw#108783) * fix(inworld): treat blank env API key as unconfigured in speech provider A whitespace-only INWORLD_API_KEY made the Inworld speech provider report configured, then sent an unusable bearer credential from synthesis, telephony synthesis, and voice listing. - Wrap process.env.INWORLD_API_KEY with trimToUndefined in isConfigured so blank values are treated as not configured - Wrap process.env.INWORLD_API_KEY with trimToUndefined in synthesize, synthesizeTelephony, and listVoices so blank values are rejected locally before any network request - Add test coverage for whitespace-only env key in isConfigured and synthesize paths This matches the blank-credential guard pattern applied in the OpenAI (openclaw#108212), Xiaomi (openclaw#108558), and Deepgram (openclaw#108565) providers. Co-Authored-By: Claude <[email protected]> * fix(inworld): centralize speech API key resolution --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
zooqueen
pushed a commit
to zooqueen/openclaw
that referenced
this pull request
Sep 11, 2026
…ths (openclaw#108800) * fix(gradium): treat blank env API key as unconfigured in synthesis paths The isGradiumProviderConfigured helper already uses trimToUndefined on GRADIUM_API_KEY, but synthesize and synthesizeTelephony still used the bare env var. This made whitespace-only credentials pass the missing-key guard and send unusable bearer tokens. - Wrap process.env.GRADIUM_API_KEY with trimToUndefined in synthesize - Wrap process.env.GRADIUM_API_KEY with trimToUndefined in synthesizeTelephony - Add test for whitespace-only env key rejection in synthesize This completes the blank-credential guard for the Gradium provider, matching the pattern from OpenAI (openclaw#108212), Xiaomi (openclaw#108558), Deepgram (openclaw#108565), and Inworld (openclaw#108783). Co-Authored-By: Claude <[email protected]> * fix(gradium): centralize speech API key resolution --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
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.
What Problem This Solves
A whitespace-only
OPENAI_API_KEYmade the OpenAI speech provider report configured, then sent an unusable bearer credential from regular or telephony synthesis.Closes #108186.
Why This Change Was Made
trimToUndefinedhelper.isConfigured, regular synthesis, and telephony synthesis.src/agents/modes/interactive/theme/theme.ts; this was found by the exact-SHA gate.This includes the clean shared-resolver approach from duplicate #108187. @ooiuuii is preserved as a coauthor alongside this PR's original contributor @lsr911.
User Impact
Verification
fdc63f17e178eaa0beb8df77b7717da026059899.extensions/openai/speech-provider.test.ts— 24/24 passed.wspackage resolution, so exact-head hosted CI owns that proof.node scripts/check-max-lines-ratchet.mjs --base origin/main— passed with 1,204 grandfathered suppressions.Risk / Compatibility
Low. Existing explicit-config precedence remains unchanged. Only surrounding whitespace and blank values are normalized. No config, SDK, or persistence surface changes.
Changelog
Release-note context only; no contributor-owned root changelog edit.