Skip to content

feat(android): add native WebRTC media transport - #142296

Closed
roboclaw-bot wants to merge 4 commits into
openclaw/pr138726-split-i-i18nfrom
openclaw/pr138726-split-m-media
Closed

roboclaw-bot wants to merge 4 commits into
openclaw/pr138726-split-i-i18nfrom
openclaw/pr138726-split-m-media

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #138726 — Android realtime Talk.

What Problem This Solves

Android needs a native media connection to use the same client-owned realtime Talk paths as the browser, without moving provider credentials onto the phone.

Why This Change Was Made

Add the WebRTC peer, bounded SDP exchange through the captured Gateway connection, and shared microphone/playout ownership. The pinned SDK, JNI retention rules and license notice stay with the code that needs them. Call activation is a separate layer.

User Impact

Provides the native media transport for Android realtime calls. Audio routing preserves the distinction between a requested input device and an applied route. This layer alone does not change how users start Talk.

Evidence

Source-only correction — September 10, 2026

Head: c92cf8494a0bd2a401b740f870e300f1f1aff4cd. The source-only I correction is propagated without changing the media production code or queued-retirement regression. The composed K descendant cc1a6ce946aa3df418da6e3e12ddc73a563a52d5 passed all 3,059 Play app tests and all-module Kotlin lint. This is descendant validation, not a new independent M-flavor run.

  • Real GatewaySession + OkHttp dispatcher + local HTTP destination: allowed=1, retired=1 before; allowed=1, retired=0 after. This is destination-observed queued-retirement proof, not only pre-entry rejection.

  • 49 tests per Play/ThirdParty flavor passed on the repaired complete-native candidate; stored XML and exits were independently reviewed. Actual early-prefix validation is recorded separately.

  • Connection retirement owns cancellation; registration precedes enqueue and both callbacks dispose it. Pinned OkHttp/coroutine behavior was inspected directly.

  • Already-transmitted bytes cannot be recalled. Physical-device audio routing and signed/minified JNI acceptance remain unverified.

  • Prior-source verification: the earlier generated-resource candidate passed production/test-source compilation for both Android flavors, the queued-offer destination regression once per flavor, and ktlint. Those results retain their original source binding; they are not a new independent build of this source-only M head.

Historical validation source tree: commit ecade794dbc2e482a212e60bb498d71b68b51eea. The local evidence above has its stated scope.

Worked on by:

Add the connection-bound SDP route, WebRTC peer and shared audio ownership with the pinned SDK, license and JNI retention rules. This introduces transport primitives without activating calls.

Worked on by:
- @IWhatsskill

Co-authored-by: IWhatsskill <[email protected]>
@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
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.

@openclaw-barnacle openclaw-barnacle Bot added app: android App: android size: XL maintainer Maintainer-authored PR labels Sep 8, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 8, 2026 15:53
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 8, 2026
@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 10:11 AM ET / 14:11 UTC (Revision 11).

ClawSweeper review

What this changes

Adds Android WebRTC audio and event transport, connection-bound offer exchange, shared audio routing, and the pinned native SDK without activating calls.

Merge readiness

✅ Ready for maintainer review

This remains a useful, distinct transport layer absent from current main. The previous queued-offer finding is fixed, and no blocking introduced defect was established. The protected maintainer label also precludes cleanup closure.

Priority: P2
Reviewed head: c92cf8494a0bd2a401b740f870e300f1f1aff4cd

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent transport implementation with sufficient retirement proof and no established blocking defect; native-device coverage remains explicitly limited.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): Recorded GatewaySession and real OkHttp execution against a local HTTP destination demonstrates allowed delivery and rejection of retired queued offers after the repair. This satisfies the changed authority boundary; physical-device audio and signed/minified JNI remain unverified, without creating an additional contributor-proof gate for this bot-authored, inactive layer.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Recorded GatewaySession and real OkHttp execution against a local HTTP destination demonstrates allowed delivery and rejection of retired queued offers after the repair. This satisfies the changed authority boundary; physical-device audio and signed/minified JNI remain unverified, without creating an additional contributor-proof gate for this bot-authored, inactive layer.
Evidence reviewed 11 items Verified introduced scope: The pinned base-to-head diff contains the Android transport, routing, dependency, license, and test changes described in the supplied introduction evidence. The peer has no production caller at this head; activation belongs to a later stack layer.
Current-main necessity and release check: Current-main documentation explicitly describes Android as using Gateway relay rather than client-owned WebRTC. Neither the current-main nor v2026.9.3 Android voice tree contains the proposed peer. No merged fixing replacement was established.
Retirement repair and production-boundary coverage: The offer client checks connection ownership when dispatcher execution begins, registers lifetime cancellation before enqueue, and rejects late answers. The regression uses an actual GatewaySession and OkHttp dispatcher, then checks requests observed by the local HTTP destination after disconnect.
Findings None None.
Security None None.

How this fits together

Android Talk currently uses native speech or Gateway relay. This layer supplies a native media peer and exchanges connection offers through a captured Gateway connection for subsequent call coordination.

flowchart LR
  A[Future Talk call coordinator] --> B[Android WebRTC peer]
  B --> C[Captured Gateway connection]
  C --> D{Connection still current}
  D -->|Yes| E[Gateway or provider offer endpoint]
  D -->|No| F[Cancel offer]
  E --> B
  B <--> G[Microphone and speaker routing]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +877, Other +697. Total +1574 across 16 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 7 877 0 +877
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 9 704 7 +697
Total 16 1581 7 +1574

Review metrics

Metric Value Why it matters
Production versus test growth Production Kotlin +656 net lines; tests and test support +877 Production growth supplies the previously absent native transport and routing owners; activation remains in a separate stack layer.
Activation scope 0 production callers of the new WebRTC peer This layer does not replace existing Android Talk behavior or change stored user preferences.

Technical review

Best possible solution:

Retain the connection-owned transport primitives and shared audio lifecycle, with native device and packaging acceptance attached to the stack’s call activation.

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

Not applicable to the feature as a whole; the prior retirement defect has recorded before/after destination observations and matching regression coverage. No tests were executed during this read-only review.

Is this the best way to solve the issue?

Yes: a native peer using the existing connection and audio lifecycle owners is a coherent transport boundary, and current main has no equivalent Android WebRTC implementation.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded Android realtime capability layer without an established urgent regression in currently active Talk behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Recorded GatewaySession and real OkHttp execution against a local HTTP destination demonstrates allowed delivery and rejection of retired queued offers after the repair. This satisfies the changed authority boundary; physical-device audio and signed/minified JNI remain unverified, without creating an additional contributor-proof gate for this bot-authored, inactive layer.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded GatewaySession and real OkHttp execution against a local HTTP destination demonstrates allowed delivery and rejection of retired queued offers after the repair. This satisfies the changed authority boundary; physical-device audio and signed/minified JNI remain unverified, without creating an additional contributor-proof gate for this bot-authored, inactive layer.

Evidence

