Agents in rooms for front ends without a lasting connection: an MCP
server, whose every tool call is its own request, a webhook, a chat
bot. An agent joins a room on its first call and stays, present and
where it last pointed, between calls; it leaves after :idle
milliseconds with no call (ten minutes), or when told.
{:ok, claude} = Issho.Agents.join(MyApp.Issho, agent, "board:42", on_behalf_of: ada)
{:ok, _snapshot} = Issho.Participant.open(claude, "board:42")
Issho.Participant.place(claude, %{"doc" => "board:42", "at" => %{"node" => "n7"}})join/4 gives the agent's Issho.Participant, the same one each time
for the same actor and room, and starts the idle time again. People
see the agent as they see anyone: its name, its place, its changes.
The agents of a node are found on that node; an MCP endpoint behind a load balancer needs session affinity, or one node for its agents.
Summary
Functions
Returns a specification to start this module under a supervisor.
A value the agent kept in the room, or default.
The agent's participant in the room, joining it on the first call.
Options: those of Issho.join_as/4 (:can, :on_behalf_of,
:claims) and :idle.
Takes the agent out of the room.
The participant of the agent with this key in the room, if it is there.
Keeps a value for the agent in the room, for its later calls (what it copied, what it was asked to remember), until it leaves.
The rooms the agent with this key is in, on this node.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
A value the agent kept in the room, or default.
The agent's participant in the room, joining it on the first call.
Options: those of Issho.join_as/4 (:can, :on_behalf_of,
:claims) and :idle.
Takes the agent out of the room.
The participant of the agent with this key in the room, if it is there.
Keeps a value for the agent in the room, for its later calls (what it copied, what it was asked to remember), until it leaves.
The rooms the agent with this key is in, on this node.