Repository navigation
feat(desktop): isolate managed Linux application audio - #157720
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 25, 2026, 10:42 AM ET / 14:42 UTC (Revision 9). ClawSweeper reviewWhat this changesAdds a private PulseAudio output and on-demand PCM capture to Gateway-managed Linux desktops, with fallback and recovery for audio failures. Merge readiness⛔ Blocked before merge - 4 items remain Current main lacks the native capture layer, so this PR remains useful. The prior review’s compatibility concern remains: successful private audio startup replaces an existing application-audio route without a recorded owner decision or upgrade proof. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway starts and supervises a Linux VNC desktop, then supplies its environment to desktop applications and computer-control leases. This layer adds a private audio source for a later viewer transport. flowchart LR
A[Managed desktop request] --> B[Gateway desktop owner]
B --> C{Private audio ready?}
C -->|Yes| D[Private output for applications]
C -->|No| E[Inherited audio route]
D --> F[On-demand PCM capture]
B --> G[VNC screen and computer leases]
Decision needed
Why: The patch changes an operator-supplied route on upgrade, and the feature request does not establish the intended default for those installations. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +456, Tests +647. Total +1103 across 4 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep private capture within the managed desktop owner while preserving an existing operator audio route by default; provide an explicit private-output choice and prove fresh-install and upgrade behavior. Do we have a high-confidence way to reproduce the issue? Yes, from source: configure an inherited PULSE_SERVER on a managed Linux desktop with private-audio dependencies installed; current main passes it through, while this patch overlays it. This read-only review did not execute the path. Is this the best way to solve the issue? No final routing choice is established. The private sink fits the managed desktop owner, but preserving an operator-supplied route until explicit selection is the safer upgrade path. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9e5c2e245841. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
57f8429 to
8ce398f
Compare
|
Addressed the unavailable-audio routing finding in 8ce398f. The desktop retains inherited PULSE routing until private audio actually becomes ready. The selected generation environment is shared by D-Bus activation, XFCE and computer leases; restarting into an unavailable-audio generation cannot reuse the old private route. Capture remains private-only and is not exposed for the fallback. No new configuration mode was added. Verification: 54 focused tests and core typecheck passed; all five selected regressions fail on the original producer. Real VNC/Pulse/D-Bus/XFCE ordering, deterministic missing-binary fallback and native Chromium remote-tone playback also passed: https://github.com/openclaw/openclaw/actions/runs/36075335961 . Descendants were rebased in order, retaining the same seven PRs. No merge or deployment. |
57c1d84 to
e5a0cf9
Compare
8ce398f to
dd2592c
Compare
dd2592c to
d072da8
Compare
d072da8 to
c09a483
Compare
c09a483 to
22b0cb4
Compare
|
The required model-discovery failure was traced to the synthetic merge input, not the audio delta. The fixture returned learned models without recording a successful discovery outcome; main’s retention change exposed that missing provenance. The owning fix is already merged in #158115 ( I reproduced the exact line-187 failure on the failed source, then passed the same focused command with only that landed fixture change. That local causal replay used Node 26 rather than CI’s Node 24; the owning repair’s hosted lifecycle/freshness checks also passed. No assertions were removed and no audio/model production workaround was added. The stack now incorporates the fixed main state. |
Preserve the catalog publication behavior deadline by preparing the lazy Gateway module in suite setup. Restore the focused fixture change from ec66ba9 after it was removed to keep the cron performance PR scoped. Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
22b0cb4 to
4ca90d0
Compare
|
Merged via squash.
|
* commit '54b5f23b006ae917c8bb7903f5ee7dad6108ec25': (194 commits) feat(ui): listen to managed desktop audio in the panel (#157724) fix(ci): resume partially published preparation receipts (#158174) feat(release): one approval per release via an attested parent approval receipt (#157911) feat(desktop): advertise current managed desktop audio (#157723) fix(ui): retain delayed progress scroll gestures (#158153) refactor(ui): share sidebar mutation error feedback (#158173) test: await database verifier process lifecycle events (#158171) perf(update): avoid repeated retained-copy parent creation feat(desktop): bind audio streaming to screen authorization (#157722) refactor(gateway): split companion prompts and metadata fixtures (#158050) feat(desktop): isolate managed Linux application audio (#157720) fix(test): prepare catalog fixture modules before startup (#158157) fix: keep model pickers usable during provider sign-in (#158132) refactor(test): remove unused prompt scenario metadata (#158151) fix(ci): unblock Control UI targeted Crabbox gates (#158149) refactor(agents): deslop subagents, sessions, worktrees, commands and auth (#158020) fix: bound stalled browser stream startup (#156323) fix(onnx): prevent worker fixture hangs after release (#158146) fix(models): preserve scoped provider discovery outcomes (#158139) fix(agents): report offline trash failures after agent delete (#158052) ...
* commit '54b5f23b006ae917c8bb7903f5ee7dad6108ec25': (175 commits) feat(ui): listen to managed desktop audio in the panel (#157724) fix(ci): resume partially published preparation receipts (#158174) feat(release): one approval per release via an attested parent approval receipt (#157911) feat(desktop): advertise current managed desktop audio (#157723) fix(ui): retain delayed progress scroll gestures (#158153) refactor(ui): share sidebar mutation error feedback (#158173) test: await database verifier process lifecycle events (#158171) perf(update): avoid repeated retained-copy parent creation feat(desktop): bind audio streaming to screen authorization (#157722) refactor(gateway): split companion prompts and metadata fixtures (#158050) feat(desktop): isolate managed Linux application audio (#157720) fix(test): prepare catalog fixture modules before startup (#158157) fix: keep model pickers usable during provider sign-in (#158132) refactor(test): remove unused prompt scenario metadata (#158151) fix(ci): unblock Control UI targeted Crabbox gates (#158149) refactor(agents): deslop subagents, sessions, worktrees, commands and auth (#158020) fix: bound stalled browser stream startup (#156323) fix(onnx): prevent worker fixture hangs after release (#158146) fix(models): preserve scoped provider discovery outcomes (#158139) fix(agents): report offline trash failures after agent delete (#158052) ...
* fix(qa-lab): retain tab focus and scroll during polling * chore(qa-lab): merge main for tab navigation validation * fix(qa-lab): keep focused tabs visible after layout changes * fix(qa-lab): reconcile navigation retention with current app * chore: refresh main for QA Lab navigation validation * commit '54b5f23b006ae917c8bb7903f5ee7dad6108ec25': (194 commits) feat(ui): listen to managed desktop audio in the panel (#157724) fix(ci): resume partially published preparation receipts (#158174) feat(release): one approval per release via an attested parent approval receipt (#157911) feat(desktop): advertise current managed desktop audio (#157723) fix(ui): retain delayed progress scroll gestures (#158153) refactor(ui): share sidebar mutation error feedback (#158173) test: await database verifier process lifecycle events (#158171) perf(update): avoid repeated retained-copy parent creation feat(desktop): bind audio streaming to screen authorization (#157722) refactor(gateway): split companion prompts and metadata fixtures (#158050) feat(desktop): isolate managed Linux application audio (#157720) fix(test): prepare catalog fixture modules before startup (#158157) fix: keep model pickers usable during provider sign-in (#158132) refactor(test): remove unused prompt scenario metadata (#158151) fix(ci): unblock Control UI targeted Crabbox gates (#158149) refactor(agents): deslop subagents, sessions, worktrees, commands and auth (#158020) fix: bound stalled browser stream startup (#156323) fix(onnx): prevent worker fixture hangs after release (#158146) fix(models): preserve scoped provider discovery outcomes (#158139) fix(agents): report offline trash failures after agent delete (#158052) ... Co-authored-by: Vincent Koc <[email protected]>
* fix(test): prepare catalog fixture modules before startup Preserve the catalog publication behavior deadline by preparing the lazy Gateway module in suite setup. Restore the focused fixture change from ec66ba9 after it was removed to keep the cron performance PR scoped. Co-authored-by: vincentkoc <[email protected]> * feat(desktop): isolate managed Linux application audio Co-authored-by: vincentkoc <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: vincentkoc <[email protected]>
) * fix(qa-lab): retain tab focus and scroll during polling * chore(qa-lab): merge main for tab navigation validation * fix(qa-lab): keep focused tabs visible after layout changes * fix(qa-lab): reconcile navigation retention with current app * chore: refresh main for QA Lab navigation validation * commit '0001f441f53712e44b2ca6edf2a6752b8abd6d1d': (194 commits) feat(ui): listen to managed desktop audio in the panel (openclaw#157724) fix(ci): resume partially published preparation receipts (openclaw#158174) feat(release): one approval per release via an attested parent approval receipt (openclaw#157911) feat(desktop): advertise current managed desktop audio (openclaw#157723) fix(ui): retain delayed progress scroll gestures (openclaw#158153) refactor(ui): share sidebar mutation error feedback (openclaw#158173) test: await database verifier process lifecycle events (openclaw#158171) perf(update): avoid repeated retained-copy parent creation feat(desktop): bind audio streaming to screen authorization (openclaw#157722) refactor(gateway): split companion prompts and metadata fixtures (openclaw#158050) feat(desktop): isolate managed Linux application audio (openclaw#157720) fix(test): prepare catalog fixture modules before startup (openclaw#158157) fix: keep model pickers usable during provider sign-in (openclaw#158132) refactor(test): remove unused prompt scenario metadata (openclaw#158151) fix(ci): unblock Control UI targeted Crabbox gates (openclaw#158149) refactor(agents): deslop subagents, sessions, worktrees, commands and auth (openclaw#158020) fix: bound stalled browser stream startup (openclaw#156323) fix(onnx): prevent worker fixture hangs after release (openclaw#158146) fix(models): preserve scoped provider discovery outcomes (openclaw#158139) fix(agents): report offline trash failures after agent delete (openclaw#158052) ... Co-authored-by: Vincent Koc <[email protected]>
* fix(ui): release failed avatar response bodies * test(ui): cover avatar response cancellation in Chromium * test(ui): assert retained image after avatar failure * test(ui): preserve window global type in avatar proof * test(ui): avoid shadowed avatar proof bindings * chore: refresh main for avatar lifecycle validation * commit '54b5f23b006ae917c8bb7903f5ee7dad6108ec25': (175 commits) feat(ui): listen to managed desktop audio in the panel (#157724) fix(ci): resume partially published preparation receipts (#158174) feat(release): one approval per release via an attested parent approval receipt (#157911) feat(desktop): advertise current managed desktop audio (#157723) fix(ui): retain delayed progress scroll gestures (#158153) refactor(ui): share sidebar mutation error feedback (#158173) test: await database verifier process lifecycle events (#158171) perf(update): avoid repeated retained-copy parent creation feat(desktop): bind audio streaming to screen authorization (#157722) refactor(gateway): split companion prompts and metadata fixtures (#158050) feat(desktop): isolate managed Linux application audio (#157720) fix(test): prepare catalog fixture modules before startup (#158157) fix: keep model pickers usable during provider sign-in (#158132) refactor(test): remove unused prompt scenario metadata (#158151) fix(ci): unblock Control UI targeted Crabbox gates (#158149) refactor(agents): deslop subagents, sessions, worktrees, commands and auth (#158020) fix: bound stalled browser stream startup (#156323) fix(onnx): prevent worker fixture hangs after release (#158146) fix(models): preserve scoped provider discovery outcomes (#158139) fix(agents): report offline trash failures after agent delete (#158052) ... * test(ui): wait for settled avatar fallback * test(ui): wait for control UI before avatar handoff * fix(ui): preserve avatar cleanup across retry lifecycle updates Integrate current main while preserving retry exhaustion, auth restoration, and deferred response cleanup. Keep the real-stream test on real timers and drain loader cleanup before restoring shared test state. * fix(ui): integrate avatar response cleanup with current main * test(ui): align avatar cleanup proof with current harness * test(ui): qualify avatar cleanup harness types and formatting Co-authored-by: Vincent Koc <[email protected]>
* fix(ui): release failed avatar response bodies * test(ui): cover avatar response cancellation in Chromium * test(ui): assert retained image after avatar failure * test(ui): preserve window global type in avatar proof * test(ui): avoid shadowed avatar proof bindings * chore: refresh main for avatar lifecycle validation * commit '0001f441f53712e44b2ca6edf2a6752b8abd6d1d': (175 commits) feat(ui): listen to managed desktop audio in the panel (openclaw#157724) fix(ci): resume partially published preparation receipts (openclaw#158174) feat(release): one approval per release via an attested parent approval receipt (openclaw#157911) feat(desktop): advertise current managed desktop audio (openclaw#157723) fix(ui): retain delayed progress scroll gestures (openclaw#158153) refactor(ui): share sidebar mutation error feedback (openclaw#158173) test: await database verifier process lifecycle events (openclaw#158171) perf(update): avoid repeated retained-copy parent creation feat(desktop): bind audio streaming to screen authorization (openclaw#157722) refactor(gateway): split companion prompts and metadata fixtures (openclaw#158050) feat(desktop): isolate managed Linux application audio (openclaw#157720) fix(test): prepare catalog fixture modules before startup (openclaw#158157) fix: keep model pickers usable during provider sign-in (openclaw#158132) refactor(test): remove unused prompt scenario metadata (openclaw#158151) fix(ci): unblock Control UI targeted Crabbox gates (openclaw#158149) refactor(agents): deslop subagents, sessions, worktrees, commands and auth (openclaw#158020) fix: bound stalled browser stream startup (openclaw#156323) fix(onnx): prevent worker fixture hangs after release (openclaw#158146) fix(models): preserve scoped provider discovery outcomes (openclaw#158139) fix(agents): report offline trash failures after agent delete (openclaw#158052) ... * test(ui): wait for settled avatar fallback * test(ui): wait for control UI before avatar handoff * fix(ui): preserve avatar cleanup across retry lifecycle updates Integrate current main while preserving retry exhaustion, auth restoration, and deferred response cleanup. Keep the real-stream test on real timers and drain loader cleanup before restoring shared test state. * fix(ui): integrate avatar response cleanup with current main * test(ui): align avatar cleanup proof with current harness * test(ui): qualify avatar cleanup harness types and formatting Co-authored-by: Vincent Koc <[email protected]>
Related: #157667
Desktop audio stack 2/7. Depends on #157718. Review against the immediate base branch; do not land out of order.
What Problem This Solves
Managed Linux desktops need an isolated application-output source instead of sharing the host audio environment.
User Impact
Desktop apps receive a private PulseAudio output device when optional dependencies are installed. Missing audio dependencies or private startup failure keep the screen usable and preserve the inherited application-audio route; no host fallback capture is exposed. This layer does not yet provide browser listening.
Why This Change Was Made
Provision the private null sink before desktop apps and couple its lifetime to the managed desktop. Start bounded parec capture only on request; retire recordings and stale sources on abort, restart or teardown.
Evidence
CI prerequisite: #158157 isolates the verified catalog-publication fixture preparation fix. It preserves all behavior assertions and the 60-second deadline. The remaining six audio patches are unchanged and now stack on that prerequisite so checks can run in parallel; the prerequisite must land first.
Final recovery boundary repair: optional audio has its own three-retries/five-minutes budget. Exhaustion or unrecoverable audio disables capture with guidance while healthy desktop processes, applications and leases stay alive; actual desktop failures retain their independent budget. Cached observations during incomplete generation startup reject with retry guidance before minting grants. Final proof: 91 tests, core/Gateway test types, lint/format and fresh P0–P2 review passed. Four real owned-daemon SIGKILLs preserved all original desktop/application PIDs and lease; first recovery restored 440.413Hz PCM in 291ms. Three regressions fail on the prior producer.
Final local validation
Final frozen-source proof: 82 backend/protocol tests + 127 UI tests passed; all 30 topic TypeScript files have zero lint errors/warnings. Core/UI and relevant test type graphs, formatter and scoped P0–P2 autoreview passed. Canonical generation, keyless i18n and docs proof passed in the preceding repair run.
The final changes carry live viewer authority into native recorder admission and startup settlement, preserve inherited application routing when private setup fails, expose only a sanitized setup code, and clean up socket/PCM listeners through their existing owners. The same seven PR boundaries are retained; final assembled tree hashes match the tested source. Historical per-layer/build/native results below are not claims of current-head hosted CI. Hosted CI has resumed; current-head check results and review remain separate gates.
node scripts/run-vitest.mjs src/gateway/desktop/managed-linux-audio.test.ts src/gateway/desktop/managed-linux.test.ts --maxWorkers=1The assembled candidate passed the packaged build and an isolated token-authenticated Gateway smoke test: readiness HTTP 200; ticketless desktop/audio upgrades HTTP 401; clean shutdown. Native playback proof uses actual production capture/transport/panel through a minimal demo RPC adapter—not an authorized end-to-end playback test through the built Gateway.
Scope: managed Linux Gateway desktops only; no cloud-worker, paired-node, external VNC, macOS or Windows capture. Uncompressed stereo costs about 1.5 Mbit/s while listening; no A/V synchronization or microphone uplink. Actual Safari/iOS and tarball installation remain unverified. No shared Gateway deployment is included. Ordered landing is now authorized.
Requested by @vincentkoc.
Work sessions