Graph Proposals and Replies
How a /graph request becomes an approved graph, and how each chat reply reaches the proposal, question, or output that waits for it.
Graph proposals turn a /graph request into an execution graph only once the user approves an exact version, and reply routing sends each chat message to the one graph item that waits for it. Both decide with read-only utility runs on the Run Worker, each holding a session status lease. Agentty implements them in its app layer; ag-protocol defines the proposal schema and ag-session its resolution.
Connections🔗
flowchart TD
R["/graph request"] -->|generation run| V[Proposal version]
M[Chat message] --> O[Waiting item it answers]
O -->|proposal| PD[Decision run]
O -->|node question| Q[Node continuation]
O -->|output| OD[Decision run]
M -->|nothing waits, or orchestrated| C[Ordinary or orchestrator turn]
PD -->|approve, revise, cancel| V
V -->|approved| G[Execution Graph]
OD -->|accept or revise| G
Q --> GGeneration🔗
- The host captures the request, the agent catalog, the model, the permission ceiling, and
GraphProposalLimits: 16 nodes, 32 edges, 65,536 bytes, 3 generations of 3 provider calls each, and 48 calls for the graph. - A generation run answers with 1 to 5 clarification questions or one complete proposal. Host resolution, not the model, rejects unsupported profiles and permission escalation, allocates identities, binds Envs, and validates the graph.
- Approving an exact version publishes its resolved snapshot and limits in one transaction before dispatch; restoring a proposal or repeating an approval never replenishes limits or starts execution.
- The generation run sees at most eight candidate graphs to extend: graphs an approved proposal launched that can still be resumed, completed ones included, the newest that can still run first, each under a handle such as
graph-2with its revision and withdrawn nodes marked. A proposal names atarget, a new labeled graph or one candidate at the revision it was shown. The host never guesses: an unknown graph, another revision, or a missing target while candidates exist becomes a clarification question, and approval re-resolves the same target.
Reply Order🔗
The pending proposal, node questions, and outputs awaiting acceptance can wait at once, across all of a session's graphs. Chat replies answer them one at a time in the order they arose: a node question by the time its chat message was written, an output by the time its version was validated, and a proposal by the time it was requested, with ties in graph creation and declaration order.
- The terminal composer names the item the next reply answers and binds the message to it; the message is refused, keeping its draft, once that item no longer waits or while an item waits that the composer did not name. The session view's
nmoves the next reply to the following item; in an orchestrated session the message reaches the orchestrator untilnmoves it to an item. - Session API messages, including remote control, never read
nand answer only what the session snapshot exposes: the pending proposal its graph summary shows, then the node question asked last, then an output awaiting acceptance in the graph the summary shows. The summary shows the latest proposal while it is pending or approved, and after a cancel the newest approved one. When only other items wait, the message is refused with the first one's name. - An output of a paused graph other than the session's newest working graph waits for a resume: no reply reaches it, and waiting counts show it as needing a resume rather than waiting for a reply.
- A message that no graph item waits for continues as an ordinary message.
Decisions🔗
| Item | How a reply is decided | Result |
|---|---|---|
| Proposal asking questions | Answers go to that exact version | A new generation |
| Proposal | A decision run, recorded once | Approve, Revise, or Cancel |
| Node question | None; the question panel's answers become one message | A Reply continuation of that execution |
| Output awaiting acceptance | A decision run, or revise when the reply has images | Accept, or a Reply revision |
A proposal or output reply is recorded with the exact version it answered, and only one reply per item is decided at a time. After a restart the host decides or applies every reply whose action was not attempted, resuming a paused graph first; a reply to an output that was accepted or replaced meanwhile is not recovered.
See the proposal workflow for what the user sees, and Execution Graphs for the design reasons.