Skip to content

fix(ui): prevent Talk E2E audio capture stalls - #138803

Merged
vincentkoc merged 2 commits into
mainfrom
fix/ui-talk-audio-fixture
Sep 7, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/ui-talk-audio-fixture

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 5, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where Control UI Talk E2E cases could stall in a warm Chromium process after an earlier fixture used the browser's native audio stack. This left later Gemini and blocked-camera cases stuck connecting even though talk.client.create succeeded.

Why This Change Was Made

One serializable, profile-driven browser initializer now owns media behavior for ordinary Talk, native-camera Video Talk, and blocked-camera Video Talk fixtures. Audio-only requests receive a fresh deterministic fake stream and idempotent track, fixture pages use only the minimal mocked AudioContext surface, native video capture remains real, and blocked video requests fail before recording a track.

User Impact

No production behavior changes. Talk browser coverage now remains deterministic when the full file shares one warm browser process, while still proving native camera dimensions, permission guidance, and resource cleanup.

Evidence

  • Pre-fix proof: the complete warm-process file passed 8/10; Gemini and blocked-camera cases remained connecting after talk.client.create, while each passed alone.
  • Required warm sequence: OpenAI, Gemini, and blocked-camera passed back-to-back; track states were ended+ended, ended+ended, and ended.
  • Full browser Talk start/stop E2E: 10/10 passed.
  • Browser Talk ordering E2E: 1/1 passed.
  • Talk audio, input, OpenAI WebRTC, and Gemini Live units: 108/108 passed.
  • Native camera proof: OpenAI preview measured 640x480; Gemini streamed a native video frame; previews were removed after stop. Blocked-camera guidance remained actionable with no video track recorded.
  • Formatting, direct oxlint, and git diff --check: passed.
  • tsgo:ui: fixture errors are gone; only four unrelated stale-install assertBeforeRename errors remain in src/infra/install-package-dir.ts.
  • Changed gate: every check through Control UI i18n passed; core test typecheck then reached the same four unrelated errors.
  • Scoped P0-P2 autoreview: clean, no findings.
  • LOC versus 122017f5: production +0/-0; test support +155/-172 (net -17).
  • Signed head: 90fcebcb876714020ee9aa15c2d476b47f1c8147.

Agent Transcript

Redacted Codex session transcript
source: local Codex session
redaction: local paths, credentials, environment details, and unrelated work omitted

[user]
Implement the approved isolated Control UI Talk audio fixture repair from current main. Keep production LOC at zero, prove the current failure, run focused browser and product tests, inspect retained artifacts, review the diff, sign the commit, and open a draft PR.

[assistant]
Created a fresh shared worktree from current main and captured the pre-fix failure: the affected Talk cases stalled before talk.client.create.

[assistant]
Updated the OpenAI Talk fixture so audio-only requests use one AudioContext destination track. Native getUserMedia remains responsible for video and all other requests. Track stop is idempotent and closes the context.

[assistant]
The two affected E2Es passed together. Native camera proof remained 640x480, the preview disappeared after stop, and both tracks ended. The current product surface passed 34/34 tests.

[assistant]
Formatting, direct lint, and diff checks passed. The changed gate reached only the known unrelated stale-install assertBeforeRename type errors. Scoped autoreview reported no P0-P2 findings.

[assistant]
Created signed commit 122017f5c55128b42ce79b56d13cc5de3d0d1658 with production +0/-0 and test-support +25/-1.

@vincentkoc vincentkoc self-assigned this Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 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: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Sep 5, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 9:18 PM ET / September 7, 2026, 01:18 UTC.

ClawSweeper review

What this changes

The PR gives Talk browser tests deterministic microphone streams while preserving native camera capture and checking audio cleanup after camera permission denial.

Merge readiness

✅ Ready for maintainer review

Keep open: the fixture repair remains useful on current main, and no introduced correctness or security defect was found. The prior review contains no outstanding findings.

Priority: P2
Reviewed head: c5baba467a2c314741e22c9143d089a8de6486ef

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused fixture repair with preserved behavioral assertions, reported sequence validation, and no actionable introduced defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored fixture repair is exempt from the external-contributor proof gate. The body reports warm-browser recovery with simulated audio and native camera capture; those results are supplemental validation, not live-provider or physical-microphone proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored fixture repair is exempt from the external-contributor proof gate. The body reports warm-browser recovery with simulated audio and native camera capture; those results are supplemental validation, not live-provider or physical-microphone proof.
Evidence reviewed 7 items Verified scope and current-main necessity: The complete host-pinned introduced patch changes only the two Talk E2E files. Local comparison confirms those files are unchanged between the merge base and fetched main, so main still lacks this repair. The verified test-merge result preserves unrelated base changes.
Fixture behavior and retained assertions: The initializer creates a fresh audio track per request, makes stop idempotent, forwards camera requests to native capture, and rejects blocked camera requests before recording tracks. Existing camera-frame and cleanup assertions remain; the blocked-camera scenario additionally requires its sole audio track to end.
Independent native microphone coverage: The microphone-lifetime suite uses a separate unchanged fixture with native capture and local WebRTC peers. It checks pending permission guidance and injected microphone loss, including ended tracks, closed peers, and removed audio elements. The ordering suite consumes the changed fixture without requiring native audio.
Findings None None.
Security None None.

How this fits together

Control UI Talk tests drive voice and camera controls through Chromium with simulated Gateway and provider responses. Their media fixtures determine which browser resources are real and let tests observe session startup and cleanup.

