Skip to content

fix(ui): stop Talk microphone polling after session cleanup - #117573

Merged
vincentkoc merged 4 commits into
mainfrom
fix/talk-audio-meter-reentrant-stop-20260801
Aug 1, 2026
Merged

vincentkoc merged 4 commits into
mainfrom
fix/talk-audio-meter-reentrant-stop-20260801

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 1, 2026 •

Copy link
Copy Markdown
Member

Related: #116201

What Problem This Solves

Fixes an issue where stopping a browser Talk session from its first microphone-level update could leave the audio meter's 100 ms polling interval running after the session had released its media resources.

Why This Change Was Made

The shared meter now owns its interval before publishing the initial synchronous level update, so reentrant transport cleanup can always clear the timer. The Google-specific second-stop workaround is removed because WebRTC, gateway relay, Google Live, and composer dictation now share the same lifecycle invariant.

User Impact

Stopped Talk sessions no longer retain a dormant microphone polling interval after reentrant cleanup. Existing microphone activity, stop behavior, and provider behavior remain unchanged.

No provider, config, environment-variable, protocol, SDK, or docs surface changes.

Evidence

  • Refreshed signed head: b71c9b69b1dce0edfb7d2a238fbdc82c77f30503
  • Focused Control UI tests: 109/109 passed across the shared meter, WebRTC, gateway relay, Google Live, and Google Live timeout suites
  • Exact changed gate: https://github.com/openclaw/openclaw/actions/runs/30713402351
  • ClawSweeper reviewed a9849304489353d37dbe36c922cdbec0b6c618fa at 4/6 with no findings or rank-up moves; ordinary maintainer review completed across the shared meter and its callers
  • Final signed refresh merged 71b35c3e1db158b21983fde1e456dd6f0b6b3797; all five touched file blobs were byte-identical before the merge
  • The focused 109/109 suite and scoped format/lint checks passed again on the final refreshed head
  • P1 autoreview: clean, no actionable findings, correctness confidence 0.96
  • Production delta: net -3 lines; the shared owner fix replaces the provider-local workaround

…reentrant-stop-20260801

