Skip to content

fix(openai): ignore blank speech API env keys - #108187

Closed
ooiuuii wants to merge 1 commit into
openclaw:mainfrom
ooiuuii:fix/openai-speech-blank-env-key
Closed

ooiuuii wants to merge 1 commit into
openclaw:mainfrom
ooiuuii:fix/openai-speech-blank-env-key

Conversation

@ooiuuii

@ooiuuii ooiuuii commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #108186.

OpenAI speech provider readiness and synthesis treated a whitespace-only OPENAI_API_KEY environment value as configured. That let a blank env entry pass local checks and reach request construction instead of failing fast as a missing API key.

Why This Change Was Made

Configured OpenAI speech keys already go through string normalization, but the environment fallback was read directly. This change routes both configured and environment keys through the same trim-to-empty handling before isConfigured, synthesize, and synthesizeTelephony use the value.

User Impact

Users with an accidentally blank OPENAI_API_KEY now get the local OpenAI API key missing error and the provider no longer appears configured from whitespace alone. Valid configured keys and valid env keys continue to work.

Evidence

node scripts/run-vitest.mjs extensions/openai/speech-provider.test.ts
Test Files  1 passed (1)
Tests  25 passed (25)
git diff --check
oxfmt --check --threads=1 extensions/openai/speech-provider.ts extensions/openai/speech-provider.test.ts
All matched files use the correct format.
autoreview --mode branch --base upstream/main
autoreview clean: no accepted/actionable findings reported
overall: patch is correct (0.96)

@openclaw-barnacle openclaw-barnacle Bot added extensions: openai size: S r: too-many-prs Auto-close: author has more than twenty active PRs. labels Jul 15, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because the author has more than 20 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit.

@steipete

Copy link
Copy Markdown
Contributor

Canonical fix landed in #108212 as 4108bbca96cde0aef2595316ba8a57adcc04bea8.

Your shared-resolver design and request-path coverage were integrated, extended to the realtime-transcription sibling readiness check, and preserved with Co-authored-by credit in the landed commit. Thanks @ooiuuii.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: openai r: too-many-prs Auto-close: author has more than twenty active PRs. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAI speech treats blank env API key as configured

2 participants