Skip to content

feat(rooms): a member whose agent pins a workspace runs on that computer - #1977

Open
edenreich wants to merge 1 commit into
mainfrom
feat/room-member-workspace
Open

edenreich wants to merge 1 commit into
mainfrom
feat/room-member-workspace

Conversation

@edenreich

Copy link
Copy Markdown
Contributor

Summary

Closes #1959. Part of #1943.

A Markdown agent can pin the computer it runs on with workspace: in its frontmatter. The Agent tool honoured that pin for a teammate, but a room member always ran on the daemon's own machine. Now a pinned member runs on its computer in a room too.

  • Before the first turn of a member's new session, the member opens the session with resume_conversation as before, reads its MESSAGES_SNAPSHOT, and when the session is new and its agent pins a workspace, teleports it there before the turn's run_agent_input goes out. That is the move the Agent tool makes for a teammate (subagentThread.place), so the teleport creates a Kubernetes workspace's Orchestrator instead of failing a relay with "gone". Later turns follow the session's lease there.
  • A placement that fails notes <member> could not reach its computer <workspace>: <reason> in the room. The member goes idle without running, and the post stays first in line, with the posts it would have quoted, so the next turn places it again.
  • Untouched: members whose agent pins nothing keep their turn as it was, and a session that already holds messages - it answered before its agent named the workspace - stays where it runs. A /stop during the placement ends the turn, which the placement then does not send.
  • Ports: rooms names a Placer func, (ctx, projectDir, sessionID, workspace) error. The teleport service implements it as Service.Place, which runs the existing startTeleport saga with a requester that reports the first outcome - session_teleported, a failed teleport_progress or a RUN_ERROR. cmd/daemon passes teleports.Place to rooms.NewHost, so the rooms context never reaches into the teleport context's types.
  • The agent catalog (tools.ProjectAgents, agentdomain.SubagentInfo) carries each agent's workspace.
  • docs/rooms.md and docs/subagents.md say that a pinned agent runs on its computer in a room too.

The issue's open questions

  • A session that already runs locally stays there, as the design's "sessions that already run somewhere stay as they are" and the acceptance criteria say.
  • The first placement sends what the Agent tool sends - no files list - so a room member and a teammate move the same way.

Verification

  • internal/rooms/placement_test.go, with the placer faked: placement before the first turn and none on the next, a failed placement (room note, idle activity, the held post going first on the next turn), a session that already answered, and an unpinned member.
  • internal/agent/teleport/place_test.go: how Place reads each teleport answer, and a placement on an unknown workspace returning why.
  • tests/e2e/rooms_test.go runs two daemons: a room on A seats an agent pinned to workspace B, a post through A gets the member's answer in the room, and B holds the member's session with that answer. On a main build the test fails - the member answers from A and nothing lands on B - and it passes on this branch.
  • task precommit:run, and the teleport, daemon and rooms e2e tests.
  • Not run against a Kubernetes workspace. The placement is the teleport the Agent tool's placement uses.

Cross-repo impact

- Before the first turn of its new session, a member whose agent names a workspace is teleported there, as the Agent tool places a teammate
- A placement that fails notes it in the room, and the member goes idle with the post held for its next turn
- A session that already answered stays where it runs, and members without a pin are untouched
- The teleport service places a session with Place, which the daemon hands the rooms Host as its Placer
- The agent catalog carries each agent's workspace pin
@edenreich
edenreich requested a review from a team as a code owner November 27, 2026 17:44
@github-project-automation github-project-automation Bot moved this to Todo in 2026 Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

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

1 participant