* origin/main:
  refactor(plugins): consolidate registry snapshots (#117561)
  fix(plugins): fail blocked enable commands (#117536)
  test(secrets): dedupe runtime state fixtures (#117563)
@vincentkoc vincentkoc self-assigned this Aug 1, 2026
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 1, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 1, 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: 🐚 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. P2 Normal backlog priority with limited blast radius. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 3:08 PM ET / 19:08 UTC.

ClawSweeper review

What this changes

The PR makes the browser Talk audio meter create its 100 ms polling interval before the first synchronous level callback, removes a Google Live-specific cleanup guard, and adds reentrant-stop regression tests.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No blocking correctness finding. The shared meter on current main publishes the first microphone level before it owns the polling interval, so a synchronous transport stop can leave that interval alive; this PR moves ownership to the shared lifecycle boundary, deletes the now-redundant Google Live workaround, and covers the shared, WebRTC, and gateway-relay paths. The PR is maintainer-authored and labeled for maintainer handling, so it should remain open for the normal merge decision after the exact-head checks complete.

Priority: P2
Reviewed head: b71c9b69b1dce0edfb7d2a238fbdc82c77f30503

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused shared-owner repair with matching caller regressions and no discrete correctness or security finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-authored Control UI repair, so the external-contributor real-behavior-proof gate does not apply; the PR body records focused lifecycle coverage and the GitHub real-behavior-proof check reports success.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored Control UI repair, so the external-contributor real-behavior-proof gate does not apply; the PR body records focused lifecycle coverage and the GitHub real-behavior-proof check reports success.
Evidence reviewed 6 items Current-main defect: Current main calls the first synchronous level callback before assigning the interval; a callback that stops its owner cannot clear an interval that does not yet exist, and start then installs the orphaned timer.
Shared-owner repair: The PR assigns the interval first and then publishes the initial level, letting the existing stop method clear it during reentrant cleanup; it also removes the Google Live-only second-stop workaround.
Sibling-path coverage: The branch adds focused reentrant-stop coverage for the meter itself and for both WebRTC and gateway-relay transports; all three assert that no fake timers remain after repeated stop calls.
Findings None None.
Security None None.

How this fits together

Browser Talk transports create a shared microphone-level meter after obtaining media input. The meter reports levels to transport callbacks; those callbacks can synchronously stop the session, which must release audio resources and polling before the transport continues setup.

flowchart TD
  A[Browser microphone stream] --> B[Shared Talk audio meter]
  B --> C[Create polling interval]
  C --> D[Publish initial level]
  D --> E[Transport callback]
  E --> F[Session stop and cleanup]
  F --> G[Clear interval and audio nodes]
  B --> H[WebRTC, gateway relay, Google Live, dictation]
Loading

Before merge

  • Complete next step (P2) - No mechanical repair remains; this maintainer-authored, maintainer-labeled PR needs the ordinary final merge decision after the exact-head CI finishes.
Agent review details

Security

None.

PR surface

Source -3, Tests +93. Total +90 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 3 6 -3
Tests 3 93 0 +93
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 96 6 +90

Review metrics

None.

Technical review

Best possible solution:

Keep one shared meter lifecycle invariant: register every cleanup-owned resource before invoking a synchronous callback, retain the focused transport regressions, and merge after the exact head completes its required checks.

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

Yes, from source: configure an initial microphone-level callback to synchronously stop its owning transport; current main then assigns the interval after cleanup, while the branch tests assert the timer count returns to zero.

Is this the best way to solve the issue?

Yes. Moving interval ownership ahead of the synchronous callback fixes the invariant at the shared meter used by WebRTC, gateway relay, Google Live, and dictation, rather than retaining a provider-local recovery guard.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs a bounded browser Talk resource leak that affects stopped sessions but does not indicate data loss, security exposure, or an unavailable core runtime.
  • 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 is a maintainer-authored Control UI repair, so the external-contributor real-behavior-proof gate does not apply; the PR body records focused lifecycle coverage and the GitHub real-behavior-proof check reports success.

Evidence

What I checked:

  • Current-main defect: Current main calls the first synchronous level callback before assigning the interval; a callback that stops its owner cannot clear an interval that does not yet exist, and start then installs the orphaned timer. (ui/src/pages/chat/realtime-talk-audio.ts:163, ebf121af6ab5)
  • Shared-owner repair: The PR assigns the interval first and then publishes the initial level, letting the existing stop method clear it during reentrant cleanup; it also removes the Google Live-only second-stop workaround. (ui/src/pages/chat/realtime-talk-audio.ts:163, b71c9b69b1dc)
  • Sibling-path coverage: The branch adds focused reentrant-stop coverage for the meter itself and for both WebRTC and gateway-relay transports; all three assert that no fake timers remain after repeated stop calls. (ui/src/pages/chat/realtime-talk-webrtc.test.ts:226, b71c9b69b1dc)
  • Caller and base comparison: The meter is used by WebRTC, gateway relay, Google Live, and composer dictation; current main has no changes to the five touched paths after the PR base, so the shared fix still applies to the current behavior. (ui/src/pages/chat/realtime-talk-google-live.ts:216, ebf121af6ab5)
  • Feature provenance: Blame attributes the current ordering at the meter lifecycle boundary to the commit that introduced these lines; the immediately preceding Google Live cleanup refactor is also present in the local path history. (ui/src/pages/chat/realtime-talk-audio.ts:163, dabba0ce108f)
  • Repository policy: Applied the root review and repair doctrine plus the scoped Control UI guide: this is a shared lifecycle-owner fix with focused caller coverage, not a provider-specific workaround. (AGENTS.md:23, ebf121af6ab5)

Likely related people:

  • Vincent Koc: Local history shows the Google Live cleanup refactor, and the current branch’s shared-owner repair follows that lifecycle work. (role: recent Talk lifecycle contributor; confidence: high; commits: b993cf1b9965, b71c9b69b1dc; files: ui/src/pages/chat/realtime-talk-google-live.ts, ui/src/pages/chat/realtime-talk-audio.ts)
  • Peter Steinberger: Blame attributes the current main ordering that publishes before interval assignment to this commit. (role: introduced current meter ordering; confidence: high; commits: dabba0ce108f; files: ui/src/pages/chat/realtime-talk-audio.ts)

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 (1 earlier review cycle)
  • reviewed 2026-08-01T19:01:13.101Z sha a984930 :: needs maintainer review before merge. :: none

…reentrant-stop-20260801

* origin/main:
  fix(openai): keep embedding identity stable across upgrades (#117557)
  fix(googlechat): drop invalid thread resource names before send (#108324)
  fix(skills): preserve profile in ClawHub command hints (#117555)
  fix(cli): explain filtered plugin policy without unsafe recovery (#117556)
  fix(irc): strip markdown from outbound text (#112961)
@vincentkoc
vincentkoc marked this pull request as ready for review August 1, 2026 19:04
@vincentkoc

Copy link
Copy Markdown
Member Author

Maintainer review complete on b71c9b69b1dce0edfb7d2a238fbdc82c77f30503.

Reviewed the shared meter lifecycle, WebRTC, gateway relay, Google Live, and composer callers. No findings. ClawSweeper's 4/6 review had no findings or rank-up moves; the only requested next step was ordinary maintainer review, now complete.

@vincentkoc

Copy link
Copy Markdown
Member Author

Maintainer landing record for the requested no-squash merge:

  • Exact PR head: b71c9b69b1dce0edfb7d2a238fbdc82c77f30503
  • Frozen main parent: 2a5a64b51f5c50974b7bfc35f14e46dc0faa8f0a
  • Signed two-parent merge: 3b70c3535ff5f02e35d7273cd31276146c0b96fb
  • Parents: 2a5a64b51f5c50974b7bfc35f14e46dc0faa8f0a b71c9b69b1dce0edfb7d2a238fbdc82c77f30503

The repo-native prepare and merge verification passed. GitHub rejected the native merge only because merge commits are disabled, so this preserves the reviewed signed history without squashing.

Merged-tree proof:

  • 118/118 focused Talk and dictation tests passed.
  • Scoped oxfmt, git diff --check, and merge signature verification passed.
  • Exact-head full CI passed with required openclaw/ci-gate.
  • ClawSweeper reported no findings or rank-up moves.

@vincentkoc
vincentkoc merged commit 3b70c35 into main Aug 1, 2026
136 of 141 checks passed
@vincentkoc
vincentkoc deleted the fix/talk-audio-meter-reentrant-stop-20260801 branch August 1, 2026 19:28
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
…#117573)

* commit 'a188419da62b3b4bc94e3a029f7a894be047116b':
  test(ui): cover reentrant Talk meter cleanup
  fix(ui): reclaim reentrant Talk audio meters
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 maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

1 participant