What I checked:

  • Verified introduced scope: The pinned base-to-head diff contains the Android transport, routing, dependency, license, and test changes described in the supplied introduction evidence. The peer has no production caller at this head; activation belongs to a later stack layer. (apps/android/app/src/main/java/ai/openclaw/app/voice/TalkRealtimePeer.kt:39, c92cf8494a0b)
  • Current-main necessity and release check: Current-main documentation explicitly describes Android as using Gateway relay rather than client-owned WebRTC. Neither the current-main nor v2026.9.3 Android voice tree contains the proposed peer. No merged fixing replacement was established. Public docs: docs/nodes/talk.md. (docs/nodes/talk.md:16, 878bc51433d4)
  • Retirement repair and production-boundary coverage: The offer client checks connection ownership when dispatcher execution begins, registers lifetime cancellation before enqueue, and rejects late answers. The regression uses an actual GatewaySession and OkHttp dispatcher, then checks requests observed by the local HTTP destination after disconnect. (apps/android/app/src/test/java/ai/openclaw/app/gateway/GatewaySessionReconnectTest.kt:166, c92cf8494a0b)
  • Recorded proof and review continuity: The supplied body snapshot, sourceRevision c2ff74288239c911d1aa71c006bf80688f9f7ff5becfadb61d7b7967ddedf8ae, records destination counts changing from allowed=1/retired=1 to allowed=1/retired=0. It explicitly distinguishes historical flavor validation and descendant tests from this head, and leaves physical-device audio and signed/minified JNI unverified. Comparison with the immediate previous head shows no change to the media production files or queued-retirement regression. The completed same-head review contains no findings; its native-validation note is context, not a newly established defect. (c92cf8494a0b)
  • Dependency boundary: The patch directly imports WebRTC and uses OkHttp plus coroutine completion handlers; these are affirmative dependency contracts. The patch does not depend on the Codex harness. The WebRTC package is pinned, its license is bundled, and JNI retention rules are narrowly associated with that SDK. (apps/android/gradle/libs.versions.toml:103, c92cf8494a0b)
  • SDK source provenance: The verified SDK repository's v150.7871.01 release source maps the pinned Android package to WebRTC source commit 73cb8180f7258ee292878d6edd05177f41883962. (CHANGES.md:5, 7b6390fb0983)

Likely related people:

  • Peter Steinberger: Raw commit ff58b5e adds apps/android/app/src/main/java/ai/openclaw/app/voice/RealtimeCommunicationAudio.kt:29 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ff58b5e79fb9; files: apps/android/app/src/main/java/ai/openclaw/app/voice/RealtimeCommunicationAudio.kt)

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 (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-08T19:45:13.305Z sha ecade79 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-08T19:54:52.347Z sha ecade79 :: blocked before merge. :: none
  • reviewed 2026-09-08T20:28:41.041Z sha ecade79 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-08T21:24:45.855Z sha ecade79 :: blocked before merge. :: none
  • reviewed 2026-09-09T10:08:24.725Z sha 1fa8502 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-09T15:16:26.689Z sha 28fc906 :: blocked before merge. :: none
  • reviewed 2026-09-10T11:24:40.680Z sha 2f970e9 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-10T13:59:45.164Z sha c92cf84 :: blocked before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime labels Sep 8, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 8, 2026
@openclaw-barnacle openclaw-barnacle Bot closed this Sep 8, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 8, 2026
@openclaw-barnacle openclaw-barnacle Bot removed docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime labels Sep 8, 2026
@openclaw-barnacle openclaw-barnacle Bot closed this Sep 8, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 8, 2026
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/pr138726-split-m-media branch from ecade79 to 1fa8502 Compare September 9, 2026 09:56
Integrate the reviewed owner-scoped repairs and updated stack prerequisite.
Retain the validated M layer source with only the inherited legacy agent-binding fix.
Preserve the historical secondary parent and the validated layer source while restacking its prerequisite.

Co-authored-by: IWhatsskill <[email protected]>
Worked on by:
- @IWhatsskill
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/pr138726-split-m-media branch from 1fa8502 to 28fc906 Compare September 9, 2026 15:08
roboclaw-bot and others added 2 commits September 10, 2026 11:06
Recheck physical-route ownership when queued HTTP offers begin execution.

Worked on by:
- @IWhatsskill

Co-authored-by: IWhatsskill <[email protected]>
Carry only the I generated-artifact isolation correction. Preserve the existing feature layer, queued-offer race fix, and both histories.

Worked on by:
- @IWhatsskill

Co-authored-by: IWhatsskill <[email protected]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Closing this PR in favor of a planned rebuild on current main.

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

Labels

app: android App: android maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

2 participants