Skip to content

Nested-display desktop sessions (Xephyr): watch the agent live with its own cursor #15

Closed

Description

@ElbertePlinio

Parent: #17

Goal

Let users watch any running PickLab desktop-capable session in a normal local window without exposing or driving the real desktop, and without the viewer owning the session lifecycle.

Final v1 design

Xvfb remains the only session display. picklab watch lazily ensures a loopback x11vnc server and launches a host-side VNC client. Xephyr is out of scope because it cannot attach to an already-running headless session, lacks a reliable read-only mode, couples the lab to the real seat, and closing its window kills the display.

UX

picklab watch
picklab watch --session <id>
picklab session create --type desktop --viewer

Config:

{
  "viewer": {
    "mode": "manual"
  }
}

Modes: manual (default) and auto. --viewer / --no-viewer are one-shot overrides.

Contract

  • x11vnc always binds loopback and uses -shared -nopw -forever -viewonly for normal observation.
  • Viewer exit never stops x11vnc, Xvfb, or the session.
  • Zero sessions: print a create hint.
  • Multiple desktop-capable sessions: fail closed and require --session.
  • Missing GUI/client: return opened:false, print endpoint plus install/SSH-tunnel guidance, and open no window.
  • MCP may report viewer/session status but never launches a host GUI window.
  • Browser sessions count as desktop-capable.

PR plan

  • PR 1 — VNC safety and CI truthfulness
    • -viewonly by default
    • install/assert x11vnc in CI so tests cannot silently skip
    • exact argv and integration tests
  • PR 3 — Watch UX
    • client detection and host-side launch
    • lazy/idempotent VNC start
    • config and CLI overrides
    • zero/multiple/headless behavior
    • docs and live proof

Validation

  • bun run typecheck
  • focused desktop/CLI/MCP tests
  • bun run test
  • bun run test:coverage
  • bun run build
  • viewer exit leaves session and VNC alive
  • normal viewer cannot inject input
  • one human-observed recording of attaching to an already-running session

No feature flag: current headless behavior stays the default unless the viewer is requested or configured auto.

Current status: In progress
Next: VNC read-only/CI foundation PR.

Activity

  1. ElbertePlinio commented on Jul 10, 2026

    @ElbertePlinio
    MemberAuthor

    Wayland leak fix merged in #16 — lab apps can no longer escape to the real desktop. This issue stays open for the live-viewing nested-display session.

  2. ElbertePlinio commented on Jul 12, 2026

    @ElbertePlinio
    MemberAuthor

    Expanded viewer plan

    This is now PR 1 of the browser computer-use roadmap in #17.

    Add to this slice:

    • picklab watch [--session <id>]
    • MCP viewer open/status tools
    • global/project viewer.mode: off | manual | auto
    • viewer.backend: auto | nested | vnc
    • one-shot --viewer override
    • read-only observation by default
    • preserve current Xvfb/headless behavior when no viewer is requested
    • clear behavior when the Xephyr window is closed mid-session

    Recommended defaults: mode=manual, backend=auto, readOnly=true.

    auto should prefer Xephyr when a host display and binary are available, while VNC remains the remote/headless fallback. Human takeover/pause coordination stays in the later supervision slice of #17.

    Current status: Planned
    Next: implementation plan and tests for the viewer lifecycle.

  3. ElbertePlinio commented on Jul 12, 2026

    @ElbertePlinio
    MemberAuthor

    Implementation started:

    • PR 1: VNC read-only default and CI prerequisite truthfulness
    • PR 3 watch UX follows after the foundation merges

    Branch: fix/vnc-viewonly-ci
    Current status: In progress

  4. ElbertePlinio commented on Jul 12, 2026

    @ElbertePlinio
    MemberAuthor

    PR 1 opened: #23

    • VNC read-only default
    • CI installs/asserts x11vnc
    • Full local validation green
    • Automatic Codex review and CI
    • PR 3 picklab watch after foundation review

    Current status: In review

  5. ElbertePlinio commented on Jul 12, 2026

    @ElbertePlinio
    MemberAuthor

    PR 1 review update (#23):

    • CI green on current HEAD
    • Codex review clean on current HEAD
    • Normal VNC is server-enforced read-only
    • Explicit --vnc-control preserves human secret entry with clear no-coordination warning

    Current status: PR 1 review-clean, left open (not merged)
    Next: complete PR 3 picklab watch.

  6. ElbertePlinio commented on Jul 12, 2026

    @ElbertePlinio
    MemberAuthor

    Progress update:

    Current status: In progress
    Next: implement the live watch flow from updated main.

  7. ElbertePlinio commented on Jul 12, 2026

    @ElbertePlinio
    MemberAuthor

    PR 3 implementation restarted from merged PR #23:

    • picklab watch resolution and lazy VNC
    • host viewer detection/launch and headless guidance
    • manual/auto config and creation overrides
    • focused lifecycle/read-only tests
    • live attach/close proof and PR review

    Current status: In progress
    Next: complete the PR-ready watch slice.

  8. ElbertePlinio commented on Jul 12, 2026

    @ElbertePlinio
    MemberAuthor

    Progress update:

    • Rebased watch branch onto current main; merged PR fix(desktop): make VNC observation read-only #23 commits dropped
    • Added desktop-capable resolution and lazy read-only VNC reuse
    • Added host viewer detection/launch, headless guidance, and lifecycle isolation
    • Added manual/auto config plus creation overrides
    • Added CLI watch and MCP status/resource reporting without GUI launch
    • Focused core, desktop, CLI, and MCP tests pass
    • Typecheck passes
    • Human-observed real viewer attach/close recording

    Current status: implementation complete, awaiting parent review
    Next: parent review and live proof before PR.

  9. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    Live watch PR opened: #30

    • Rebased onto merged browser lifecycle
    • Full suite: 65 files, 737 passed / 2 skipped
    • Real x11vnc + TigerVNC attach/close proof
    • Serious current-head workflow review
    • Browser teardown lock race fixed and independently verified
    • Required CI
    • Merge

    Current status: In review
    Next: merge only after current-head CI is green.

  10. ElbertePlinio commented on Jul 13, 2026

    @ElbertePlinio
    MemberAuthor

    PR #30 merged at ad4d177 after current-head CI passed.

    • picklab watch and viewer config/overrides
    • Server-enforced read-only, loopback VNC
    • Viewer close leaves session/VNC/Xvfb alive
    • PID-identity-safe ensure/destroy locking
    • Full local and hosted validation
    • Serious local workflow review

    Current status: Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions