Skip to content

feat(core): list voice models as realtime models in the model list - #65647

Open
Tarquinen wants to merge 4 commits into
devfrom
voice-model-list
Open

Tarquinen wants to merge 4 commits into
devfrom
voice-model-list

Conversation

@Tarquinen

@Tarquinen Tarquinen commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Issue for this PR

None. Follows up #65491 and the Slack discussion about having two model list APIs.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Voice uses the standard model APIs now. GET /api/model?types=realtime lists voice models like any other model, with a realtime field for their protocol and transports. The new POST /api/experimental/voice/connect takes a Model.Ref and starts that exact model with its provider's credentials. The desktop app uses both.

/voice/models and /voice/session are kept as deprecated adapters, with their shipped shapes, because released iOS and Android apps call them. All the old-client logic lives in core/src/voice-legacy.ts, so it can be deleted with them.

How did you verify your code works?

Updated the voice, models.dev, provider plugin, subagent, server and app transport tests. Typecheck, bun run check, lint-changed and the generated-file checks pass.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Added by the opencode bot (AI-generated).

Public API: adds the realtime model type to the model list; removes the unreleased name/engine fields from experimental voice models (backwards compatible for released clients)

Added by the opencode bot (AI-generated).

Public API: adds the optional realtime field and realtime type to model info and an optional provider to voice session; voice endpoints now take the location query (backwards compatible)

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran this and it works as described. With a placeholder OpenAI key, GET /api/model?types=realtime lists the GPT-Live (openai-live) and gpt-realtime-* (openai-realtime) models newest first. /api/experimental/voice/models wraps that list in its shorter shape, with default: "gpt-live-1.1". The core, server and app tests for this change pass, and core and app type-check cleanly. A ChatGPT sign-in still hides OpenAI's GPT-Live, so voice falls back to OpenCode's hosted GPT-Live as before.

Public API impact

  • Model.Type and ModelListInput.types add "realtime", and GET /api/model?types=realtime now returns voice models. This is backwards compatible.
  • VoiceModel in GET /api/experimental/voice/models drops name and engine. Both were added in #65491 and never released. Models from providers that aren't connected are no longer listed with available: false.
  • The desktop app now reads model.list with types: ["realtime"]. Against an older remote server it gets no realtime models and reports voice as unavailable. That's worth knowing if mixed versions matter.

No blocking concerns.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new commits work as described. I ran the server with an env OpenAI key and, separately, with a key set only in opencode.json. In both setups the realtime models are listed with their new realtime field, and sessions use the provider's credential: the configured key and the bare-model-ID path for old clients both reached OpenAI. The core, server and app tests for this change pass, and core, app and server type-check cleanly. The version-mismatch note from my last review is handled: /voice/models keeps its shipped shape and /voice/session still accepts a bare model ID.

Public API impact (all backwards compatible)

  • Model info: adds an optional realtime: {protocol, transports} field (Model.Realtime) and the realtime model type.
  • POST /api/experimental/voice/session: adds an optional provider to the request body.
  • Both voice endpoints now accept the location query and use the request's location instead of the global config directory.
  • VoiceModel drops the unreleased name and engine fields.

One new point, inline: asking for an unknown voice model now returns the API-key error.

Comment thread packages/core/src/voice.ts Outdated
? all.find((item) => item.providerID === input.provider && item.id === input.model)
: pick(all, input.model)
const engine = model && engineOf(model)
if (!model || !engine) return yield* new UnavailableError({ service: input.provider, message: missingKeyMessage })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the requested model isn't in the list, this now returns a 503 (UnavailableError) saying the server needs an API key, and service is null when provider is omitted. Before, it was a 400 "Unsupported voice model … This server lists …". I hit this with a misspelled model ID while the env key was set: the error points at a missing key that isn't actually missing. Could an ID that no connected provider lists go back to InvalidRequestError, perhaps naming the models that are listed? The key message could then stay for when no credential resolves.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant