Skip to content

feat: use connected Gateway voice in Companion - #1889

Closed
roboclaw-bot wants to merge 4 commits into
mainfrom
openclaw/crisp-crayfish
Closed

roboclaw-bot wants to merge 4 commits into
mainfrom
openclaw/crisp-crayfish

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Related: #1702

What Problem This Solves

Companion cannot read chat with speech providers configured only on its Gateway, including Fish Audio.

User Impact

User impact: opt-in Gateway voice; remote keys, unchanged local defaults. Native Shared, mic, retirement and accessibility gaps remain.

Why This Change Was Made

Privacy fix published. CI exposed optional-App casts; 3-line fix + UI test retained, review blocked by server byte limit. Laptop untouched.

Evidence

Historical Windows c27046c: build 5/5; Tray 4585 passed. Human heard Fish preview/manual/two auto replies; no recording.

Before
Before: local voice

After
After: Fish preview completed

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Required proof pools

  • windows-winui-interactive: partial. Fish/UI evidence recorded; microphone, precise audible retirement and expanded-panel accessibility remain incomplete.

Validation

Published: 32 Shared + 174 Tray passed; privacy red/green; P0-P3 clean. Local UI fix: same 206 passed, review blocked.

dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --filter FullyQualifiedName~GatewaySpeechTests -p:DisableGitVersionTask=true
dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --filter 'FullyQualifiedName~GatewaySpeechPlaybackTests|FullyQualifiedName~LocalizationValidationTests|FullyQualifiedName~ChatComposerSessionTests|FullyQualifiedName~ExistingSpeechProfile_GatewayVoiceIsOptInAndPreservesLocalProvider|FullyQualifiedName~ChatComposerViewModelTests|FullyQualifiedName~ChatPlacementControllerTests|FullyQualifiedName~SandboxStatusStoreTests|FullyQualifiedName~ChatTimelinePresentationTests' -p:DisableGitVersionTask=true

Projected-history GitVersion disabled; whitespace clean. Windows CI: UI failed (TestApp cast); Core/Tray passed.

Historical Windows: build 5/5; Tray 4585 passed. Final Shared 0 executed, App Control 0x800711C7; earlier 4676 passed/1 baseline failure/27 skipped. Accessibility 22 passed/1 Sandbox failure; live panel unscanned.

Prior Linux full: Shared timeout; Tray 155 failed.

Real Behavior Proof

  • Environment tested: Windows 11/SDK 10.0.402; Mac Gateway 2026.10.10-beta.3.
  • PR head or commit tested: Windows: c27046c (manual binary association). Published: 3b73575; UI CI failed.
  • Exact steps or command run: above; synthetic chat/MCP.
  • Evidence after fix: ZIPs unchanged; 11 protected files identical; one logging-only exception.
  • Observed result: Fish heard for preview/manual/automatic speech; inward MCP remained Windows with delegation on.
  • Screenshot or artifact links verified? Yes: PR images/public hashes.
  • Not verified or blocked: native Shared; pre-existing microphone muting/recognition/recovery; audible retirement/selection/close; live-panel accessibility. Not merge-ready.

Security Impact

  • New permissions or capabilities? Yes: existing operator read/write; no scopes/grants.
  • Secrets or tokens handling changed? Provider keys stay remote.
  • New or changed network calls? Yes: Gateway tts.status/tts.speak with opted-in text.
  • Command or tool execution surface changed? No.
  • Data access scope changed? Yes: opt-in chat synthesis.
  • If any answer is Yes, explain the risk and mitigation: opt-in, authority/epoch checks, bounded payloads/timeouts, safe errors, no replay/fallback.

Compatibility and Migration

  • Backward compatible? Yes locally; unsupported Gateway RPCs fail visibly.
  • Config or environment changes? Yes: local UseGatewayVoice=false by default; Gateway preferences unchanged.
  • Migration needed? No.
  • If yes, list the exact upgrade steps: none. Optionally enable Gateway voice after remote setup/approval.

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

Work sessions

Worked on by

Worked on by:
- @PollyBot13

Co-authored-by: PollyBot13 <[email protected]>
OpenClaw-Publication: 288d9bf0-466e-4799-91a9-db561a2d20f5
@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codex review: blocked before merge.

What this changes

Adds an opt-in setting that uses the connected Gateway’s speech provider for chat playback and voice previews.

Example: A Gateway has Fish Audio configured, and the user selects Read Aloud for “Hello from Companion.”

  • Before: Companion uses its locally configured speech provider.
  • After: With Gateway voice enabled, Companion requests inline audio from the Gateway and plays it through Windows.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Useful feature direction and meaningful boundary tests, but the Windows build is broken and real behavior and stable-release upgrade evidence remain incomplete.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Feature · Worth it: Yes · Fix scope: Partial
User problem: Companion cannot read chat using speech providers configured only on its connected Gateway.
Reason: The supplied maintainer-authored direction selects a useful generic integration; Related wording correctly avoids claiming the full dedicated-provider request is closed.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep this PR open: Gateway delegation addresses a concrete capability gap, but the new preview handler prevents the Windows app from compiling.

Priority: P2
Reviewed head: 1f7d651586a39e376d241f0c78e4ae71619ff8f9

Before merge

  • [P1] Reference AsyncEventHandlerGuard from OpenClaw.Shared (P1) - The new handler resolves Helpers.AsyncEventHandlerGuard as OpenClawTray.Helpers.AsyncEventHandlerGuard, but the helper is declared in OpenClaw.Shared. Consequently the Windows app cannot compile, blocking release publishing, both MSIX builds, and app-dependent test lanes. Exact-head CI reports this error at this line. Use AsyncEventHandlerGuard through the existing OpenClaw.Shared import, or fully qualify that namespace.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P1] [P1] Reference AsyncEventHandlerGuard from OpenClaw.Shared — src/OpenClaw.Tray.WinUI/Pages/VoiceSettingsPage.GatewaySpeech.cs:127

Tests

  • Missing end-to-end proof: Supply current-head Windows UI and audible Fish playback evidence covering preview, Read Aloud, automatic replies, retirement, and microphone recovery; an upgrade from the latest stable release is also unverified.
Agent review details

How this fits together

Companion routes chat text through its existing authenticated operator client to Gateway speech RPCs, validates returned audio, and passes it to the existing native player.

flowchart LR
  A[Chat or voice preview] --> B[Chat coordinator]
  B --> C[Speech lifetime owner]
  C --> D[Authenticated Gateway client]
  D --> E[Gateway speech provider]
  E --> F[Validated inline audio]
  F --> G[Windows audio player]
Loading

Technical review

Best possible solution:

Keep the delegated route and existing playback owner, correct the preview handler’s namespace, and establish native playback and upgrade compatibility before landing.

Do we have a high-confidence way to reproduce the issue?

Main routes chat speech to local providers; the new preview handler’s namespace error is independently confirmed by exact-head Windows CI annotations.

Is this the best way to solve the issue?

Gateway delegation avoids duplicating provider clients and credentials, and the added lifetime owner protects distinct cancellation and target boundaries while reusing existing transport and playback owners.

Full review comments:

  • [P1] [P1] Reference AsyncEventHandlerGuard from OpenClaw.Shared — src/OpenClaw.Tray.WinUI/Pages/VoiceSettingsPage.GatewaySpeech.cs:127
    The new handler resolves Helpers.AsyncEventHandlerGuard as OpenClawTray.Helpers.AsyncEventHandlerGuard, but the helper is declared in OpenClaw.Shared. Consequently the Windows app cannot compile, blocking release publishing, both MSIX builds, and app-dependent test lanes. Exact-head CI reports this error at this line. Use AsyncEventHandlerGuard through the existing OpenClaw.Shared import, or fully qualify that namespace.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ed1444b0de69.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • ./build.ps1
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore --filter FullyQualifiedName~GatewaySpeechTests
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore --filter FullyQualifiedName~GatewaySpeechPlaybackTests

What I checked:

  • Pinned PR introduction: Reviewed the introduced diff from the pinned main parent to the original PR head; the checkout was clean before and after inspection. (1f7d651586a3)
  • Confirmed Windows compilation failure: Exact-head release publish, both MSIX builds, Tray tests, UI tests, and setup/connect CI annotations identify the nonexistent OpenClawTray.Helpers.AsyncEventHandlerGuard reference; the actual helper belongs to OpenClaw.Shared. (src/OpenClaw.Tray.WinUI/Pages/VoiceSettingsPage.GatewaySpeech.cs:127, 1f7d651586a3)
  • Concrete feature context: The reporter’s [Feature Request] Add Fish Audio TTS provider to Windows Hub voice settings #1702 describes working Gateway-side Fish synthesis and explicitly proposes Gateway delegation as an alternative to another Windows provider client; this PR implements that alternative.
  • Authoritative external speech contract: The patch invokes this repository’s Gateway protocol, establishing the dependency boundary: tts.status reports provider readiness and tts.speak returns inline base64 audio, provider, format, MIME type, and extension. (src/gateway/server-methods/tts.ts, 45fc29dcf159)
  • Proof accurately declared pending: The complete REST PR body and discussion supply synthetic protocol/lifetime checks and explicitly leave Windows build, full suites, native UI, Fish synthesis, audible playback, and microphone release pending; no changed-behavior media or runtime artifact was supplied. (docs/GATEWAY_VOICE.md:87, 1f7d651586a3)
  • Existing ownership and compatibility preserved in source: The new route uses the existing response registry and serialized player; UseGatewayVoice defaults to false, and the local provider setting and inward node/MCP capability remain separate. (src/OpenClaw.Shared/SettingsData.cs:115, 1f7d651586a3)

Likely related people:

  • Régis Brid: Raw commit e0c4098 adds src/OpenClaw.Tray.WinUI/Services/TextToSpeech/TextToSpeechService.cs:43 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e0c40985a718; files: src/OpenClaw.Tray.WinUI/Services/TextToSpeech/TextToSpeechService.cs)
  • Barbara Kudiess: Raw commit ff5cafb adds src/OpenClaw.Tray.WinUI/Services/TextToSpeech/TextToSpeechService.cs:63 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ff5cafb52f52; files: src/OpenClaw.Tray.WinUI/Services/TextToSpeech/TextToSpeechService.cs)
  • Pedro Larroy: Raw commit 2a33672 adds src/OpenClaw.Tray.WinUI/Services/TextToSpeech/TextToSpeechService.cs:321 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2a33672baedb; files: src/OpenClaw.Tray.WinUI/Services/TextToSpeech/TextToSpeechService.cs)

Labels

Label changes:

  • add P2: This is an optional speech-provider enhancement with a concrete use case; its compilation failure blocks this PR but is not a shipped regression.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This is an optional speech-provider enhancement with a concrete use case; its compilation failure blocks this PR but is not a shipped regression.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 27, 2026, 2:28 PM ET / 18:28 UTC.

Worked on by:
- @PollyBot13

Co-authored-by: PollyBot13 <[email protected]>
OpenClaw-Publication: ae0b90e9-c2ac-413c-8f9c-814a70d689e1
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 28, 2026 09:23
roboclaw-bot and others added 2 commits October 28, 2026 10:07
Co-authored-by: PollyBot13 <[email protected]>
Worked on by:
- @PollyBot13

Co-authored-by: PollyBot13 <[email protected]>
OpenClaw-Publication: e79fb25b-a416-4826-81a1-05867362a6c2
@PollyBot13

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@roboclaw-bot

Copy link
Copy Markdown
Contributor Author

Closing as superseded: #1915 replaced this PR, and #1968 now supersedes #1915. Requested by @vyctorbrzezowski. Branch left in place.

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

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants