Repository navigation
refactor(tts): reuse selected speech descriptors during preparation - #188280
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR passes the selected speech provider descriptor into configuration preparation and removes a redundant private ID-based forwarding function. Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review Keep this PR open: it is a useful maintainer-authored simplification with no actionable correctness or security findings, and the exact-head CI gate passes. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherBuffered, streaming, and telephony speech requests share provider-attempt preparation, which combines provider descriptors, configuration, voice models, and persona settings before synthesis. flowchart TD
A[Speech request] --> B[Owned provider registry]
B --> C[Selected provider descriptor]
C --> D[Configuration preparation]
D --> E[Readiness and synthesis]
E --> F[Audio and attempt metadata]
Technical reviewBest possible solution: Retain the existing configuration owner, pass it the selected descriptor, and preserve public ID-based lookup and request-owned resource lifetimes. Do we have a high-confidence way to reproduce the issue? This PR reports redundant internal work rather than a user-facing failure; source inspection confirms the repeated provider lookup on the base. Is this the best way to solve the issue? The patch is the smallest coherent reduction: the existing resolver already accepts a descriptor, the sole internal caller supplies it, and no new state or competing owner is introduced. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5eda46670486. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -13. Total -13 across 2 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 30, 2026, 7:35 AM ET / 11:35 UTC. |
|
Merged via squash.
|
目的: プラグインがプロバイダーに合わせた発話ガイダンスを組めるよう、 現在有効な一次 TTS プロバイダー・モデル・ペルソナを合成せずに取得する。 変更: api.runtime.tts.prepareSpeechPromptContext を追加する。通常の TTS と同じ ユーザー設定、agent / channel / account 層、ペルソナ binding、 モデル解決を使い、auto オフ・テキスト上書き不許可・一次 binding 不可は ready: false を返す。合成、fallback、credential、音声ファイル、 テキスト書き換えは行わず、プロバイダー設定や秘密情報も返さない。 runtime facade は選択中 registry とプラグインの寿命に束縛する。 検証: tts-prompt-context と registry.runtime-config のテストが通過。 rebase 時のコンフリクト解決 (onto 57fd13e, 元コミット 89d6eb7578c): - 上流 329a56d (openclaw#178002) が resolveReadySpeechProvider を単一呼び出しとして フォールバックループ内のクロージャへ畳み込んだ。本コミットで tts-prompt-context.ts が2つ目の呼び出し元になるため、export した関数として 1か所に戻し、ループ側のクロージャはその呼び出しに置き換えた。 畳み込みで外れていた VoiceModelRef の import も戻した - 上流 b3d00c9 (openclaw#183424) が types-core.ts の TTS 型エイリアスを TtsRuntimeApi[...] の直接参照へ畳んだ。エイリアスは復活させず、 prepareSpeechPromptContext も同じ直接参照の形で追加 rebase 時のコンフリクト解決 (onto 258d034, 元コミット 892cff4dd4d): - 上流 00ebec0 (openclaw#188280) が getResolvedSpeechProviderConfigForVoiceModel の 引数を providerId から provider (SpeechProviderPlugin) へ変えた。export 済みの resolveReadySpeechProvider をその形へ合わせ、ループ側は本コミットの呼び出しを採用 - 上流 e1f1a79 (openclaw#188398) が prepareTtsRequest を runtime-api.ts から外し、 loadTtsRequestRuntime の読み込み先を tts-request.js へ変えて、knip の 動的 consumer 追跡に lazy TTS メソッドを登録した。そのままでは prepareSpeechPromptContext が tts-request.js に無く実行時に解決できないため、 同じ方式で tts-prompt-context.js 専用の lazy loader / binder を足し、 型も typeof import(tts-prompt-context.js) の直接参照にし、 knip-dynamic-consumers.mjs に consumer を登録した。runtime-api.ts からの 再 export は上流の方針どおり置かず、test-support は直接 import する
Related: #188252
What Problem This Solves
Speech voice/model resolution re-looks up the provider descriptor already selected by its caller.
User Impact
No intended user-visible behavior or shipped public-contract change.
Why This Change Was Made
Pass that selected descriptor through the private resolution path and remove the extra wrapper. Keep public getResolvedSpeechProviderConfig, canonical aliases, config selection, auth and resource behavior unchanged.
13 net production lines removed; tests and docs unchanged.
Evidence