[codex] Gate Android Talk capture starts in background#98055
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 2, 2026, 9:16 AM ET / 13:16 UTC. Summary PR surface: Other +88. Total +88 across 9 files. Reproducibility: yes. Current main routes background talk.ptt.start through prepareTalkCapture without a foreground gate before microphone foreground-service promotion, and the PR discussion includes before/after Android 16 emulator proof of that path. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Merge the exact-head foreground gate if maintainers accept foreground-only new Android Talk capture starts, keeping the active retry and stop/cancel paths routable as the patch does. Do we have a high-confidence way to reproduce the issue? Yes. Current main routes background talk.ptt.start through prepareTalkCapture without a foreground gate before microphone foreground-service promotion, and the PR discussion includes before/after Android 16 emulator proof of that path. Is this the best way to solve the issue? Yes. Gating new capture at NodeRuntime plus a final TalkModeManager allowNewCapture check is the narrow owner-boundary fix; marking only talk.ptt.once foreground-only preserves active-session retry and stop/cancel control. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b60e8c48382d. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Other +88. Total +88 across 9 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
29ce660 to
ae446c1
Compare
|
Maintainer verification on exact head
Live Android 16 emulator proof:
This matches Android's current while-in-use foreground-service restriction while preserving lifecycle control for an already-running capture.
|
|
Merged via squash.
|
* fix: gate Android talk capture starts * refactor(android): make Talk capture policy explicit --------- Co-authored-by: NianJiuZst <180004567+users.noreply.github.com> Co-authored-by: Peter Steinberger <[email protected]>
* fix: gate Android talk capture starts * refactor(android): make Talk capture policy explicit --------- Co-authored-by: NianJiuZst <180004567+users.noreply.github.com> Co-authored-by: Peter Steinberger <[email protected]>



What Problem This Solves
Android Talk push-to-talk capture can start microphone capture and move
NodeForegroundServiceinto the microphone foreground-service type. On modern Android, starting a microphone foreground service from the background is restricted, so remotetalk.ptt.start/talk.ptt.onceinvocations should not start a new capture while the app is backgrounded.Why This Change Was Made
This gates new Talk capture starts at the Android runtime boundary.
talk.ptt.onceremains a foreground-only dispatcher command, whiletalk.ptt.startis handled inNodeRuntimeso idempotent retries for an already-active capture can still return the current capture id.TalkModeManager.beginPushToTalk(allowNewCapture = false)owns the final new-capture check to avoid a race between an external active-capture precheck and the actual begin operation.User Impact
Background remote commands no longer try to create a new microphone capture path that Android can reject at foreground-service startup time. Existing active PTT sessions can still be stopped/cancelled, and
ptt.startretries for an active session still reconcile to the same capture id.Evidence
cd apps/android && ./gradlew :app:testThirdPartyDebugUnitTest --tests ai.openclaw.app.node.InvokeCommandRegistryTest --tests ai.openclaw.app.node.InvokeDispatcherTest --tests ai.openclaw.app.GatewayBootstrapAuthTest --tests ai.openclaw.app.voice.TalkModeManagerTestgit diff --check.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/mainKnown unrelated local check gap:
cd apps/android && ./gradlew :app:ktlintCheckcurrently fails on untouched upstream files:apps/android/app/src/main/java/ai/openclaw/app/GatewayExecApprovals.ktandapps/android/app/src/main/java/ai/openclaw/app/ui/design/ClawSurfaces.kt.