desktop icon indicating copy to clipboard operation
desktop copied to clipboard

Stream: option to composite the remote cursor into the framebuffer (spectator-visible pointer)

Open magicmikek opened this issue 3 months ago • 3 comments

Problem

When streaming a desktop sandbox to spectators (users watching an AI agent work), the agent's mouse pointer is invisible on the stream.

Cause: getVNCCommand() starts x11vnc with default cursor handling, so the cursor is delivered via the cursor-shape pseudo-encoding. VNC clients render that shape at the viewer's own pointer position. A remote pointer moved programmatically (e.g. sandbox.moveMouse() / clicks from a computer-use agent) is therefore never drawn for a viewer who isn't moving their own mouse — which is exactly the spectator case that stream.start() + view-only embedding is used for.

For computer-use products this matters a lot: the whole point of the live stream is to watch the agent operate, and the pointer is the main thing to follow.

Proposal

Expose a cursor mode on the stream options, e.g.:

await sandbox.stream.start({ requireAuth: true, cursor: 'composite' })

which appends -nocursorshape to the x11vnc command in getVNCCommand(). With that flag, x11vnc composites the cursor into the framebuffer updates, so every viewer sees the remote pointer at its true position, moving and clicking. Default stays 'shape' (current behavior).

It's a small change — the command is built in one place:

return `x11vnc -bg -display ${this.desktop.display} -forever -wait 50 -shared -rfbport ${this.vncPort} ${pwdFlag} ...`

Current workaround

After stream.start(), we kill the SDK's x11vnc and re-run the same command with -nocursorshape appended. It works, but it duplicates SDK internals (display, port, auth flag) and will drift if those change — hence this request.

Happy to send a PR if you'd take one.

magicmikek avatar Aug 16 '26 19:08 magicmikek

Hey there, good find, feel free to submit a PR :)

mishushakov avatar Aug 17 '26 17:08 mishushakov

I will take this issue. Please assign it to me.

modelpath-dev avatar Sep 11 '26 13:09 modelpath-dev

@mishushakov a PR has been submitted #1814, could you have a look

Deep-Axe avatar Oct 02 '26 07:10 Deep-Axe