flowchart TD
  A[Talk browser scenarios] --> B[Shared media fixture]
  B --> C{Requested media}
  C --> D[Deterministic microphone stream]
  C --> E[Native camera or permission denial]
  D --> F[Control UI Talk lifecycle]
  E --> F
  F --> G[Startup and cleanup assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +16, Tests -9. Total +7 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 140 124 +16
Tests 1 16 25 -9
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 156 149 +7

Review metrics

None.

Technical review

Best possible solution:

Keep deterministic media ownership in the shared test initializer while retaining separate native microphone lifecycle coverage and native camera assertions.

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

Unclear independently: the PR identifies a concrete warm-Chromium sequence and reports before/after results, but this read-only review did not execute it.

Is this the best way to solve the issue?

Yes: consolidating fixture-owned audio state is a focused repair, and the existing camera and separate native microphone tests retain meaningful lifecycle coverage.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6df7c32f477a.

Labels

Label justifications:

  • P2: This addresses a bounded browser-test reliability failure without changing production behavior.
  • 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 member-authored fixture repair is exempt from the external-contributor proof gate. The body reports warm-browser recovery with simulated audio and native camera capture; those results are supplemental validation, not live-provider or physical-microphone proof.

Evidence

What I checked:

  • Verified scope and current-main necessity: The complete host-pinned introduced patch changes only the two Talk E2E files. Local comparison confirms those files are unchanged between the merge base and fetched main, so main still lacks this repair. The verified test-merge result preserves unrelated base changes. (ui/src/e2e/browser-talk-start-stop.fixtures.ts:16, 6df7c32f477a)
  • Fixture behavior and retained assertions: The initializer creates a fresh audio track per request, makes stop idempotent, forwards camera requests to native capture, and rejects blocked camera requests before recording tracks. Existing camera-frame and cleanup assertions remain; the blocked-camera scenario additionally requires its sole audio track to end. (ui/src/e2e/browser-talk-start-stop.fixtures.ts:39, c5baba467a2c)
  • Independent native microphone coverage: The microphone-lifetime suite uses a separate unchanged fixture with native capture and local WebRTC peers. It checks pending permission guidance and injected microphone loss, including ended tracks, closed peers, and removed audio elements. The ordering suite consumes the changed fixture without requiring native audio. (ui/src/e2e/browser-talk-microphone-lifetime.e2e.test.ts:95, c5baba467a2c)
  • Reported validation and review continuity: The captured PR body reports the warm-process failure at 8/10 before repair, OpenAI→Gemini→blocked-camera success afterward, 10/10 start/stop cases, 1/1 ordering case, and 108/108 focused units. It identifies an earlier head, 90fcebc; these are contributor-reported results, not executions performed during this review. The previous completed review lists no findings or published rank-up moves. (90fcebcb8767)
  • Current-main history routing: Available main history includes Peter Steinberger's browser-proof and Talk lifecycle work and Vincent Koc's earlier deterministic WebRTC fixture work. These support routing candidates without establishing feature introduction. (ui/src/e2e/browser-talk-start-stop.fixtures.ts, 6df7c32f477a)
  • Release comparison: The latest supplied release, v2026.9.2, still forwards OpenAI fixture microphone requests to native getUserMedia and retains the separate blocked-video fixture; it does not contain the proposed shared initializer. (ui/src/e2e/browser-talk-start-stop.fixtures.ts:16, 3928bad9badf)

Likely related people:

  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: 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.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-05T02:54:43.839Z sha 122017f :: needs maintainer review before merge. :: none
  • reviewed 2026-09-05T03:51:14.737Z sha 90fcebc :: needs maintainer review before merge. :: none
  • reviewed 2026-09-05T04:42:17.540Z sha 90fcebc :: needs maintainer review before merge. :: none
  • reviewed 2026-09-06T22:12:02.913Z sha 90fcebc :: needs maintainer review before merge. :: none

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

The exact head now uses one profile-driven media fixture with fake audio and native or blocked camera behavior, fixing the warm-browser sequence failure.

@clawsweeper

clawsweeper Bot commented Sep 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc
vincentkoc marked this pull request as ready for review September 5, 2026 04:16
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 6, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc
vincentkoc force-pushed the fix/ui-talk-audio-fixture branch from 90fcebc to c5baba4 Compare September 7, 2026 01:12
@vincentkoc
vincentkoc merged commit 7850353 into main Sep 7, 2026
124 checks passed
@vincentkoc
vincentkoc deleted the fix/ui-talk-audio-fixture branch September 7, 2026 01:53
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 7, 2026
…137098

* commit '8a540c252002878f3c3e9d8dfb837b83c8602a78': (2210 commits)
  perf(plugins): keep bundled catalog lookups lightweight (#140597)
  refactor: streamline skills JSON serialization (#140581)
  fix(feishu): expand quoted merged-forward messages (#136231)
  fix(talk): keep opaque realtime routes out of public config (#129144)
  fix(ci): avoid Linux packaging on pull requests (#140589)
  fix(usage): release completed request payloads (#140588)
  fix(tooling): omit Trae machine squash credit (#140562)
  fix(ui): stop catalog paging in hidden tabs (#140583)
  fix(portals): reach IPv6 loopback with IPv4-only localhost records (#140580)
  fix(transcripts): preserve fixed and legacy capture history (#140563)
  fix(ui): prevent Talk E2E audio capture stalls (#138803)
  fix(media): release completed document source buffers (#140561)
  fix(anthropic): preserve resumed CLI caches across Git changes (#140566)
  chore(ui): refresh control ui locales (#140586)
  fix(ui): keep usage exports bound to their session instance (#140573)
  refactor(exa): test response readers through tool execution (#140572)
  fix(macos): omit incompatible worker binaries from app bundles (#140557)
  fix: avoid retaining discarded tool output (#140570)
  refactor(gateway): share placement move matching (#140569)
  fix(gateway): preserve child turns during systemd drain (#140568)
  ...

# Conflicts:
#	.agents/skills/release-openclaw-maintainer/SKILL.md
#	docs/reference/RELEASING.md
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
* fix(ui): stabilize Talk audio fixture

* fix(ui): isolate Talk media fixtures
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: 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.

1 participant