Skip to content

fix(ui): explain pending voice microphone access - #133353

Merged
steipete merged 2 commits into
mainfrom
codex/voice-turn-reliability
Aug 30, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/voice-turn-reliability

Conversation

@steipete

@steipete steipete commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #133348

What Problem This Solves

Fixes an issue where users starting Browser Talk would see an animated stop control without visible guidance when microphone access remained pending. The same missing permission guidance affected dictation in chat and the new-session composer.

Why This Change Was Made

The shared microphone owner now reports when capture is being requested and when acquisition succeeds. The composer displays that existing connecting state as a neutral status callout, separating session preparation, microphone access, and provider connection. Cancellation cannot publish a late status or retain a late-granted stream. The existing error renderer remains the single owner for errors; duplicate connecting announcements and unused dictation copy are removed.

No new configuration, timeout, permission bypass, dependency, or persistence contract. The browser is allowed to leave a permission request unresolved; adding an arbitrary timeout would not fix that condition. Provenance: introducing commit unknown; #127673 handled rejected requests, not pending requests.

User Impact

Users can see what startup is waiting for and receive foreground/permission guidance while the microphone request is pending. Stop remains available. Guidance disappears when the connection is ready, while existing microphone-loss errors and cleanup remain intact.

Evidence

Two focused pre-fix regressions failed for missing microphone-phase status and missing visible composer guidance. The native Chromium scenario also failed on the baseline. The repaired run passes the pending-access flow, real Chromium capture acquisition, transition to Listening, and existing microphone-ended cleanup. Gateway/provider signaling is synthetic in that deterministic browser test; this is not a claim about physical microphone permission prompts or live provider recognition accuracy.

Focused tests cover the shared microphone lifetime, OpenAI WebRTC, Google Live, Gateway relay, session ownership, chat rendering, and new-session dictation. Before/after pictures below use inspected synthetic data only. Browser contract: https://w3c.github.io/mediacapture-main/#dom-mediadevices-getusermedia

Production UI: +88/-53 (net +35). Tests/test support: +233/-43. Docs: +7. The production growth supplies previously absent lifecycle progress and visible guidance through existing status/rendering owners; no new state machine or fallback path.

Release-note context: Browser Talk and dictation explain pending microphone access and show startup progress.

Before:

Pending microphone access before the fix

After:

Visible microphone-access guidance after the fix

Focused validation commands and outcomes
node scripts/run-vitest.mjs ui/src/pages/chat/realtime-talk-input.test.ts ui/src/pages/chat/realtime-talk-webrtc-video.test.ts ui/src/pages/chat/chat-composer.test.ts
# 71 passed

node scripts/run-vitest.mjs ui/src/pages/chat/realtime-talk-input.test.ts ui/src/pages/chat/realtime-talk-webrtc.test.ts ui/src/pages/chat/realtime-talk-webrtc-control.test.ts ui/src/pages/chat/realtime-talk-webrtc-video.test.ts ui/src/pages/chat/realtime-talk-google-live.test.ts ui/src/pages/chat/realtime-talk-google-live-timeout.test.ts ui/src/pages/chat/realtime-talk-google-live-video.test.ts ui/src/pages/chat/realtime-talk-gateway-relay.test.ts ui/src/pages/chat/realtime-talk.test.ts ui/src/pages/chat/realtime-talk-lifecycle.test.ts ui/src/pages/chat/chat-realtime.test.ts ui/src/pages/chat/chat-composer.test.ts ui/src/pages/chat/chat-view.test.ts ui/src/pages/new-session/composer-dictation-control.test.ts
# 591 passed; one relay assertion still counted intentional startup progress.
# Corrected that assertion to clear completed startup calls before injecting the stale failure.

node scripts/run-vitest.mjs ui/src/pages/chat/realtime-talk-gateway-relay.test.ts ui/src/pages/chat/chat-composer.test.ts ui/src/pages/chat/chat-view.test.ts ui/src/pages/new-session/composer-dictation-control.test.ts
# Final rerun: 401 passed, including duplicate dictation-announcement cleanup.

node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/browser-talk-microphone-lifetime.e2e.test.ts
# 2 passed

node --import ./scripts/tsx.mjs scripts/control-ui-i18n-verify.ts baseline
node --import ./scripts/tsx.mjs scripts/control-ui-i18n-verify.ts verify
# Passed; no generated locale changes.

