Skip to main content
Let a writer ask a reviewer for help and pick up the reply, without you relaying it. Use it when members need to talk mid-run: a question, a clarification, a second look. When the shape is fixed in advance, a review panel or a writer and a reviewer is simpler. Each member has a name, a role and a brief. A saved message that mentions a member requests that member’s next turn, and the conversation stays in the run’s record, so a fresh executor reads the messages and the turns they requested.

Shape

The conversation

The file uses the stored graph executor and local functions for the two members, so it needs no model account:
examples/team-conversation.ts (excerpt)
The reviewer waits for a question because its initialTurn is false:
examples/team-conversation.ts (excerpt)
task goes to every member, maxTurnsPerMember caps the turns each may take, and communication names the rooms and how many recent messages a member sees on its next turn. Edges stay empty: messages request turns, and edges don’t connect members. The writer sends its question in its successful turn result. mentions holds member IDs; the runtime doesn’t look for names in the text:
examples/team-conversation.ts (excerpt)
The reviewer receives the saved question. Its reply mentions writer, which gives the writer another turn with that reply. To ask for an answer, a member ends its turn: a message is saved with the member’s successful result, not while an engine is still speaking, and a failed or unfinished turn sends nothing. A mention requests a later turn and never interrupts one already running. Several pending mentions for the same member share one queued turn and keep their triggering messages. Every post is checked against room membership before any post from that turn is accepted, so a member can’t post to a room it isn’t in or mention someone outside it.

What the run did

The example writes a temporary record, reopens it inside the program with a fresh executor, and removes its files before exit. Run it with npx tsx team-conversation.ts:
Output
The saved messages, dispatch order and final answers come from the record and the result. The fresh executor adds no events when it reads the completed conversation (replayAddedEvents is false), and the writer’s final answer contains the reviewer’s reply. projectTeamRooms can rebuild each room as a plain text file, one line per accepted message, that people and tools tail like an ordinary chat. This path compiles teamGraphType for the stored executor. It doesn’t create or merge worktrees or run callable review functions for you, so a team result isn’t proof that a merge or review happened. For a callable job with its own workspace and review behaviour, use team(config) as the graph contract describes.
Keep the run record and the room files outside member workspaces, and use the host’s access controls. Room membership controls which posts are accepted and what each member receives; it isn’t a filesystem sandbox, and processes that share unrestricted filesystem access can read the same files.
examples/team-conversation.ts

Next steps

  • Outside graph types: the team form contract, and team(config) for a callable team with its own workspace.
  • Runtime: teamGraphType, TeamDefinition, the turn result and room fields, and projectTeamRooms.
  • The record: where the saved conversation lives and how a fresh executor reads it.