Skip to content

feat(xai): stream TTS over native websocket#99868

Closed
qingminglong wants to merge 1 commit into
openclaw:mainfrom
qingminglong:codex/99660-xai-streaming-tts
Closed

feat(xai): stream TTS over native websocket#99868
qingminglong wants to merge 1 commit into
openclaw:mainfrom
qingminglong:codex/99660-xai-streaming-tts

Conversation

@qingminglong

@qingminglong qingminglong commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Closes #99660

What Problem This Solves

Fixes an issue where xAI could be used for buffered OpenClaw TTS, but streaming playback callers could not use xAI's native lower-latency streaming TTS WebSocket contract.

Why This Change Was Made

The xAI speech provider now exposes streamSynthesize through the documented native wss://api.x.ai/v1/tts WebSocket flow while leaving existing buffered synthesize and telephony paths on REST /v1/tts. The streaming path uses Node's native WebSocket client and is restricted to the native xAI host so REST-compatible proxy base URLs are not silently treated as xAI WebSocket endpoints.

User Impact

Streaming TTS callers can receive xAI audio chunks as they arrive instead of waiting for a complete buffered audio response, while existing normal TTS attachment and telephony behavior remains unchanged.

Evidence

  • Claim proved: xAI streaming TTS uses the native WebSocket endpoint, sends text.delta then text.done, consumes audio.delta chunks until audio.done, and is wired through the speech provider streaming contract.
  • Commands / artifacts:
  • Observed result: focused tests cover URL/query shape, WebSocket headers, text event ordering, audio chunk decoding, early close, connection error, timeout, release behavior, provider integration, and package dependency ownership.
  • Not tested / proof gaps: no live xAI credential smoke was run, so there is no real-service audio proof. pnpm docs:list was attempted but local pnpm aborted with ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY in this worktree.

@qingminglong
qingminglong requested a review from a team as a code owner July 4, 2026 07:14
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: xai size: L labels Jul 4, 2026
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Dependency Guard

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • extensions/xai/package.json
  • pnpm-lock.yaml

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfile, shrinkwrap, or workspace dependency policy changes are present.
  • Treat package-lock.json and npm-shrinkwrap.json diffs as security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Jul 4, 2026
@openclaw-barnacle openclaw-barnacle Bot added the r: too-many-prs Auto-close: author has more than twenty active PRs. label Jul 4, 2026
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Dependency graph changes are blocked

OpenClaw does not accept dependency graph changes through PRs unless a repository admin or security explicitly authorizes the current head SHA. Dependency updates are generated internally by maintainers so external PRs cannot change the resolved graph.

Detected dependency graph changes:

  • pnpm-lock.yaml changed.
  • extensions/xai/package.json changed dependencies, devDependencies.

Auto-scrub was not attempted because this PR changes package manifest dependency graph fields:

  • extensions/xai/package.json changed dependencies, devDependencies.

Dependency graph changes must be reviewed by security or handled by maintainers internally. Please remove lockfile changes manually if they are not needed.

To remove lockfile changes, restore them from the target branch:

git fetch origin
git checkout 'origin/main' -- 'pnpm-lock.yaml'
git commit -m 'chore: remove dependency lockfile change'
git push

If this PR intentionally needs a dependency graph change, ask a repository admin or member of @openclaw/openclaw-secops to comment:

/allow-dependencies-change

The action will approve the current head SHA (f0cb2b740e3d2a5dc63e47b662eaaadd02bc13b5) when it reruns. A later push requires a fresh approval.

@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.

@openclaw-barnacle openclaw-barnacle Bot closed this Jul 4, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the r: too-many-prs Auto-close: author has more than twenty active PRs. label Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies-changed PR changes dependency-related files docs Improvements or additions to documentation extensions: xai size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(xai): add native streaming TTS WebSocket support

1 participant