Skip to content

feat(macos): add realtime Talk relay - #119321

Closed
vincentkoc wants to merge 15 commits into
stack/talk-consult-lifecyclefrom
stack/macos-realtime-runtime
Closed

vincentkoc wants to merge 15 commits into
stack/talk-consult-lifecyclefrom
stack/macos-realtime-runtime

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 4, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

macOS Talk could not use the Gateway-owned realtime relay, so native microphone and playback sessions could not share the canonical Talk lifecycle, agent consult ownership, or GPT-Live path. Earlier prototype behavior also hid startup and microphone recovery failures.

Why This Change Was Made

This adds a macOS realtime relay built on a shared OpenClawKit session used by Apple clients. The native runtime owns microphone capture and playback; the Gateway remains the canonical Talk and agent-work owner. Startup failure, reconnect, pause/resume, audio teardown, stale generation, and device-recovery paths have explicit lifecycle outcomes.

The relay is deliberately default-off. It requires both the local Settings > Voice & Talk > Use Gateway realtime relay toggle and the exact Gateway realtime tuple. Existing users remain on native Talk until they opt in; there is no automatic migration.

User Impact

Operators can explicitly opt macOS Talk into the Gateway realtime relay and use native microphone/playback with the same durable agent-consult behavior as other Talk clients. Failures are surfaced instead of flashing or silently leaving stale state.

Evidence

  • Exact head: 1829fffb4e7ac0e39028e5b5efbbd71a8f6836e1, based on main 1f3d45b76f51298699423b8a3331b42b6d51b962.
  • Exact-head OpenAI provider and Gateway bridge proof: 150 assertions passed.
  • Exact-head Talk harness and Gateway relay proof: 7 unit plus 131 Gateway assertions passed.
  • Shared OpenClawKit relay lifecycle tests: 17 passed.
  • macOS Talk runtime/config/settings tests: 16 passed.
  • Live GPT-Live proof completed with transcript, close, and no-late-audio assertions.
  • Content-equivalent Blacksmith changed-surface proof passed all code, typecheck, lint, and test lanes: https://github.com/openclaw/openclaw/actions/runs/30940713690.
  • Native i18n inventory, 21 locale artifacts, Apple/Android generated resources, and macOS Swift lint: passed.
  • git diff --check and private-data scan: clean.

Stack

Depends on #119212. The initial integration preserves Zhilong Zheng's contributor credit.

Punchcard-Session: calm-cedar-river-aa

@vincentkoc vincentkoc self-assigned this Aug 4, 2026
@openclaw-barnacle openclaw-barnacle Bot added app: ios App: ios app: macos App: macos size: XL maintainer Maintainer-authored PR labels Aug 4, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@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. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Aug 4, 2026
@clawsweeper

clawsweeper Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 2, 2026, 8:46 PM ET / October 3, 2026, 00:46 UTC (Revision 18).

ClawSweeper review

What this changes

Adds opt-in macOS realtime voice conversations through the Gateway, shares the Apple relay session with iOS, and updates lifecycle handling, settings, translations, tests, and documentation.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep open for an explicit maintainer disposition: the central capability already landed through #128204, but MEMBER authorship and the protected maintainer label prevent automated closure. Two source-backed blockers remain in this branch.

Priority: P2
Reviewed head: 1829fffb4e7ac0e39028e5b5efbbd71a8f6836e1
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The shared-owner approach is coherent, but native interruption defects remain and the central integration is already landed.
Proof confidence 🌊 off-meta tidepool Not applicable: MEMBER authorship exempts this PR from the ordinary contributor proof gate. Its claimed Gateway GPT-Live run does not independently establish physical Mac capture, playback, or route changes; additive preference compatibility is source-verified.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: MEMBER authorship exempts this PR from the ordinary contributor proof gate. Its claimed Gateway GPT-Live run does not independently establish physical Mac capture, playback, or route changes; additive preference compatibility is source-verified.
Evidence reviewed 10 items Protected maintainer-owned item: Live metadata confirms MEMBER authorship, assignment to vincentkoc, draft status, and the pinned head. The supplied context includes the protected maintainer label.
Merged canonical macOS integration: GitHub verifies that #128204 merged on 2026-08-23. Its supplied body explicitly distinguishes this broader draft and describes the landed macOS relay, local opt-in, native fallback, and recovery.
Current-main implementation and release inclusion: Current main contains opt-in relay startup and guarded native fallback. The release-containment check lists v2026.9.7 as containing the canonical macOS integration commit; this establishes tagged source inclusion, without claiming physical-device verification.
Findings 2 actionable findings [P1] Preserve speech interruption on isolated output routes
[P2] Send whole-millisecond media timestamps
Security None None.

How this fits together

Apple Talk clients capture microphone audio and exchange it with a Gateway-owned voice session. The shared relay handles transcripts, agent requests, playback, and session teardown while each platform owns its audio devices.

flowchart LR
  A[Local Talk preference] --> C[Native Talk runtime]
  B[Gateway voice configuration] --> C
  C --> D[Shared Apple relay]
  E[Microphone capture] --> D
  D --> F[Gateway voice session]
  F --> D
  D --> G[Speaker playback and transcripts]
Loading

Decision needed

Question Recommendation
Should this broader draft be retired in favor of the merged macOS relay, or does it contain specific remaining work worth extracting? Retire the superseded draft: Close this branch explicitly after confirming that the canonical main implementation covers the intended operator workflow.

Why: The central capability is landed, but this protected maintainer-authored branch requires an explicit disposition of its remaining settings and localization work.

Before merge

  • Preserve speech interruption on isolated output routes (P1) - The new Mac capture always requests input suppression, including on headphones. During output, the shared relay drops every frame before handleInputLevelDuringOutput, so spoken interruption never reaches local cancellation or the provider. Keep speaker echo suppression, but determine it from the active output route as the iOS adapter and current-main Mac implementation do.
  • Send whole-millisecond media timestamps (P2) - This new tap sends fractional uptime milliseconds, whereas the existing iOS tap rounds them. The Gateway forwards these values to the OpenAI bridge, which uses their difference as conversation.item.truncate.audio_end_ms; OpenAI declares that field as an integer. Explicit output interruption can therefore send a rejected truncation event. Round timestamps at the canonical send boundary.
  • Resolve merge risk (P1) - Landing this branch's new macOS audio path as written leaves speech interruption blocked during playback and exposes fractional interruption timestamps to the OpenAI API.
  • Complete next step (P2) - Decide whether to retire this draft or extract a specific unique remainder; repair both native interruption defects if retaining its runtime implementation.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

  • [P1] Preserve speech interruption on isolated output routes — apps/macos/Sources/OpenClaw/MacRealtimeTalkAudioCapture.swift:25-28
  • [P2] Send whole-millisecond media timestamps — apps/macos/Sources/OpenClaw/MacRealtimeTalkAudioCapture.swift:297-300
Agent review details

Security

None.

PR surface

Docs +10, Other +2748. Total +2758 across 43 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 1 13 3 +10
Config 0 0 0 0
Generated 0 0 0 0
Other 42 4302 1554 +2748
Total 43 4315 1557 +2758

Review metrics

Metric Value Why it matters
Local preference 1 added, default off The persisted per-Mac opt-in preserves the native default and explicit existing preference values.
Swift production versus tests production net +1358; tests net +892 Growth implements macOS audio ownership and shared Apple lifecycle handling, but its remaining value should be assessed against the landed relay.

Root-cause cluster

Relationship: superseded
Canonical: #128204
Summary: The merged macOS integration owns the central relay capability; this broader draft requires human disposition of any distinct remainder.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Use the landed relay (recommended)
    Retire this draft through maintainer judgment and retain current main's route-aware, bounded relay implementation.
  2. Repair any retained native path
    If this implementation is retained, restore headphone interruption and normalize media timestamps before provider truncation.

Technical review

Best possible solution:

Keep the canonical relay already on main and preserve only demonstrably unique, still-needed settings or localization work in a focused follow-up.

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

Yes, source establishes both branch defects: microphone frames return before barge-in during playback, and unrounded Mac timestamps reach integer-only provider truncation. Neither was executed in this read-only review.

Is this the best way to solve the issue?

No, this broader branch is no longer the best integration path: the canonical relay is merged and includes stronger route and lifecycle handling. Any unique remainder should build on that implementation.

Full review comments:

  • [P1] Preserve speech interruption on isolated output routes — apps/macos/Sources/OpenClaw/MacRealtimeTalkAudioCapture.swift:25-28
    The new Mac capture always requests input suppression, including on headphones. During output, the shared relay drops every frame before handleInputLevelDuringOutput, so spoken interruption never reaches local cancellation or the provider. Keep speaker echo suppression, but determine it from the active output route as the iOS adapter and current-main Mac implementation do.
    Confidence: 0.99
  • [P2] Send whole-millisecond media timestamps — apps/macos/Sources/OpenClaw/MacRealtimeTalkAudioCapture.swift:297-300
    This new tap sends fractional uptime milliseconds, whereas the existing iOS tap rounds them. The Gateway forwards these values to the OpenAI bridge, which uses their difference as conversation.item.truncate.audio_end_ms; OpenAI declares that field as an integer. Explicit output interruption can therefore send a rejected truncation event. Round timestamps at the canonical send boundary.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This optional, default-off native voice feature needs bounded maintainer disposition; the central capability already exists on main.
  • merge-risk: 🚨 availability: The introduced macOS capture can block spoken interruption and produce provider-invalid truncation timestamps.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: MEMBER authorship exempts this PR from the ordinary contributor proof gate. Its claimed Gateway GPT-Live run does not independently establish physical Mac capture, playback, or route changes; additive preference compatibility is source-verified.

Evidence

What I checked:

  • Protected maintainer-owned item: Live metadata confirms MEMBER authorship, assignment to vincentkoc, draft status, and the pinned head. The supplied context includes the protected maintainer label. (1829fffb4e7a)
  • Merged canonical macOS integration: GitHub verifies that feat(talk): add macOS realtime Gateway relay #128204 merged on 2026-08-23. Its supplied body explicitly distinguishes this broader draft and describes the landed macOS relay, local opt-in, native fallback, and recovery. (000db97c8252)
  • Current-main implementation and release inclusion: Current main contains opt-in relay startup and guarded native fallback. The release-containment check lists v2026.9.7 as containing the canonical macOS integration commit; this establishes tagged source inclusion, without claiming physical-device verification. (apps/macos/Sources/OpenClaw/TalkModeRuntime+Realtime.swift:81, 2fce08dfd775)
  • Feature-history routing: The canonical integration commit records Vincent Koc as author and Zhilong Zheng as co-author. Recent current-main history shows Peter Steinberger maintaining the capture and shared Apple relay paths. (apps/macos/Sources/OpenClaw/MacRealtimeTalkAudioCapture.swift, 669db5d36e06)
  • Headphone interruption remains blocked: The introduced macOS capture always returns true for input suppression. The shared relay returns before its barge-in handler when that flag is true. The iOS adapter remains route-aware, and current-main capture tests explicitly verify headphone interruption. (apps/macos/Sources/OpenClaw/MacRealtimeTalkAudioCapture.swift:25, 1829fffb4e7a)
  • Fractional timestamp reaches the provider: The new macOS tap emits unrounded uptime milliseconds. Gateway relay operations pass that timestamp to the OpenAI bridge, whose interruption code subtracts media timestamps and sends the result as audio_end_ms. The Gateway schema accepts numbers, so rejection occurs downstream rather than during Gateway validation. (apps/macos/Sources/OpenClaw/MacRealtimeTalkAudioCapture.swift:300, 1829fffb4e7a)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • zhilong1115: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Resolve the branch's remaining scope against the merged canonical relay.
  • If retaining runtime work, preserve headphone interruption and integer media timestamps with focused regression coverage.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (17 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-06T05:52:15.197Z sha 1829fff :: found issues before merge. :: [P1] Preserve speech interruption on isolated output routes
  • reviewed 2026-08-08T00:43:12.900Z sha 1829fff :: found issues before merge. :: [P1] Preserve speech interruption on isolated output routes
  • reviewed 2026-08-14T16:32:50.768Z sha 1829fff :: found issues before merge. :: [P1] Preserve speech interruption on isolated output routes
  • reviewed August 15, 2026, 5:47 PM ET / 21:47 UTC sha unknown :: found issues before merge. :: [P1] Preserve speech interruption on isolated output routes
  • reviewed 2026-08-19T18:47:40.566Z sha 1829fff :: found issues before merge. :: [P1] Preserve interruption on isolated macOS output routes
  • reviewed 2026-08-26T01:28:37.245Z sha 1829fff :: needs historical verification review before merge. :: [P1] Preserve interruption on isolated Mac output routes
  • reviewed 2026-09-02T01:26:30.643Z sha 1829fff :: found issues before merge. :: [P1] Preserve speech interruption on isolated output routes
  • reviewed 2026-09-27T10:06:17.569Z sha 1829fff :: blocked before merge. :: [P1] Preserve speech interruption on isolated output routes | [P2] Report and recover when microphone sends saturate | [P2] Send whole-millisecond audio timestamps

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. and removed P2 Normal backlog priority with limited blast radius. labels Aug 4, 2026
@vincentkoc
vincentkoc force-pushed the stack/talk-consult-lifecycle branch from d1d38f9 to a5bc302 Compare August 5, 2026 00:52
@vincentkoc
vincentkoc force-pushed the stack/macos-realtime-runtime branch from b7063f6 to 751329c Compare August 5, 2026 00:52
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Aug 5, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Aug 5, 2026
@vincentkoc
vincentkoc force-pushed the stack/talk-consult-lifecycle branch from a5bc302 to 3fb3668 Compare August 5, 2026 01:08
@vincentkoc
vincentkoc force-pushed the stack/macos-realtime-runtime branch from 751329c to 098f5d2 Compare August 5, 2026 01:08
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 5, 2026
@vincentkoc
vincentkoc force-pushed the stack/talk-consult-lifecycle branch from 3fb3668 to cb51356 Compare August 5, 2026 01:22
@vincentkoc
vincentkoc force-pushed the stack/macos-realtime-runtime branch from 098f5d2 to b0e1b36 Compare August 5, 2026 01:22
@clawsweeper clawsweeper Bot removed the rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. label Aug 5, 2026
@vincentkoc
vincentkoc force-pushed the stack/talk-consult-lifecycle branch from f59272d to cad6aa8 Compare August 5, 2026 03:16
@vincentkoc
vincentkoc force-pushed the stack/macos-realtime-runtime branch from d74b40c to 1829fff Compare August 5, 2026 03:16
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 14, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. labels Aug 26, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 27, 2026
@steipete

Copy link
Copy Markdown
Contributor

Thanks for the PR. We're closing older pull requests that have gone stale against current main.

The central macOS realtime Talk capability already landed through #128204, and this draft has had no commits since August 5.

If this change is still needed, please open a fresh PR against current main and we'll review it there.

@steipete steipete closed this Oct 24, 2026
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 merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL 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