Skip to content

feat(openai): support saved GPT-Live voices - #175940

Closed
ptahdunbar wants to merge 10 commits into
openclaw:mainfrom
ptahdunbar:codex/issue-175909-gpt-live-voice-object
Closed

ptahdunbar wants to merge 10 commits into
openclaw:mainfrom
ptahdunbar:codex/issue-175909-gpt-live-voice-object

Conversation

@ptahdunbar

@ptahdunbar ptahdunbar commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Closes #175909

What Problem This Solves

OpenClaw cannot select an existing prompt-created GPT-Live voice. OpenAI requires saved voices as { "id": "voice_..." }, but Talk and Discord flatten speakerVoiceId into the same plain string voice field as named voices, so a saved ID reached the named-voice allowlist and silently fell back to marin.

User Impact

Operators can select a saved voice with gpt-live-1 through talk.realtime.speakerVoiceId, channels.discord.voice.realtime.speakerVoiceId, or speakerVoiceId in an OpenAI realtime provider block. Named voices keep their existing behavior and defaults. Saved voices on other models, and malformed IDs, fail session setup with a message that does not echo the configured value. Browser WebRTC reservations omit the ID.

Why This Change Was Made

The OpenAI provider owns its voice identifiers, so the translation stays inside the plugin and needs no core or SDK change:

  • readOpenAIQuicksilverVoiceSetting recognizes OpenAI's voice_ prefix (case-insensitively) in the shared string and keeps the ID's case. Config reads never throw, so Talk catalogs and readiness checks are unaffected by a typo.
  • normalizeOpenAIQuicksilverVoiceInput validates the ID when a bridge or browser session is created; assertOpenAIGptLiveCustomVoiceModel rejects saved voices for models other than gpt-live-1, including request-level overrides.
  • Whitespace-only named voices normalize to unset again (the earlier head threw for them).

Behavior notes compared with main: a blank speakerVoice now falls through to speakerVoiceId/voice instead of masking them, and speakerVoiceId in a provider block is read the same way Talk already reads it. Docs: docs/providers/openai/voice-and-speech.md.

Evidence

Local, Node 24.21.0, repo Vitest wrapper (pinned Bun test runtime), on c5cc8a53 (merged with main b1b3f500):

  • node scripts/run-vitest.mjs over the 7 touched OpenAI realtime test files: 105/105 passed.
  • New caller-path tests: Talk's request-level voice and the provider block reach the broker as { id }; Discord's override shape through the real resolveConfiguredRealtimeVoiceProviderAsync reaches session.start as audio.output.voice = { id }; GA and Codex models reject saved voices before session creation or socket open; malformed and mistyped-prefix IDs fail with the exact non-echoing message; blank speakerVoice stays unset.
  • Fail-first: with the previous head's source and the new tests, the Talk, Discord and blank-voice cases fail (fallback to marin, missing { id }, and a thrown custom-voice error respectively).
  • tsgo for extensions and extension tests: passed. oxlint on the 12 changed files: passed. oxfmt --check: passed.
  • node scripts/check-changed.mjs: all guards passed except two whole-tree checks that also fail on main: the max-lines suppression ratchet (three ui/ files identical to main) and the Knip dead-export scan (99 entries in 32 files identical to main). The one entry from this PR (OpenAIGptLiveVoice) is fixed.
  • realtime-quicksilver-peer-worker.test.ts: 3/3 local passes. The CI failure on 3a66dc68 (zero RTP packets in 10s) did not reproduce, the same test passed on ae85e78d, and this PR does not touch that media code.
  • The session-lifecycle test change from the previous head was dropped in favor of main's deterministic fix for the same race.

Not proven: no live provider call was made. An end-to-end OpenClaw audio session with a real saved voice remains unverified; the earlier direct-provider check bypassed OpenClaw's configuration flow.

Known limitation: core's Talk gateway-relay presentation echoes the configured speakerVoiceId string to the operator's client, as it already does for every provider's voice ID. Hiding it there needs a core change outside this plugin.

References and documentation

Support prompt-created voice references in GPT-Live sessions.
@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 18, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 18, 2026
@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR translates existing speakerVoiceId settings into saved OpenAI voice references for public GPT-Live sessions.

Example: Set talk.realtime.model to gpt-live-1 and talk.realtime.speakerVoiceId to voice_Demo123.

  • Before: The saved ID reaches the named-voice allowlist and falls back to marin.
  • After: The provider sends audio.output.voice as {"id":"voice_Demo123"} and omits the ID from the browser WebRTC reservation.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The revised patch resolves the previous defects and current-head CI passes, but required real behavior and upgrade evidence remain absent and product direction is unapproved.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete
User problem: Operators cannot select an existing prompt-created GPT-Live voice through OpenClaw.
Reason: The documented upstream capability fits the bundled OpenAI plugin, but its new selection semantics need an owner decision.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep this PR open: it supplies a distinct missing capability, fixes both previous findings, and passes current-head CI; no new actionable code defect was found.

Priority: P2
Reviewed head: c5cc8a53e64dc3a647b3d56e51348005663f5c3b
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should the OpenAI plugin support saved GPT-Live voices through speakerVoiceId, including rejecting saved references on incompatible models and letting blank speakerVoice values fall through to other configured voice fields?
  • Recommendation: Approve the scoped provider capability: Accept the documented saved-reference behavior through existing settings and the current plugin owner.
  • Why: This adds a provider capability and changes existing fallback and precedence behavior; neither this PR nor its linked issue records owner approval.

Before merge

  • Add real behavior proof - The OpenAI normalization, broker, and bridge paths are exercised with mocked HTTP and WebSocket clients, but no supplied artifact shows a real OpenClaw session configured with speakerVoiceId producing saved-voice audio. The inspected screenshots cover historical named-voice settings and unrelated Talk interaction. Provide redacted terminal output, logs, or a recording of the changed flow; redact API keys, IPs, phone numbers, and non-public endpoints. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

None.

Tests

  • Missing end-to-end proof: Supply an actual OpenClaw saved-voice audio session and fresh-install/latest-stable upgrade coverage; the reported fail-first run compares against the previous PR head rather than the pinned base.
Agent review details

How this fits together

Talk and channel callers supply voice settings to the OpenAI plugin, which selects the upstream session configuration and returns a browser reservation or server-owned audio bridge.

flowchart LR
  A[Talk or channel settings] --> B[Shared provider resolution]
  B --> C[OpenAI voice normalization]
  C --> D[Session voice validation]
  D --> E[WebRTC broker or WebSocket bridge]
  E --> F[OpenAI Live API]
  E --> G[Browser reservation]
Loading

Technical review

Best possible solution:

Support saved voices through the existing OpenAI provider owner while preserving named-voice defaults and validating references at session creation.

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

Current-main source deterministically replaces saved voice IDs with named defaults; no target code or live provider call was executed during this read-only review.

Is this the best way to solve the issue?

Provider-local translation uses the correct existing owner, and the revised implementation covers the string overrides supplied by Talk and Discord without adding core or SDK machinery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b5ac9a9b10c5.

Provenance checked

  • Public GPT-Live voice selection changes intended behavior with a stated reason (f093c0e: Separate public Live voices and the marin default from subscription voices and the cove default.)
  • Named-voice normalization keeps the original intent (ca171d5: Share string normalization while preserving request behavior and defaults; the revised patch restores whitespace-only strings to unset.)
  • Configured voice precedence changes intended behavior with a stated reason (b4fb602: Provider configuration previously selected speakerVoice or voice before normalizing; the PR explicitly records adding speakerVoiceId and allowing blank fields to fall through.)
  • Browser response projection keeps the original intent (7ff0e11: Keep server-owned provider routing facts out of public responses while preserving transport behavior.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Current main remains named-voice-only: Current main resolves GPT-Live voices through model-specific string allowlists and defaults; provider normalization does not read speakerVoiceId. (extensions/openai/realtime-quicksilver.ts:62, b5ac9a9b10c5)
  • Previous findings resolved: The revised reader preserves voice_Demo123 through string overrides and returns undefined for whitespace-only strings; session creation validates the effective selection. (extensions/openai/realtime-quicksilver.ts:79, c5cc8a53e64d)
  • Transport-boundary regression coverage: Added tests inspect the outgoing WebRTC session JSON and direct WebSocket session.start frame, including case preservation, browser reservation omission, and rejection before transport creation; transport clients remain mocked. (extensions/openai/realtime-live-api.test.ts:101, c5cc8a53e64d)
  • Contributor identifies the live-proof gap: The complete PR body explicitly states that no live provider call was made and that an OpenClaw audio session using a real saved voice remains unverified. (c5cc8a53e64d)
  • Prepared media concerns earlier behavior: All prepared images were inspected: two depict historical named-voice picker changes from fix: restore GPT-Live subscription calls and model-specific voices #133079, and two depict ordinary Talk interaction; none demonstrates saved-voice audio.
  • Current-head checks passed: Both check-run pages contain no failed or unfinished checks, and openclaw/ci-gate reports success for the reviewed head. (c5cc8a53e64d)

Likely related people:

  • Vincent Koc: Raw commit 7f54c3d adds extensions/openai/realtime-voice-session-policy.ts:81 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 7f54c3d9b04c; files: extensions/openai/realtime-voice-session-policy.ts)

PR surface

Source +90, Tests +173, Docs +8. Total +271 across 13 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 7 106 16 +90
Tests 5 174 1 +173
Docs 1 8 0 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 288 17 +271

Review metrics

Metric Value Why it matters
Production versus test changes Production +106/-16; tests +174/-1 Production growth carries saved-reference normalization and types through existing transports; tests cover distinct HTTP, WebSocket, caller-selection, and rejection boundaries.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #175909
Summary: This PR implements the open saved-voice request; the Codex named-voice expansion addresses a separate capability.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Saved-voice selection is a bounded additional capability while named voices remain available.
  • merge-risk: 🚨 compatibility: Existing voice_-prefixed selections now fail on incompatible models instead of falling back, and blank speakerVoice values can expose a previously masked voice or speakerVoiceId.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; 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.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Demonstrate saved-voice audio through an actual OpenClaw configuration flow.
  • Verify a fresh installation and an upgrade from v2026.10.5 preserve existing named and default voice settings.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-18T01:09:30.221Z sha 3a66dc6 :: needs real behavior proof before merge. :: [P2] Preserve saved-ID identity through the Talk and Discord callers | [P2] Keep whitespace-only named voices equivalent to an unset voice

Reviewed October 18, 2026, 8:29 PM ET / October 19, 2026, 00:29 UTC (Revision 2).

Talk and Discord flatten speakerVoiceId into the shared string voice
override before the OpenAI provider sees it, so saved GPT-Live voice IDs
reached the named-voice allowlist and silently fell back to marin.
Recognize OpenAI's `voice_` IDs inside that string, keep their case, and
translate them to the saved voice reference at the provider boundary.

Whitespace-only named voices normalize to unset again instead of failing
as malformed saved references. Saved voices on models other than
gpt-live-1, including request-level overrides, fail before session
creation.
…t-live-voice-object

# Conflicts:
#	extensions/openai/realtime-quicksilver-session-lifecycle.test.ts
#	extensions/openai/realtime-voice-provider-routing.test.ts
Config normalization feeds Talk catalogs and readiness checks, so a
mistyped speakerVoiceId must not reject those reads. Keep saved voice IDs
as references during config normalization and validate them when a
bridge or browser session is created. Detect the `voice_` prefix
case-insensitively so a mistyped prefix fails closed instead of being
lowercased into a different ID, and stop exporting the now-internal
OpenAIGptLiveVoice type.
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Oct 19, 2026
@ptahdunbar

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 19, 2026
…x/issue-175909-gpt-live-voice-object

# Conflicts:
#	extensions/openai/realtime-talk-defaults.test.ts
#	extensions/openai/realtime-voice-provider-factory.ts
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale after 7 days without qualifying human activity.
Without new human activity, Barnacle may close it as not planned 7 days after this message was posted. This is administrative inactivity cleanup, not a claim that the problem is fixed.
A human update restarts the inactivity clock; a new PR head also restarts it. A maintainer can add no-stale for a durable hold, or bad-barnacle to suppress Barnacle. Remove the hold when work can resume.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Oct 29, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #clawtributors on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

@openclaw-barnacle openclaw-barnacle Bot closed this Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: openai merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M stale Marked as stale due to inactivity 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.

Support prompt-created GPT-Live voice references

1 participant