Repository navigation
feat(desktop): bind audio streaming to screen authorization - #157722
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: needs real behavior proof before merge. Reviewed September 25, 2026, 10:39 AM ET / 14:39 UTC (Revision 8). ClawSweeper reviewWhat this changesAdds a one-use desktop audio WebSocket that starts managed Linux PCM capture after screen authentication and stops it when the screen observation ends. Merge readiness⛔ Blocked before merge - 6 items remain Keep open. This remains a distinct layer of the active desktop-audio stack; the route is absent from current main. The earlier native recorder-admission concern appears addressed, but the audio ticket holder boundary and final-effect authority proof remain unresolved. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway issues tickets for authorized desktop observation and upgrades a ticket into an RFB screen connection. This branch adds a second ticket that can start a managed Linux audio recorder and stream PCM while the screen observation remains active. flowchart LR
A[Authorized observe request] --> B[Screen and audio tickets]
B --> C[RFB screen authentication]
B --> D[Audio ticket redemption]
C --> E{Viewer authority current?}
D --> E
E -->|yes| F[Native audio recorder]
F --> G[PCM stream]
E -->|no| H[Reject or stop audio]
Decision needed
Why: The existing ticket pattern establishes requester liveness, while this new audio URL can convey remote application sound to its holder. Whether bearer delegation is acceptable is a desktop security-contract choice. Before merge
Findings
Agent review detailsSecurityNeeds attention: Audio is tied to screen lifetime, but bearer-only ticket redemption leaves the separate listener identity unsettled. PR surfaceSource +293, Tests +449. Total +742 across 5 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: 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: Use one screen-owned audio grant lifecycle with an explicit redeemer policy, and enforce that policy at recorder admission and PCM delivery without adding persistent grant state. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds a new route rather than reporting a broken existing behavior. The different-holder scenario is traceable in source but has not been observed through the assembled Gateway. Is this the best way to solve the issue? Unclear: the branch uses the existing observer and ticket owners and rechecks native admission, but the intended audio-ticket holder contract must be settled before the approach is complete. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 168d454d32c8. LabelsLabel changes: No label changes. Label justifications:
EvidenceSecurity concerns:
What 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 (7 earlier review cycles)
|
57f8429 to
8ce398f
Compare
9b3680e to
1285793
Compare
8ce398f to
dd2592c
Compare
1285793 to
c98ae27
Compare
|
Addressed recorder-admission authority in c98ae27. The bridge passes its live viewer/generation assertion into the managed source; native supervisor admission and startup settlement recheck it, in addition to desktop/abort and output checks. A bridge-to-native-admission regression denies a revoked requester without requiring an abort event. The persistent-migration classification is a false positive: these grants use the existing in-memory ticket store, with no database or durable-state schema change. Proof: 82 backend/protocol and 127 UI tests, type-aware lint on all 30 topic files, types, and P0–P2 review passed: https://github.com/openclaw/openclaw/actions/runs/36078886108 . No merge/deployment; hosted CI remains a separate gate. |
dd2592c to
d072da8
Compare
c98ae27 to
c43aaab
Compare
d072da8 to
c09a483
Compare
c43aaab to
41c7049
Compare
c09a483 to
22b0cb4
Compare
41c7049 to
229ae7c
Compare
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]>
Co-authored-by: vincentkoc <[email protected]>
22b0cb4 to
4ca90d0
Compare
229ae7c to
2d84cbc
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]>
…#157722) * 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]> * feat(desktop): bind audio streaming to screen authorization 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 3/7. Depends on #157720. Review against the immediate base branch; do not land out of order.
What Problem This Solves
An audio side channel must not bypass or outlive the authenticated desktop screen.
User Impact
Registers the ticketed audio route and its screen-observation lifecycle. Host audio capabilities are not advertised until the next layer; unknown or missing tickets are refused.
Why This Change Was Made
Connect audio grants to RFB preauthentication, screen closure, expiry, abandonment and requester authority. Serialize capture transitions, compose live viewer authority into native capture admission, settle unexpected stream closure, and bound slow-reader buffering. The grant store is in-memory; this PR changes no persistent storage schema.
Evidence
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/audio-bridge.test.ts src/gateway/desktop/audio-observe.integration.test.ts src/gateway/desktop/observe-bridge.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 deployment or merge is included.
Requested by @vincentkoc.
Work sessions