Repository navigation
Fix OpenAI audio auth to use API keys - #90793
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 6, 2026, 12:10 AM ET / 04:10 UTC. Summary PR surface: Source +43, Tests +204. Total +247 across 7 files. Reproducibility: yes. Current main is source-reproducible because media execution and selection omit Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow auth-resolution fix after normal maintainer checks so OpenAI audio uses platform API-key auth while non-audio media and non-OpenAI provider auth behavior remain unchanged. Do we have a high-confidence way to reproduce the issue? Yes. Current main is source-reproducible because media execution and selection omit Is this the best way to solve the issue? Yes. The PR is the narrowest maintainable fix I found: it reuses the existing model-auth API-key-only guard and scopes the new auth context to OpenAI audio, while tests cover OAuth-plus-API-key audio, OAuth-only fallback selection, and video remaining unscoped. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 092075534e54. Label changesLabel justifications:
Evidence reviewedPR surface: Source +43, Tests +204. Total +247 across 7 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
There was a problem hiding this comment.
Thanks for the focused fix - my local review found an issue I'm pushing a small fix for:
- With this PR, OpenAI audio execution requires the
openai-audio-transcriptionsauth context, so ChatGPT/Codex OAuth is correctly rejected for/audio/transcriptions. But auto-selection was still checking plainopenaiauth, so OAuth-only OpenAI could be selected before another usable provider like Mistral, then fail during execution without falling through. - The small fix shares the OpenAI-audio auth context between selection and execution. Now OAuth-only OpenAI is skipped for audio transcription, and a provider with a valid API key can be selected instead.
- Adding a regression test for OAuth-only OpenAI + usable Mistral auth.
- users with OAuth-only OpenAI plus another usable audio provider, local Whisper, or Mistral may now get successful audio transcription through that fallback instead of an OpenAI auth failure.
Posted in error; maintainer requested removal.
Signed-off-by: sallyom <[email protected]>
* fix(media): require api key auth for OpenAI audio * fix(media): narrow OpenAI audio auth API scope * fix(media): align OpenAI audio auth selection Signed-off-by: sallyom <[email protected]> --------- Signed-off-by: sallyom <[email protected]> Co-authored-by: sallyom <[email protected]>
Summary
openai-audio-transcriptionsAPI contract.openai:defaultis OAuth butOPENAI_API_KEYis available for audio.Why
OpenAI chat/Codex OAuth can be valid for model turns, but
/audio/transcriptionsrequires an OpenAI platform API key. Media-understanding audio previously resolved provider auth without amodelApi, so the generic OpenAI OAuth profile could be selected before the API key path. That made audio transcription fail even on hosts that had a valid platform key configured for transcription.Real behavior proof
Behavior addressed: OpenAI audio transcription must use a platform API key even when the OpenAI provider also has an OAuth
openai:defaultprofile configured for chat/Codex use.Real environment tested: Local OpenClaw source checkout on this branch, real OpenAI HTTPS calls, real
OPENAI_API_KEYloaded from the gateway environment, and an isolated temporary agent auth store containing an intentionally invalid OAuthopenai:defaultprofile.Exact steps or command run after this patch: Ran a source-level
node --import tsx --input-type=moduleproof script that generated a short MP3 through OpenAI/audio/speech, saved an isolated invalid OAuth auth profile foropenai:default, then calledrunCapability({ capability: "audio" })with the real bundled OpenAI media-understanding provider andmodel: "whisper-1".Evidence after fix:
{ "ok": true, "provider": "openai", "model": "whisper-1", "transcript": "Open CLAW Audio API Keyproof.", "outcome": "success", "attempts": [ { "provider": "openai", "model": "whisper-1", "outcome": "success" } ], "oauthProfilePresent": true, "envApiKeyPresent": true }Observed result after fix: The audio transcription succeeded through OpenAI with a real platform API key even though the configured
openai:defaultOAuth profile was present and intentionally invalid.What was not tested: No packaged gateway restart or channel voice-note round trip was run for this PR; the live proof covered the source media-understanding auth/transcription path that this patch changes.
Verification
node_modules/.bin/oxfmt src/media-understanding/runner.entries.ts src/media-understanding/runner.local-no-auth.test.tsnode_modules/.bin/oxlint src/media-understanding/runner.entries.ts src/media-understanding/runner.local-no-auth.test.tsnode scripts/run-vitest.mjs src/media-understanding/runner.local-no-auth.test.ts.agents/skills/autoreview/scripts/autoreview --mode local-> clean, no accepted/actionable findings