Skip to content

fix: keep Companion playback out of microphone capture - #1936

Closed
roboclaw-bot wants to merge 3 commits into
mainfrom
openclaw/quick-shrimp
Closed

roboclaw-bot wants to merge 3 commits into
mainfrom
openclaw/quick-shrimp

Conversation

@roboclaw-bot

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

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: one-shot/standalone capture can transcribe Companion playback.

User Impact

User impact: mute intent covers active/future captures, including later STT enablement. Draft: current-head acoustic/App proof and fork-policy resolution remain open.

Publication succeeded on an upstream branch. The repository fork rule remains unresolved, not a GitHub permission failure. The managed publisher has no fork selector.

Why This Change Was Made

App-scoped leases retain separate capture ownership. Stop retires only its speech generation. Upstream interfaces/progress routing remain intact.

Evidence

Current-tree Windows CI is green: Core/CLI, Tray/setup/integration, UI/accessibility, release smoke and packaging. Earlier consented hardware recognition/suppression/recovery is supporting evidence, not current-head acoustic proof.

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 earlier hardware proof; current integration/App transitions unverified.

Validation

Head dcb69d9 and tested merge4516cb2 have identical complete trees.

Windows CI run41076873987: CI Gate, Core/CLI, Tray/setup/integration, UI/accessibility, WSL E2E, release smoke and MSIX passed. Skipped jobs are not passes.

Current workflow commands:

  • ./scripts/Invoke-CiTest.ps1 -Project tests/OpenClaw.Shared.Tests -ResultsDirectory TestResults\Shared -TrxFileName OpenClaw.Shared.Tests.trx -HangTimeoutSeconds 300
  • ./scripts/Invoke-CiTest.ps1 -Project tests/OpenClaw.Tray.Tests -ResultsDirectory TestResults\Tray -TrxFileName OpenClaw.Tray.Tests.trx -Runtime win-x64
  • Tray UI: 605 passed/7 skipped; accessibility: 23 passed. Shared/Tray jobs passed; totals are outside the bounded log excerpts.

Earlier local Windows base5daead3 plus patch/test correction: ./build.ps1 passed5/5; Tray4737/native33/focused13 passed; Shared4790 passed/1 privilege failure/27 skipped. That failure remains historical. Cancellation-order correction preserves assertions; injected global Stop fails its negative control.

Canonical P0-P3 and exact-head ClawSweeper source reviews have no actionable findings. Current-head acoustic/App proof remains missing. Local ./build.ps1 was not rerun in this Linux sandbox.

Real Behavior Proof

  • Environment tested: current Windows CI; earlier local Whisper tiny/Windows TTS acoustic proof.
  • PR head or commit tested: CI merge4516cb2 matches head dcb69d9 tree; acoustic proof is earlier-candidate only.
  • Exact steps or command run: current workflow tests above; earlier MCP STT and acoustic driver.
  • Evidence after fix: speech control; suppression both start orders; completion/Stop release; recognition after Stop.
  • Observed result: bounded capture processing, not OS privacy mute; audible playback human-confirmed.
  • Screenshot or artifact links verified? Current CI linked; earlier private evidence audited. No current microphone media claimed.
  • Not verified or blocked: current-head acoustic/App proof, full hardware matrix, live Gateway, fork-policy resolution. Earlier Shared failure remains historical.

Security Impact

  • New permissions or capabilities? No.
  • Secrets or tokens handling changed? No.
  • New or changed network calls? No.
  • Command or tool execution surface changed? No.
  • Data access scope changed? No.
  • If any answer is Yes, explain the risk and mitigation: N/A. Existing gating/consent retained.

Compatibility and Migration

  • Backward compatible? Existing constructor/progress routing retained; current Windows CI passed.
  • Config or environment changes? No persisted or wire-contract change. Voice model storage follows the supplied settings directory.
  • Migration needed? No.
  • If yes, list the exact upgrade steps: N/A.

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.

Worked on by

Work sessions

roboclaw-bot and others added 3 commits October 30, 2026 14:54
Co-authored-by: PollyBot13 <[email protected]>
Worked on by:
- @PollyBot13

Co-authored-by: PollyBot13 <[email protected]>
OpenClaw-Publication: 8f40a17d-1fc8-46cf-b0d1-6f88c50ad0f4
@clawsweeper

clawsweeper Bot commented Oct 30, 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:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro 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: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

This PR shares playback mute intent across independently owned voice captures and cancels retiring chat speech without interrupting newer requests.

Example: Read aloud “The meeting starts at 10:30” while a standalone chat recording is active.

  • Before: The recording can transcribe Companion’s own speech because playback muting reaches only the node service’s long-lived pipeline.
  • After: The recording drops microphone samples during playback and resumes after playback and its drain interval.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation is coherent and supported by meaningful owner-level coverage, but historical observations do not satisfy the repository’s current-head behavior-proof requirement.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Companion can transcribe its own spoken chat response instead of the user’s speech.
Reason: The change extends existing echo-suppression intent to the capture paths that currently escape it, without adding configuration or changing the chosen speech provider.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR addresses a source-confirmed capture gap that remains on main; no definite introduced production defect was found.

Priority: P2
Reviewed head: dcb69d955d4e8b433107502f55d8b65e2d61c6d9

Before merge

None.

Findings

None.

Tests

  • Low-value test tests/OpenClaw.Tray.Tests/PlaybackMuteStateTests.cs: Remove SeparateVoiceServices_KeepTheirOwnOverlappingLeases: it constructs two unrelated state objects without services or captures and adds no distinct boundary beyond the existing lease and shared-service tests.
  • Missing end-to-end proof: Current-head shipped chat/App suppression and recovery are unproved, and the supplied negative-control claim does not establish base-fail/head-pass for the central capture defect.
Agent review details

How this fits together

The chat coordinator sends text to the existing TTS service; App supplies shared mute state to standalone and node VoiceService instances, whose AudioPipeline registrations suppress microphone processing.

flowchart LR
  App --> MuteState
  App --> VoiceServices
  ChatCoordinator --> TTSPlayback
  ChatCoordinator --> MuteState
  MuteState --> AudioPipelines
  VoiceServices --> AudioPipelines
  Microphone --> AudioPipelines
Loading

Technical review

Best possible solution:

Use one App-scoped playback mute domain with leases and per-pipeline registrations while retaining independent capture ownership.

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

Main’s node-only resolver and _pipeline-only mute setter leave standalone and invocation-local capture unsuppressed; no runtime reproduction was executed during this read-only review.

Is this the best way to solve the issue?

The fix places retained mute intent at the shared App lifetime and registers each existing capture owner, preserving provider selection, consent, per-invocation progress, and independent teardown.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • VoiceService mute intent and AudioPipeline suppression keeps the original intent (b0ba9af: Local Whisper capture and TTS integration introduced input suppression to prevent playback echo.)
  • Native-chat playback ownership and drain interval keeps the original intent (08cab69: Native chat centralized configured playback and capture suppression in its coordinator.)
  • Manual read-aloud, speaker mute, and Stop changes intended behavior with a stated reason (cd4acf0: Chat controls intentionally allow manual read-aloud independently of automatic-response mute; later speaker controls added an explicit Stop action.)
  • Configured-provider routing keeps the original intent (ff5cafb: Omitted-provider requests preserve configured-provider fallback while explicit provider requests remain strict.)
  • Per-invocation capture and progress keeps the original intent (4e31031: Invocation-owned pipelines prevent cancelled capture progress from updating replacement recordings.)
  • Capture startup and lifecycle keeps the original intent (20d29e1: Generation-scoped capture startup deadlines and serialized teardown prevent silent microphone hangs and stale callbacks.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Current-main defect: Main’s IsMutedForPlayback setter updates only _pipeline, while ListenOnceAsync and TranscribeFixedDurationAsync create invocation-local pipelines; the chat coordinator additionally resolves only the node VoiceService. (src/OpenClaw.Tray.WinUI/Services/VoiceService.cs:92, ef1df54dfe95)
  • Introduced fix and ownership: The pinned introduced diff adds retained mute intent, overlapping leases, per-capture registrations, App composition, and ordered disposal without sharing or replacing capture pipelines. (src/OpenClaw.Tray.WinUI/Services/PlaybackMuteState.cs:29, dcb69d955d4e)
  • Cancellation reaches the production player: Chat now passes its retiring generation token into TextToSpeechService, whose synthesis and playback paths consume cancellation and dispose the active player before completing. (src/OpenClaw.Tray.WinUI/Services/TextToSpeech/TextToSpeechService.cs:495, dcb69d955d4e)
  • Supplied proof limitation: The PR body explicitly identifies Windows hardware recognition, suppression, and recovery observations as historical, excludes current App integration, and provides no public current-head runtime artifact; discussion contains only review-status comments. (dcb69d955d4e)
  • Original speech contract: The original audio contribution established local Whisper capture and playback echo suppression; later chat work intentionally retained standalone voice access, manual read-aloud, speaker mute, and configured-provider routing. (src/OpenClaw.Tray.WinUI/Services/VoiceService.cs:90, b0ba9affa25d)
  • Related work explicitly excludes this repair: feat: use connected Gateway voice in Companion #1915 (feat: use connected Gateway voice in Companion) explicitly leaves microphone playback muting to a separate PR, so it does not supersede this contribution.

Likely related people:

  • Scott Hanselman: Raw commit 20d29e1 adds src/OpenClaw.Tray.WinUI/Services/AudioPipeline.cs:374 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 20d29e1132c3; files: src/OpenClaw.Tray.WinUI/Services/AudioPipeline.cs)

Review metrics

Metric Value Why it matters
Production and regression coverage Production +210/-43 lines; tests and project wiring +610/-0; documentation +1/-0 Most growth exercises distinct capture modes, cleanup, overlapping playback, cancellation, and service transitions; the shared owner is justified by App-wide mute lifetime.

Labels

Label changes:

  • add P2: Playback can contaminate speech recognition in a limited voice workflow, without evidence of a broader runtime outage or blocked first-use flow.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Playback can contaminate speech recognition in a limited voice workflow, without evidence of a broader runtime outage or blocked first-use flow.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Supply current-head shipped-path evidence for playback suppression, cancellation, service activation, and recognition recovery.

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 30, 2026, 11:19 AM ET / 15:19 UTC.

@roboclaw-bot

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #1949, the fork-origin replacement that keeps these original commits and attribution and adds the review fixes and refreshed Windows evidence. 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: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant