Skip to content

fix(inworld): treat blank env API key as unconfigured in speech provider - #108783

Merged
steipete merged 2 commits into
openclaw:mainfrom
lsr911:fix-inworld-blank-api-key
Jul 16, 2026
Merged

steipete merged 2 commits into
openclaw:mainfrom
lsr911:fix-inworld-blank-api-key

Conversation

@lsr911

@lsr911 lsr911 commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A whitespace-only INWORLD_API_KEY made the Inworld speech provider report configured, then sent an unusable HTTP Basic credential from synthesis, telephony synthesis, and voice listing.

Why This Change Was Made

  • Route request, provider-config, and environment credentials through one Inworld resolver backed by the shared speech-provider API-key normalizer.
  • Use that resolver from all four entrypoints: listVoices, isConfigured, synthesize, and synthesizeTelephony.
  • Reject blank credentials before the Inworld provider clients or network layer run.

User Impact

Whitespace-only credentials no longer select Inworld or reach request construction. Nonblank request/config/environment precedence is unchanged.

Evidence

Production-entrypoint probe, importing buildInworldSpeechProvider and replacing global fetch with a call counter:

$ mise exec node@24 -- node --import tsx .local/inworld-blank-key-proof.ts
configured=false
voices=Inworld API key missing
synthesis=Inworld API key missing
telephony=Inworld API key missing
fetchCalls=0

Focused regression:

$ node scripts/run-vitest.mjs extensions/inworld/speech-provider.test.ts
Test Files  1 passed (1)
Tests  13 passed (13)

Hosted changed-file gate: format, SDK API baseline, extension and extension-test typechecks, lint, plugin boundaries, and runtime guards passed in Blacksmith Testbox.

Risk / Compatibility

Low. The change only normalizes credential presence at the provider owner boundary and preserves existing precedence and HTTP Basic credential handling.

AI-assisted: contributor patch and maintainer rewrite used coding agents.

@openclaw-barnacle openclaw-barnacle Bot added extensions: inworld Extension: inworld size: XS triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 16, 2026
@lsr911
lsr911 force-pushed the fix-inworld-blank-api-key branch from 1738ffd to 5fc79c1 Compare July 16, 2026 08:58
@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 real behavior proof before merge. Reviewed July 16, 2026, 5:07 AM ET / 09:07 UTC.

Summary
The PR normalizes whitespace-only INWORLD_API_KEY values across Inworld readiness, voice listing, synthesis, and telephony synthesis paths and adds regression tests.

PR surface: Source +3, Tests +25. Total +28 across 2 files.

Reproducibility: yes. from source inspection: a whitespace-only JavaScript environment string is truthy, so the existing raw reads report configuration and reach request code. The path is source-reproducible, although no runtime reproduction was performed during this read-only review.

Review metrics: none identified.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

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

Rank-up moves:

  • [P1] Add redacted terminal or live runtime output showing the blank environment key is rejected locally before any Inworld request.
  • Rebase onto current main and rerun the focused Inworld speech-provider checks on the resulting head.

Proof guidance:

  • [P1] Needs real behavior proof before merge: Only automated regression tests are described; before merge, add redacted terminal or live output showing INWORLD_API_KEY=' ' is treated as unconfigured and rejected before network access. Updating the PR body should trigger review automatically; otherwise ask a maintainer to comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] The PR head is behind current main, so its source and focused validation should be refreshed against the actual merge result before landing.

Maintainer options:

  1. Decide the mitigation before merge
    Use one provider-owned normalized Inworld credential resolution path across readiness, voice listing, synthesis, and telephony, then demonstrate with redacted runtime output that a whitespace-only environment key fails locally before any network request.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] No automated repair is needed; the remaining blocker is contributor-supplied real behavior proof and a current-main refresh, not a concrete code defect.

Security
Cleared: The focused diff adds no dependency, workflow, permission, secret exposure, or supply-chain change and rejects an unusable credential earlier.

Review details

Best possible solution:

Use one provider-owned normalized Inworld credential resolution path across readiness, voice listing, synthesis, and telephony, then demonstrate with redacted runtime output that a whitespace-only environment key fails locally before any network request.

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

Yes from source inspection: a whitespace-only JavaScript environment string is truthy, so the existing raw reads report configuration and reach request code. The path is source-reproducible, although no runtime reproduction was performed during this read-only review.

Is this the best way to solve the issue?

Yes—the provider-owned normalization is the narrowest maintainable fix and matches the merged OpenAI precedent. Consolidating the repeated reads into one resolver would further reduce drift, but the current shape has no proven blocking correctness defect.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P2: This is a valid, narrowly scoped provider bug that avoids delayed authentication failures but has limited blast radius.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Only automated regression tests are described; before merge, add redacted terminal or live output showing INWORLD_API_KEY=' ' is treated as unconfigured and rejected before network access. Updating the PR body should trigger review automatically; otherwise ask a maintainer to comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a valid, narrowly scoped provider bug that avoids delayed authentication failures but has limited blast radius.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Only automated regression tests are described; before merge, add redacted terminal or live output showing INWORLD_API_KEY=' ' is treated as unconfigured and rejected before network access. Updating the PR body should trigger review automatically; otherwise ask a maintainer to comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +3, Tests +25. Total +28 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 7 4 +3
Tests 1 25 0 +25
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 32 4 +28

What I checked:

Likely related people:

  • cshape: Authored the original Inworld speech-provider implementation and its provider-specific configuration and request paths. (role: introduced behavior; confidence: high; commits: e0a5e6a239f1, 1fde582; files: extensions/inworld/speech-provider.ts, extensions/inworld/tts.ts, docs/providers/inworld.md)
  • steipete: Hardened and merged the original Inworld provider, then merged the closely related OpenAI blank-credential normalization pattern. (role: merger and adjacent owner; confidence: high; commits: a49957ad76a0, 4108bbca96cd; files: extensions/inworld/speech-provider.ts, extensions/openai/speech-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.

@steipete steipete self-assigned this Jul 16, 2026
@steipete
steipete force-pushed the fix-inworld-blank-api-key branch from 5fc79c1 to 8da37c1 Compare July 16, 2026 12:45
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed size: XS triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 16, 2026
lsr911 and others added 2 commits July 16, 2026 13:47
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
steipete force-pushed the fix-inworld-blank-api-key branch from 8da37c1 to 5abc1b0 Compare July 16, 2026 12:47
@steipete

Copy link
Copy Markdown
Contributor

Maintainer proof complete.

  • Reworked Inworld auth around one provider-owned resolver backed by the shared speech-provider API-key normalizer. isConfigured, listVoices, synthesize, and synthesizeTelephony now share request/config/environment blank-key handling and preserve valid-key precedence.
  • Production-entrypoint probe with a fetch counter: configured=false; voices, buffered synthesis, and telephony each return Inworld API key missing; fetchCalls=0.
  • node scripts/run-vitest.mjs extensions/inworld/speech-provider.test.ts: 13 tests passed.
  • node scripts/check-changed.mjs -- extensions/inworld/speech-provider.ts extensions/inworld/speech-provider.test.ts: hosted format, SDK baseline, extension typechecks, extension-test typechecks, lint, plugin boundaries, and runtime guards passed (Testbox run).
  • Autoreview of the exact final tree: clean, no accepted/actionable findings, confidence 0.98.
  • Real behavior proof: green (run).
  • Exact-head CI for 5abc1b01f8c684a0419e4d458026119d895ad2a3: green (run).

Best-fix judgment: yes. The original four local trims were correct but duplicated auth policy and left the direct voice-list override outside one owner. The rewrite gives Inworld one resolver and uses the shared cross-provider normalization contract.

@steipete
steipete merged commit 7a81f29 into openclaw:main Jul 16, 2026
83 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

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]>
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
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: inworld Extension: inworld P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants