Repository navigation
refactor(speech-core): share TTS request pre-resolution across discord and voice-call - #109640
Conversation
d0a1bf5 to
17e7930
Compare
|
Codex review: needs real behavior proof before merge. Reviewed July 17, 2026, 12:37 AM ET / 04:37 UTC. Summary PR surface: Source -151, Tests +89. Total -62 across 13 files. Reproducibility: not applicable. This PR is presented as a behavior-neutral refactor rather than a fix for a reproducible current-main bug. Its deliberate drift resolutions still require real consumer-path validation. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Confirm Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is presented as a behavior-neutral refactor rather than a fix for a reproducible current-main bug. Its deliberate drift resolutions still require real consumer-path validation. Is this the best way to solve the issue? Unclear. Centralizing duplicated preparation logic is directionally maintainable, but explicit maintainer confirmation is needed to establish whether the plugin runtime facade is the intended permanent owner boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 863297cce515. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source -151, Tests +89. Total -62 across 13 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
|
Merged via squash.
|
What Problem This Solves
Discord voice and the voice-call plugin each re-implemented TTS request pre-resolution before calling the shared speech-core synthesis entry points: Discord carried a local
mergeTtsConfig/resolveVoiceTtsConfigpair plus inline directive parsing, and voice-call rebuilt override merging, provider collection, and directive policy intelephony-tts.ts. The two copies had drifted (shallow vs deep provider merge; parse-time provider attribution disagreeing with what synthesis actually selects).Why This Change Was Made
Phase 4 of the voice-stack consolidation (follows #109413, #109466, #109497). speech-core gains one
prepareTtsRequest({ cfg, override?, text })that deep-merges the surface override intomessages.tts, resolves the effective config, and parses inline directives once with the provider attribution synthesis will actually use. It is exposed only through the existingapi.runtime.ttsfacade — no new named plugin-SDK export; surface counts are unchanged.Both consumers migrated; their local merge/resolution/directive code is deleted. Stream-vs-file selection (Discord) and telephony/μ-law specifics (voice-call) stay consumer-side.
Two deliberate drift resolutions, both toward the canonical semantics synthesis already applies internally:
preferredProviderIdnow comes fromgetTtsProvider(preference/persona-aware) at both sites, so parse-time attribution can no longer disagree with synthesis-time provider selection (previously possible in voice-call).User Impact
None intended: same effective config and directive handling for the same inputs; the drift fixes align edge-case directive attribution with actual synthesis behavior.
Evidence
packages/speech-core,extensions/voice-call,extensions/discord/src/voice; focused local run 197 tests; suites rerun green after rebase onto current main.pnpm plugin-sdk:surface:check: counts unchanged;node scripts/check-deadcode-exports.mjs: zero findings; typecheck lanes green; targeted lint green.