Skip to content

feat(macos): honor the selected microphone in Talk and show live voice activity in chat#109995

Merged
steipete merged 2 commits into
mainfrom
claude/macos-chat-talk-audio-parity
Jul 17, 2026
Merged

feat(macos): honor the selected microphone in Talk and show live voice activity in chat#109995
steipete merged 2 commits into
mainfrom
claude/macos-chat-talk-audio-parity

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Talk Mode on macOS records from the system-default microphone regardless of the input device the user selected in Voice settings, offers no echo cancellation or gain control, and the chat surface gives no feedback while talking — no level meter, no visible listening state, and no transcript. The web chat shows live voice activity and honors the configured input device.

Why This Change Was Made

Round 2 of aligning the native macOS chat with the web chat (follow-up to #109712), scoped to the talk-input ownership area:

  • Talk now binds its AVAudioEngine capture to the microphone selected in Voice settings (voiceWakeMicID stays the single authoritative selection, shared with Voice Wake); empty selection keeps the system default.
  • Voice processing (echo cancellation/AGC) is enabled when the device supports it, with a one-retry fallback to a plain engine when a device rejects it.
  • Device unplug/default changes mid-talk restart capture safely (observer-driven); the saved selection is retried on the next start. A Core Audio edge is guarded where AVAudioEngine.inputNode can abort without a usable default device.
  • TalkModeController now publishes smoothed level, phase, partial transcript, and the last 20 final utterances; the chat composer renders a live waveform on the talk button, a Listening/Thinking/Speaking status, and an expandable rolling transcript strip.
  • Right-clicking the talk button lists available input devices (plus System Default) and patches the same authoritative setting.
  • Shared OpenClawChatTalkControl gains additive, defaulted fields (level, transcripts, devices, selection callback) — iOS keeps compiling unchanged and can adopt later.

User Impact

Talking to OpenClaw from the native chat now uses the microphone you chose, sounds cleaner on supported devices, survives device changes, and shows what the app hears while you speak — matching the web chat's feedback. The menu-bar talk overlay is unchanged.

Evidence

  • swift build --package-path apps/shared/OpenClawKit --target OpenClawChatUI and swift build --package-path apps/macos --configuration release — pass (re-verified after rebase onto landed main).
  • swift test --package-path apps/shared/OpenClawKit --parallel — 864 tests pass.
  • swift test --package-path apps/macos --parallel — 1309 pass; new suites: device-selection resolution (6 tests), controller publishing (2), talk-activity views (4).
  • pnpm lint:swift, pnpm format:swift, pnpm native:i18n:sync (inventory committed; translations to follow in the i18n pass) — clean.
  • Structured review: one reported compile-error finding was rejected as false — the flagged OSLog concatenation pattern is pre-existing in the same file on main (TalkModeRuntime.swift:533-548) and the tree passed two independent release builds.
  • Live microphone capture requires interactive permission and was not exercised end-to-end; control rendering and all decision logic are unit-tested.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: macos App: macos size: L maintainer Maintainer-authored PR labels Jul 17, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 729cd648b2

ℹ️ 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".

}

func inputDeviceSelectionDidChange() async {
guard self.isEnabled, !self.isPaused, self.phase == .listening else { return }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restart capture for mic changes while speaking

When the user changes the Talk input from the new chat menu while the assistant is speaking, this guard drops the change because the phase is .speaking. That is still an active capture state when interruptOnSpeech is enabled: prepareForPlayback() starts recognition before switching to .speaking, and handleRecognition uses those callbacks for barge-in. In that scenario the recognition engine stays bound to the old or unplugged mic until playback finishes, so users cannot interrupt speech with the newly selected/fallback microphone during the active Talk session.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. labels Jul 17, 2026
@clawsweeper

clawsweeper Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 17, 2026, 9:51 AM ET / 13:51 UTC.

Summary
The PR makes macOS Talk use the microphone selected in Voice settings, adds device-change and voice-processing handling, and exposes live level, phase, transcript, and microphone controls in the shared chat UI.

PR surface: Docs 0, Other +1456. Total +1456 across 36 files.

Reproducibility: yes. the paths are source-reproducible: current macOS Talk does not bind the saved microphone UID, and the proposed guard demonstrably ignores a selection change during speaking even though barge-in recognition is active. The hardware scenarios were not executed in this review.

Review metrics: 1 noteworthy metric.

  • Preference surface: 1 existing preference expanded, 0 new settings. Talk reuses voiceWakeMicID rather than creating another microphone setting, keeping configuration additive while making runtime switching behavior the key review surface.

Stored data model
Persistent data-model change detected: serialized state: apps/macos/Tests/OpenClawIPCTests/TalkModeControllerPublishingTests.swift. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Fix and test microphone changes while Talk is speaking with interrupt-on-speech enabled.
  • [P1] Add a redacted native macOS recording or live diagnostic output proving selected-microphone capture, activity feedback, and device-change recovery.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR provides builds, unit tests, and CI but explicitly did not run live microphone capture; before merge, add redacted native macOS evidence showing selected-device capture, visible activity/transcript feedback, and a device switch or unplug recovery. Updating the PR body should trigger review, or a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] No native run demonstrates that the selected device, voice-processing retry, unplug/default-change recovery, waveform, and rolling transcript work together with real microphone permissions and hardware.

Maintainer options:

  1. Decide the mitigation before merge
    Allow capture restart whenever recognition is active, including speaking with interrupt-on-speech enabled, add focused regression coverage, and provide a redacted native macOS recording or live log proving selected-microphone capture and device switching.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] The protected maintainer-labeled PR needs the existing author-side speaking-phase repair, native proof, and normal review rather than an automated repair lane.

Security
Cleared: The native audio, UI, test, documentation, and generated localization changes introduce no concrete security or supply-chain concern.

Review findings

  • [P2] Restart capture when the input changes during speaking — apps/macos/Sources/OpenClaw/TalkModeRuntime.swift:190
Review details

Best possible solution:

Allow capture restart whenever recognition is active, including speaking with interrupt-on-speech enabled, add focused regression coverage, and provide a redacted native macOS recording or live log proving selected-microphone capture and device switching.

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

Yes, the paths are source-reproducible: current macOS Talk does not bind the saved microphone UID, and the proposed guard demonstrably ignores a selection change during speaking even though barge-in recognition is active. The hardware scenarios were not executed in this review.

Is this the best way to solve the issue?

No, not yet. Reusing the authoritative Voice Wake microphone selection is the right ownership direction, but the restart condition is too narrow and the native audio behavior remains unproven.

Full review comments:

  • [P2] Restart capture when the input changes during speaking — apps/macos/Sources/OpenClaw/TalkModeRuntime.swift:190
    The head is unchanged from the prior review. prepareForPlayback() starts recognition before Talk enters .speaking, so interrupt-on-speech still depends on active capture for barge-in; this new guard accepts only .listening, leaving recognition bound to the old microphone when the user changes input during playback. Permit restart for the active speaking/barge-in state and cover that transition.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b319493a529c.

Label changes

Label changes:

  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR provides builds, unit tests, and CI but explicitly did not run live microphone capture; before merge, add redacted native macOS evidence showing selected-device capture, visible activity/transcript feedback, and a device switch or unplug recovery. Updating the PR body should trigger review, or a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🧂 unranked krab, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P2: This is a normal-priority macOS Talk improvement with one bounded barge-in/device-switching defect and no evidence of broader runtime unavailability.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR provides builds, unit tests, and CI but explicitly did not run live microphone capture; before merge, add redacted native macOS evidence showing selected-device capture, visible activity/transcript feedback, and a device switch or unplug recovery. Updating the PR body should trigger review, or a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Docs 0, Other +1456. Total +1456 across 36 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 35 1562 106 +1456
Total 36 1563 107 +1456

What I checked:

Likely related people:

  • steipete: The merged macOS chat-parity work in commit bf754b8 introduced the host-side Talk wiring that this PR directly extends. (role: recent feature owner and merger; confidence: high; commits: bf754b8a344a; files: apps/macos/Sources/OpenClaw/WebChatSwiftUI.swift, apps/macos/Sources/OpenClaw/TalkModeController.swift, apps/macos/Sources/OpenClaw/TalkModeRuntime.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (1 earlier review cycle)
  • reviewed 2026-07-17T13:08:40.485Z sha 0b12303 :: needs real behavior proof before merge. :: [P2] Restart capture when the input changes during speaking

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 17, 2026
@steipete
steipete merged commit 311f5bf into main Jul 17, 2026
159 of 166 checks passed
@steipete
steipete deleted the claude/macos-chat-talk-audio-parity branch July 17, 2026 14:45
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 18, 2026
…e activity in chat (openclaw#109995)

* feat(macos): honor the selected microphone in Talk and surface live level, transcript, and mic picker in chat

* chore(i18n): translate new talk activity strings and regenerate Apple/Android catalogs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios app: macos App: macos docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant