Skip to content

viewer: a version-mismatched watch stops a host that holds live control #371

Open

Description

@ElbertePlinio

Problem

A read-only pickforge-lab watch, or an MCP launch with viewer.mode: "auto", replaces a native viewer host from a different CLI version. If that host holds live human control, stopping it releases the lease, and the human's control ends without warning.

To reproduce:

  1. Take control in the native viewer, or run pickforge-lab watch --control --session <id>.
  2. Upgrade the CLI, or start an MCP server from another version.
  3. Run pickforge-lab watch --session <id>, or call request_takeover from that MCP server.

The new host replaces the old one, and the human's lease ends with "stopping". The result fails closed, so agent input stays safe, but the human loses control in the middle of their work.

Found in the council review of #341. The code is in startNativeViewerHost in packages/desktop-linux/src/viewer-host.ts. Its control path now refuses a live lease before it stops the open host.

Acceptance criteria

  • A version-mismatched read-only start never stops a host that holds a live human lease. It fails with a clear message that names the held control.
  • A version-mismatched host without live control is still replaced as today.

Checklist

  • Refuse the replacement while the open host holds a live lease
  • Tests for both cases

Activity

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