Skip to content

Voce Codegen - #104

Merged
berges99 merged 1 commit into
mainfrom
feat/voice-codegen
Jul 29, 2026
Merged

Voce Codegen#104
berges99 merged 1 commit into
mainfrom
feat/voice-codegen

Conversation

@berges99

Copy link
Copy Markdown
Collaborator

No description provided.

… override allowlist

voice_config was an untyped dict threaded through three merge layers: a
typo'd key silently fell back to defaults, and merge_client_voice_overrides
applied any client key over server config — recording stayed server-only
only because build_voice_session happened to read it from defaults.

- Add timbal.voice.config with VoiceConfig + RecordingConfig (extra="forbid").
  merge_voice_config validates at server boot, so bad keys/values fail fast;
  dicts, callables, and VoiceConfig instances are all accepted.
- Filter client hello keys through an explicit CLIENT_SETTABLE_VOICE_FIELDS
  allowlist. recording is structurally excluded; model stays client-settable
  for the playground picker. Client values skip re-validation on purpose —
  the per-key guards in build_voice_session degrade instead of 500-ing.
- Consume attributes instead of merged.get() in build_voice_session,
  warmup_voice_stack, and both transports; rding env+user merge now
  validates through RecordingConfig inside the existing non-fatal try.

Also includes the previous (uncommitted) round: voice_config added to
codegen AGENT_FIELDS, and TIMBAL_VOICE_LANGUAGE unset now means provider
auto-detect instead of defaulting to "es".
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches live voice/WebRTC session wiring and changes default language and config merge semantics; mitigated by broad tests but deployments relying on implicit "es" or silent dict typos may see different behavior.

Overview
Introduces VoiceConfig and RecordingConfig (Pydantic, extra="forbid") and threads them through the voice server, WebRTC, and app.state.voice_config instead of loose dicts.

Server behavior changes: runnable.voice_config (dict, callable, or VoiceConfig) is merged and validated at boot — typos or bad nested recording values raise instead of being ignored. Client hello overrides are allowlist-filtered (CLIENT_SETTABLE_VOICE_FIELDS); keys like recording are dropped with a log line. Default language is now None (provider auto-detect) rather than hard-coded "es".

Codegen: set-config can set voice_config on agents (nested dict for STT/TTS/turn detector, etc.), with a new test.

Docs in server/README.md describe strict server config vs allowlisted client overrides.

Reviewed by Cursor Bugbot for commit d771397. Bugbot is set up for automated code reviews on this repo. Configure here.

@berges99
berges99 merged commit 6f00fb5 into main Jul 29, 2026
10 checks passed
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.

2 participants