Repository navigation
Description
Why
Users want to glance at what the agent is doing without it interrupting their own work, the way ChatGPT Atlas shows a live agent view you can watch and take over. The lab already runs on an owned Xvfb that never appears on the desktop, so the only way to see it is a viewer window. Today pickforge watch needs an external VNC client, which is often not installed (none on the dev machine), and TigerVNC cannot scale, so a small window would just be a cropped desktop with scrollbars.
Costs the agent nothing: frames never reach the model. Only host CPU while the viewer is open.
Design
One window with two sizes. Small corner thumbnail, scaled, passive, does not automatically take focus. Click expands it to full size. Expansion consumes the click and never grants control; "Take control" is a separate action that goes through the existing takeover lease (packages/desktop-linux/src/takeover.ts), which restarts x11vnc writable. Flipping noVNC's client-side view-only flag is not control.
Viewer: bundled pinned @novnc/novnc assets served by the CLI on loopback, a Node bridge (node:http, node:net, ws) from WebSocket to the session's x11vnc TCP port, opened with chromium --app=URL (or google-chrome) so the window is chromeless with a stable class; Firefox is an ordinary-window fallback. Keep the existing x11vnc. Do not use -enablehttpproxy, it is HTTP CONNECT support, not WebSockets. Node, not Bun: the published CLI targets Node.
Always-on-top comes from the compositor, never the app (no Wayland API; Tauri, GTK and Chrome PiP silently fail). Hyprland is the tested adapter: install a narrowly matched runtime rule (float, pin, no_initial_focus, size, move) before launch, since no_initial_focus is static and evaluated at window open, and remove only that rule afterwards. Precedent: Omarchy's webcam overlay. Everywhere else ship an ordinary resizable window. Auto-open reuses viewer.mode: auto and stays CLI-only; MCP never launches host GUI.
Revised 2026-09-25 after an independent Astra review. A native Rust viewer (winit + softbuffer + x11rb reading the owned Xvfb, or winit + vnc-rs against x11vnc) is feasible and would remove x11vnc and the browser, but npm installs do not ship the Rust binary and Pickforge would own capture, scaling, cursor composition, keyboard mapping and stuck-button cleanup. Decide on it only after measuring v1 CPU. Tauri/WRY for noVNC is out (drags in GTK and WebKitGTK). Xvfb -fbdir is a later optimization, not a capture shortcut.
Decided 2026-10-03 for the takeover increment: "Take control" starts a second, writable x11vnc on a private Unix socket (-unixsock in a 0700 directory, -rfbport 0), reached only by the controlling bridge connection. The read-only server keeps serving every other watcher, so they never inherit writable access and the thumbnail stays live during control. This replaces restarting the shared x11vnc writable. The lease, watchdog and recovery must also own and stop the writable daemon, so it never outlives its lease.
Checklist
- Bridge security: bind HTTP and WebSocket to 127.0.0.1 explicitly, validate
HostandOrigin, require a random per-session capability token, connect only to the session's recorded VNC endpoint (never an arbitrary destination), serve bundled assets only with a restrictive CSP and no caching, never log the token or frames, bounded buffers and backpressure, compression off. Rejection tests for each. (feat(watch): passive picture-in-picture viewer with bundled noVNC #225) - Add
-noselto x11vnc so clipboards never cross between host and session. (feat(watch): passive picture-in-picture viewer with bundled noVNC #225) - Passive viewer page: noVNC with
viewOnly,scaleViewport=true,resizeSession=false,focusOnClick=false; thumbnail and expanded sizes; expansion consumes the click. (feat(watch): passive picture-in-picture viewer with bundled noVNC #225) - Lifecycle: a supervised bridge that survives CLI exit, stops on session teardown, closes idle connections; a dedicated private browser profile so window ownership is clear (browser process exit does not mean the window closed when launching into an existing browser). (feat(watch): passive picture-in-picture viewer with bundled noVNC #225)
- Launcher: Chromium/Chrome app mode with a stable class; Firefox ordinary-window fallback;
pickforge watchprints the URL when no browser is found. (feat(watch): passive picture-in-picture viewer with bundled noVNC #225) - Hyprland adapter: rule installed before launch and removed after, verified by test; ordinary window elsewhere. Promise "does not automatically take focus", not "never takes focus". (feat(watch): passive picture-in-picture viewer with bundled noVNC #225)
- Benchmarks: idle, scrolling, animation, minimized and closed, recorded in the PR. (feat(watch): passive picture-in-picture viewer with bundled noVNC #225)
- Takeover increment (second PR): "Take control" button routed through the existing lease, permit draining, heartbeat and watchdog; other watchers never inherit writable access; control ends on collapse, disconnect, expiry or viewer failure; explicit return step after secret entry. (feat(takeover): take control in the native viewer, and let agents ask for help #372, through the native viewer from watch: native Rust picture-in-picture viewer #340, as Agent browser you can watch and take over: persistent profiles, native PiP viewer, requested takeover #338 decided)
- Docs,
docs/releases/UNRELEASED.md, tests;bun run typecheck,bun run test,bun run test:coveragegreen. (feat(watch): passive picture-in-picture viewer with bundled noVNC #225)
Non-goals
- Native Rust viewer,
-fbdir, Android streaming, KDE/GNOME pinning guarantees, XWayland fallback promises. Follow-ups after v1 is measured. - Any change to input or capture paths. The real desktop pointer is never touched.
Refs #15 (viewer design), #21 (takeover), #199 (agent cursor overlay).
Activity
ElbertePlinio commentedon Oct 3, 2026
Kickoff notes before implementation. These findings change parts of the design.
--classfor--appwindows. It derives the app_id from the URL host and path plus the profile name, not the port or fragment. Each launch therefore gets a unique page path,/viewer/<launchId>, and the Hyprland rule matches that identity. X11 still honors--class.hyprctl keyword. Runtime rules go throughhyprctl evalandhl.window_rule({name=...}). Lua has no delete, so cleanup disables the named rule; it stays registered until a config reload. The adapter applies only whenhyprctl -j statusreportsconfigProvider: "lua". Hyprlang configs get an ordinary window for now.window.resizeTochanges Chromium's own idea of its size but not the real Hyprland window. Expand and collapse therefore go through a compositor resize from the bridge, withresizeToas the fallback elsewhere.Plan: PR 1 covers the passive viewer,
-nosel, lifecycle, launcher, Hyprland adapter, benchmarks and docs. It refs this issue. The take-control increment stays the second PR.Merge origin/main into feat/207-pip-viewer
chore(watch): allowlist the RFC 6455 sample WebSocket key
ElbertePlinio commentedon Oct 3, 2026
Cursor visibility in the live view moved here from #200 by maintainer decision. The human overlay is the primary lever.
Findings from the #200 design brainstorm:
maimcapture cursor can differ.-nocursorshapeembeds the cursor in VNC framebuffer updates, also for clients that advertise shape support. It does not change the X framebuffer, so it is a safe compatibility option. Keep the loopback and read-only flags.The root cursor capture policy for model frames is #232.
fix(viewer): serialize launch with teardown and clean up on interrupt
fix(watch): report viewer failures and session end accurately
docs(viewer): note that Firefox keeps the window size
fix(watch): repair viewer lifecycle and cursor visibility
fix(viewer): stop an unrecorded browser by its owned group and pin pl…
fix(watch): require evidence before stopping viewer processes
fix(watch): await pending bridge work during shutdown
ElbertePlinio commentedon Oct 3, 2026
Status: PR #225 implements the passive viewer, the first part of this issue. CI is green at b0e9661, and PickCheck and a device pass are done. The PR is open, not merged, and waits on two maintainer decisions.
pickforge-lab watchopens. That needs a human merge decision.The take-control increment (second PR) needs a design decision first. Research recommends a second writable x11vnc on a private Unix socket, used only by the controlling connection, while the read-only server keeps serving other watchers. The design above says to restart x11vnc writable, which would expose writable access to every connected watcher.
Follow-ups filed from this work: #226, #227, #228, #239.
fix(viewer): record the browser pid when its stop is not confirmed
fix(watch): kill surviving owned daemon group members
Merge origin/main into feat/207-pip-viewer
ElbertePlinio commentedon Oct 28, 2026
The take-control increment moves to #341, on a native viewer instead of a second writable x11vnc (owner decision in #338). The noVNC viewer from #225 stays as a watch-only fallback. This issue closes when #341 merges.
ElbertePlinio commentedon Oct 28, 2026
The take-control increment shipped in #372. Per the owner decisions in #338, the native viewer from #340 takes control through the existing human lease instead of a second writable x11vnc. noVNC stays as the watch-only fallback.