Fresh Codex autoreview against the pinned baseline found no actionable P0-P2 findings.

Known separate follow-ups: #133351 tracks Google interruption turn correlation. Long microphone waits can also expire an already-created short-lived offer; this PR makes the wait visible but does not change allocation order or extend provider deadlines.

CI correction: initial run 33320952669 found the existing WebRTC test file at 1002 counted lines. Shared the repeated peer lookup guard without changing assertions; the focused 27-test rerun and exact core lint command passed:

node scripts/run-vitest.mjs ui/src/pages/chat/realtime-talk-webrtc.test.ts
node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json ui/src/pages/chat/realtime-talk-webrtc.test.ts

The full candidate received another clean pinned Codex review before the correction was pushed. Local broad changed-check verification is limited by the shared checkout dependency tree resolving pako 1.0.11 instead of the locked UI 3.0.1; the artifact-preparing lint invocation also encountered stale Telegram dependency types. No dependencies or gates were changed. The correctly scoped core lint passed, and the first clean hosted run passed its UI/type and browser lanes. Exact-head hosted CI remains required for landing. Long microphone allocation delay is tracked in #133359.

@steipete steipete self-assigned this Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Aug 30, 2026
@steipete
steipete marked this pull request as ready for review August 30, 2026 15:54
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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. labels Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 12:12 PM ET / 16:12 UTC.

ClawSweeper review

What this changes

The PR adds visible microphone-permission guidance to Browser Talk and dictation while capture is pending, then clears it as the voice connection progresses.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep this active: it is a maintainer-authored repair for an open, still-unmerged Browser Talk usability bug, and the reviewed patch has no actionable correctness finding.

Priority: P1
Reviewed head: a1a6c73a4a94a3ac4b6574e941bb3166b16343b7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused shared-owner repair with credible boundary and browser regression coverage; no actionable patch defect was found.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate. The source E2E exercises the pending-to-listening browser path, but the prepared screenshots depict an earlier blocked-permission repair rather than the new pending state.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate. The source E2E exercises the pending-to-listening browser path, but the prepared screenshots depict an earlier blocked-permission repair rather than the new pending state.
Evidence reviewed 6 items Current-main gap and introduced repair: Current main's input controller awaits microphone acquisition without publishing a pending/acquired status; the PR adds those two owner-boundary notifications.
Cancellation remains owned by capture lifecycle: The shared media request races cancellation and releases a stream granted after cancellation; the new acquired callback runs only after the current controller has succeeded.
All Talk transports receive the shared phase: WebRTC, Google Live, and Gateway relay each forward the input owner's status to the existing session callback, rather than creating transport-specific UI state.
Findings None None.
Security None None.

How this fits together

Control UI Talk startup requests browser microphone capture before its realtime transport can connect. The chat composer receives lifecycle status and renders the pending-capture state while retaining Stop as the cancellation action.

flowchart LR
  A[User starts voice input] --> B[Talk startup]
  B --> C[Browser microphone request]
  C --> D{Capture state}
  D -->|Permission pending| E[Visible permission guidance]
  D -->|Capture granted| F[Realtime transport setup]
  E --> G[Stop cancels startup]
  F --> H[Listening state]
Loading

Before merge

  • Resolve merge risk (P1) - The bug fix has a net +35 production-UI lines; the added lifecycle detail is justified by reuse through the shared input owner and the single status renderer, but further per-transport status paths would create drift.
Agent review details

Security

None.

PR surface

Source +35, Tests +190, Docs +7. Total +232 across 22 files.

View PR surface stats
Area Files Added Removed Net
Source 9 88 53 +35
Tests 12 233 43 +190
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 22 328 96 +232

Review metrics

Metric Value Why it matters
Production versus test LOC production UI +88/-53 (net +35); tests/test support +233/-43; docs +7 The production growth is bounded to shared lifecycle progress and its renderer; most of the diff is focused regression coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #133348
Summary: This PR is the direct candidate repair for the pending-microphone-guidance issue; the cited interruption and credential-expiry reports describe separate lifecycle defects.

Members:

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the shared microphone lifecycle callback and the single composer status renderer as the canonical progress path, then land after exact-head checks complete.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the shared microphone lifecycle callback and the single composer status renderer as the canonical progress path, then land after exact-head checks complete.

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

Yes—source provides a high-confidence path: leave getUserMedia() pending after starting Browser Talk; current main waits without a visible microphone-specific status, while the PR's focused browser regression asserts the repaired state.

Is this the best way to solve the issue?

Yes—the patch records the fact at the shared microphone owner and routes all three transports through the existing callback and one renderer, avoiding transport-specific UI state.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P1: The PR repairs a real user-facing voice-start path that otherwise provides no visible reason while permission remains pending.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate. The source E2E exercises the pending-to-listening browser path, but the prepared screenshots depict an earlier blocked-permission repair rather than the new pending state.

Label justifications:

  • P1: The PR repairs a real user-facing voice-start path that otherwise provides no visible reason while permission remains pending.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate. The source E2E exercises the pending-to-listening browser path, but the prepared screenshots depict an earlier blocked-permission repair rather than the new pending state.

Evidence

What I checked:

  • Current-main gap and introduced repair: Current main's input controller awaits microphone acquisition without publishing a pending/acquired status; the PR adds those two owner-boundary notifications. (ui/src/pages/chat/realtime-talk-input.ts:282, 8ae78b1fb291)
  • Cancellation remains owned by capture lifecycle: The shared media request races cancellation and releases a stream granted after cancellation; the new acquired callback runs only after the current controller has succeeded. (ui/src/pages/chat/realtime-talk-input.ts:205, a1a6c73a4a94)
  • All Talk transports receive the shared phase: WebRTC, Google Live, and Gateway relay each forward the input owner's status to the existing session callback, rather than creating transport-specific UI state. (ui/src/pages/chat/realtime-talk-webrtc.ts:47, a1a6c73a4a94)
  • Visible UI and regression coverage: The renderer produces a visible polite status callout, while tests cover pending-to-listening Chromium flow and cancellation followed by a late microphone grant. (ui/src/e2e/browser-talk-microphone-lifetime.e2e.test.ts:20, a1a6c73a4a94)
  • Feature-history routing: A recent merged Talk lifecycle repair modified the shared input, session, and transport files; it is a routing signal, not introduction attribution for the pre-existing gap. (ui/src/pages/chat/realtime-talk-input.ts:264, c5c6199bc859)
  • Prepared screenshot limitation: The two prepared images show rejected/blocked microphone access from the earlier related repair, not this PR's pending-permission guidance; they do not substantiate the new visual state.

Likely related people:

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

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.

@steipete

Copy link
Copy Markdown
Contributor Author

Maintainer review complete for a1a6c73. The shared microphone owner and single composer status renderer remain the canonical progress path; the +35 production lines provide the missing visible lifecycle guidance. No extra transport-specific state or timeout is introduced. This resolves the review's stated merge-risk decision.

One correction to the screenshot assessment: the images currently embedded in this PR show the actual pending state, not denied permission. The before image has the animated stop control and no visible guidance; the after image visibly says “Waiting for microphone access. Bring this tab to the foreground and allow access if prompted.” Both were inspected, and re-downloaded GitHub assets match the local inspected PNGs byte-for-byte.

The complete candidate has a clean pinned Codex review. Focused owner/sibling tests and both native Chromium scenarios pass; the body includes exact commands and proof limits. Initial CI found a test-file line limit; sharing its repeated peer lookup fixed that without weakening assertions. The 27-test rerun and scoped core lint passed. Final exact-head CI is green: https://github.com/openclaw/openclaw/actions/runs/33321368909

The local shared-dependency typecheck limitation remains documented; no dependency or gate was changed. Native review artifacts validate, and the live branch rules require the now-successful CI gate, not an additional approval. Proceeding through repository-native prepare/merge. Separate Google correlation and delayed-allocation repairs remain tracked in #133351 and #133359.

@steipete
steipete merged commit a8c3e4c into main Aug 30, 2026
165 checks passed
@steipete
steipete deleted the codex/voice-turn-reliability branch August 30, 2026 16:22
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 31, 2026
* fix(ui): explain pending voice microphone access

* test(ui): share WebRTC peer lookup in lifecycle cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

[Bug]: Browser Talk gives no visible guidance while microphone access is pending

1 participant