Skip to content

fix(elevenlabs): reject blank realtime transcription keys - #108916

Merged
steipete merged 2 commits into
openclaw:mainfrom
RileyJJY:fix/elevenlabs-blank-env-api-key
Jul 23, 2026
Merged

steipete merged 2 commits into
openclaw:mainfrom
RileyJJY:fix/elevenlabs-blank-env-api-key

Conversation

@RileyJJY

@RileyJJY RileyJJY commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where a whitespace-only legacy XI_API_KEY makes ElevenLabs realtime transcription report itself configured, then forwards the blank value as the WebSocket xi-api-key header instead of failing locally as unconfigured.

Why This Change Was Made

The realtime transcription provider now uses one credential resolver for both readiness and session creation. It preserves the existing precedence—explicit provider config, the existing profile/ELEVENLABS_API_KEY resolver, then legacy XI_API_KEY—while normalizing the legacy value before accepting it.

The original branch was narrowed during maintainer review:

  • The speech assertion was removed because current main already has stronger blank-key coverage.
  • The media-understanding hunk was removed because the canonical media runner prepares and normalizes credentials before invoking the provider.

User Impact

Whitespace-only legacy keys no longer select a broken realtime provider or reach the network. isConfigured returns false, and direct session creation throws the existing ElevenLabs API key missing error before constructing a WebSocket. Valid configured, profile, ELEVENLABS_API_KEY, and legacy XI_API_KEY credentials retain their prior precedence.

Evidence

Deterministic blank-key regression:

  • Profile fallback is mocked to prevent a developer shell key from hiding the failure.
  • isConfigured returns false for ELEVENLABS_API_KEY="" and XI_API_KEY=" ".
  • createSession throws ElevenLabs API key missing before socket construction.

Focused provider proof on the final rebased branch:

Blacksmith Testbox: tbx_01ky747q6jt8k1f9ac9gtqmaty
Test Files  3 passed (3)
Tests       19 passed (19)

https://github.com/openclaw/openclaw/actions/runs/29994676478

Real authenticated behavior proof on Node 24 using the production ElevenLabs provider and realtime WebSocket session:

{"connected":true,"errorCount":0}

Additional proof:

AI-assisted: built with Codex and repaired/verified by maintainers.

@RileyJJY
RileyJJY force-pushed the fix/elevenlabs-blank-env-api-key branch 3 times, most recently from 1fb140b to a2d45ac Compare July 16, 2026 11:10
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 16, 2026
@clawsweeper

clawsweeper Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 20, 2026, 2:55 AM ET / 06:55 UTC.

Summary
The PR trims whitespace-only ElevenLabs environment-key fallbacks in realtime transcription and media-understanding code and adds regression assertions for realtime transcription and speech readiness.

PR surface: Source +3, Tests +18. Total +21 across 4 files.

Reproducibility: yes. from source: set ELEVENLABS_API_KEY empty and XI_API_KEY to whitespace, then call the affected provider readiness/runtime paths. The supplied PR body and accepted proof label describe the expected pre-network missing-key result, but this read-only review did not execute the path.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Rebase or otherwise refresh the exact merge head, then rerun the focused ElevenLabs provider regression checks.

Risk before merge

  • [P1] The branch is behind current main; refresh the exact merge result and rerun the focused ElevenLabs provider checks before landing so the reviewed behavior matches the merge head.

Maintainer options:

  1. Decide the mitigation before merge
    Keep one normalized environment-key fallback behavior across all ElevenLabs provider entry points, then rebase the PR and validate the focused readiness and pre-network missing-key paths on the exact merge head.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P2] No mechanical repair is indicated; a maintainer should review the refreshed merge head and focused provider proof before landing.

Security
Cleared: The diff only normalizes existing environment credential strings before existing guards and adds tests; it adds no dependency, permission, workflow, secret-handling, or execution surface.

Review details

Best possible solution:

Keep one normalized environment-key fallback behavior across all ElevenLabs provider entry points, then rebase the PR and validate the focused readiness and pre-network missing-key paths on the exact merge head.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: set ELEVENLABS_API_KEY empty and XI_API_KEY to whitespace, then call the affected provider readiness/runtime paths. The supplied PR body and accepted proof label describe the expected pre-network missing-key result, but this read-only review did not execute the path.

Is this the best way to solve the issue?

Yes. Trimming the environment fallback at the existing resolution points preserves explicit configuration precedence and makes readiness and runtime agree without adding a new setting or duplicate provider mechanism.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 34f942e89db0.

Label changes

Label justifications:

  • P2: This fixes confusing provider credential handling with a bounded impact on ElevenLabs speech and transcription configuration.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body records an after-fix pre-network runtime result for empty and whitespace-only keys, and the PR carries proof: sufficient; the stated behavior directly covers the changed credential-resolution path.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body records an after-fix pre-network runtime result for empty and whitespace-only keys, and the PR carries proof: sufficient; the stated behavior directly covers the changed credential-resolution path.
Evidence reviewed

PR surface:

Source +3, Tests +18. Total +21 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 6 3 +3
Tests 2 19 1 +18
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 25 4 +21

What I checked:

Likely related people:

  • RileyJJY: Authored the submitted ElevenLabs credential-normalization patch and its focused regression assertions; no repository-history owner could be established from the supplied read-only evidence. (role: current change author; confidence: low; commits: 49b00c8096dc; files: extensions/elevenlabs/realtime-transcription-provider.ts, extensions/elevenlabs/media-understanding-provider.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (5 earlier review cycles)
  • reviewed 2026-07-16T11:15:24.623Z sha a2d45ac3bd9c8d9206b87e2452ab24dc3d5ba06e :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-16T11:57:49.056Z sha a2d45ac3bd9c8d9206b87e2452ab24dc3d5ba06e :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-16T12:40:21.431Z sha a2d45ac3bd9c8d9206b87e2452ab24dc3d5ba06e :: needs maintainer review before merge. :: none
  • reviewed 2026-07-16T15:02:36.324Z sha faf73b68b7465f476b3f3f79a4d20c98213b7fd2 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-17T23:42:31.741Z sha 386beeb9a69504f757c63a7cb1b6a9105344433e :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 16, 2026
@RileyJJY
RileyJJY force-pushed the fix/elevenlabs-blank-env-api-key branch 4 times, most recently from 49b00c8 to 3b73dcb Compare July 23, 2026 00:21
@steipete
steipete force-pushed the fix/elevenlabs-blank-env-api-key branch from 3b73dcb to e80d506 Compare July 23, 2026 09:30
@steipete steipete changed the title fix(elevenlabs): treat blank env API key as unconfigured in speech and transcription providers fix(elevenlabs): reject blank realtime transcription keys Jul 23, 2026
@steipete

Copy link
Copy Markdown
Contributor

Land-ready maintainer verification is complete on narrowed head e80d5062251ec773c2cb950d935b2afa3060a795.

What changed during maintainer review:

  • The PR is now scoped only to ElevenLabs realtime transcription.
  • A single normalized credential resolver is shared by readiness and session creation.
  • The superseded speech assertion and noncanonical media-understanding hunk were removed.
  • The regression mocks profile fallback, proves whitespace-only keys report unconfigured, and proves session construction fails before any WebSocket is created.

Proof:

Known proof gap: no audio was streamed after connection because the bug is credential selection and pre-network readiness. The live smoke proves valid-key session authentication and connection; the deterministic regression proves blank keys fail before socket construction.

@steipete
steipete merged commit f20e747 into openclaw:main Jul 23, 2026
89 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 24, 2026
…08916)

* fix(elevenlabs): treat blank env API key as unconfigured in speech and transcription providers

* fix(elevenlabs): normalize realtime auth lookup

Co-authored-by: RileyJJY <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: elevenlabs P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants