Skip to content

[FEATURE] The daemon hosts rooms: post, deliver to members and log their replies #1946

Description

@edenreich

Summary

Third step of rooms (part of #1943): the daemon hosts rooms. It delivers a routed post to each member as that member's next turn, logs the member's answer as its post, and lets clients list, follow and post to rooms over the binding.

Delivery copies the Telegram driving adapter (internal/presentation/telegram/thread.go): one daemon-owned Client per member session sends resume_conversation (with the member's agent, the room's project_dir and its Origin) and run_agent_input through registry.Handle, accumulates the answer until RUN_FINISHED, and detaches on an idle timer. A member on another workspace is reached through the lease relay, as any client's frames are. The service is built in cmd/daemon/daemon.go startThreads after the registry, and its frames get a stage in bindingHandler.Handle before registry.Handle.

Unlike the peer messages of #1942, nothing depends on a sender's worker staying alive: the daemon owns the room, its log and its member clients.

Acceptance Criteria

  • A routed post becomes the member's next turn, carrying the room posts since that member's last turn (up to context_posts), and the member's answer is appended to the log as its post
  • Members routed the same post run in parallel, and a post for a busy member queues as its next turn
  • A member on another workspace is delivered to through the lease relay
  • A member's approval waits in its own chat, and the log notes that the member waits for approval
  • Binding frames: list_rooms answers rooms, follow_room answers room_snapshot then streams room_post and room_activity (a member running, waiting or idle), post_room routes and logs a user post, leave_room stops following
  • infer rooms post <room> "<text>" posts through the daemon and prints the routing
  • The frames are documented in docs/browser-extension-protocol.md, rooms in a new docs/rooms.md and in docs/daemon.md
  • Tests cover post to routing to delivery to the logged reply with the tests/mocks/sessions fakes, plus follow and leave

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions