Skip to content

[FEATURE] Rooms: a member whose agent pins a workspace runs on that computer #1959

Backlog

Description

@edenreich

Summary

Part of #1943. Needs #1954 (PR #1957).

A Markdown agent can pin the computer it runs on with workspace: in its frontmatter, for example drone-editor with workspace: ubuntu-desktop. The Agent tool honours that pin when it spawns a teammate. A room member doesn't: its session room-<room>-<agent> always starts on the daemon's own machine. In a live run, drone-editor answered in #public from a local worker on the laptop, not from its desktop pod, so "edits footage on its own computer" was not true there.

Naming the workspace on the new session isn't enough. A fresh session that names a workspace is relayed to that workspace's existing session, and a Kubernetes workspace never creates a session's Orchestrator on reach (internal/agent/infrastructure/kubernetes/workspace.go, Reach). The member's first turn would fail with "orchestrator ... is gone" instead of running.

Design

Place a pinned member the way the Agent tool places a teammate (internal/tools/subagent_thread.go, place):

  1. The member opens its session on the daemon with resume_conversation, as today.
  2. When the session is new and the agent pins a workspace, the member sends teleport_session with that workspace as the target before the first run_agent_input. The teleport creates the session's Orchestrator and copies the room's project there.
  3. The member waits for session_teleported, or for the teleport to fail. A failure ends the turn with a room note naming the workspace and the reason, and the post stays held.
  4. From then on the session's lease keeps it on its computer, and the registry relays the member's turns there like any other session.

The rooms Host reaches threads only through the thread registry today. It needs the daemon's teleport service passed in from cmd/daemon startThreads, which builds both. Members that aren't pinned, and sessions that already run somewhere, stay as they are.

Open questions

  • When a member's session already runs locally (it answered before its agent got the pin), should the room move it on its next turn or leave it where it is?
  • Which files travel with the first placement: the room project's untracked files, as a teleport from the desktop sends, or only what git tracks?

Out of scope

  • Moving a member that a user teleported by hand. Its lease already decides where it runs.
  • Pinning rooms, rather than agents, to a workspace.

Acceptance Criteria

  • A room member whose agent pins workspace: runs its first turn on that workspace, and later turns follow it there
  • A Kubernetes workspace gets the member's Orchestrator created by the placement, not a "gone" error
  • A placement that fails ends the turn with a room note, and the member's activity leaves running
  • Members without a pin, and members already placed, are untouched
  • docs/rooms.md and docs/subagents.md say that a pinned agent runs on its computer in a room too
  • Tests cover the placement before the first turn, a failed placement and an unpinned member, with the teleport service faked

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Projects

    • Status
      Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions