Repository navigation
feat(gateway): add tts.speak method returning synthesized audio inline - #100770
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: adc091bc56
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex review: stale review; fresh review needed. Summary Next step Review history (2 earlier review cycles)
|
0941b12 to
841620b
Compare
b56575b to
0284cf8
Compare
0284cf8 to
56bd0b3
Compare
56bd0b3 to
afa0248
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 56bd0b3027
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
afa0248 to
6198748
Compare
6198748 to
8babb16
Compare
8babb16 to
906f51b
Compare
|
Land-ready review complete on What changed after review:
Proof on Blacksmith Testbox
Hosted CI run 28809285239 was fully green on exact patch head Remaining proof gap is client-only: physical-device playback/fallback recordings belong to stacked iOS #100771 and Android #100772, not this Gateway PR. |
|
Merged via squash.
|
openclaw#100770) * feat(gateway): add tts.speak method returning synthesized audio inline * test(gateway): type tts.speak synthesis mock for failure shapes * fix(gateway): restore lowercase normalizer import used by talk catalog * test(gateway): shift advertised-method window for tts.speak * fix(gateway): ready tts speak for landing * docs(changelog): record tts speak gateway API * test(agents): stabilize fast auto startup synchronization * test(crabbox): stabilize sparse checkout exit guard
What Problem This Solves
Mobile clients need a way to hear an individual assistant message rendered with the operator's configured TTS provider (tracking issue: #100708, "Listen" on iOS/Android). The existing surfaces don't cover this:
talk.speakis intentionally pinned to the Talk-mode provider with fallback disabled and fails withtalk_unconfiguredwhen onlymessages.ttsis configured.tts.convertrenders with the configured chain but returns a gateway-localaudioPaththat remote clients cannot read.Why This Change Was Made
Adds one additive request/response method,
tts.speak(operator.write, same scope as itstts.*/talk.speaksiblings): text in, whole-clip base64 audio out. It reuses the existingsynthesizeSpeechengine with the general provider chain and fallback — no second TTS path, and no new gateway events (the protocol-event-coverage guard is unaffected by request methods). Input is bounded by the existingmessages.tts.maxTextLength(default 4096), pre-checked in the handler so oversized text returnsINVALID_REQUESTinstead of a synthesis failure.The
inferMimeTypehelper thattalk.speakused moved tosrc/gateway/server-methods/speech-mime.tsso both handlers share one output-format → MIME mapping.Whole-clip delivery deliberately matches what the TTS pipeline ships today (
talk.speakproves it end-to-end on both mobile apps); a streamed variant would be a separate protocol addition.User Impact
No behavior change for existing methods. New gateway capability: authorized clients (operator.write scope) can render arbitrary text to audio with the configured TTS provider chain. Consumed by the stacked iOS/Android "Listen" PRs.
Evidence
pnpm test src/gateway/server-methods/tts.test.ts src/gateway/server-methods/talk.test.ts packages/gateway-protocol/src/channels.schema.test.ts packages/gateway-protocol/src/index.test.ts— green on Blacksmith Testbox (94 passed at first run; the tts file re-ran green with 10/10 after an expected-message fix).pnpm check:changedon Testbox: all lanes green exceptlint core, whose four findings are in files untouched by this PR (src/channels/plugins/bundled.shape-guard.test.ts,src/cli/gateway-cli/run-loop.ts,src/infra/gateway-boot-lifecycle.ts) and are already fixed on latestorigin/main; branch was rebased onto that main afterwards.pnpm protocol:gen && pnpm protocol:gen:swift— generatedGatewayModels.swiftcommitted (TtsSpeakParams/TtsSpeakResult), regen after rebase produced no drift.