Go Further

Delegate a task to another session

Run a task on another provider and receive its outcome in the parent session.

Use spawn_session with reportBack: true and a prompt to delegate a task. Set llmConnection and model to choose a different provider or model. The tool returns the child session ID and a delegation ID, along with thinkingLevel when set and launchModel when the child runs on a CLI backend that derives the model id from the session’s thinking level and that level selects a variant different from model. On Cursor, stripping the cursor: prefix alone does not count as a difference, so cursor:grok-4.7-high at high omits launchModel although the CLI receives grok-4.7-high. A turn whose thinking level is overridden (for example by adaptive thinking) can launch another variant. Wait for the report before acting on the result.

If you pass a model by itself, the child keeps the inherited connection when it offers the model or has no catalog available. Otherwise, the tool selects a configured connection that offers the model and names it in the result. If it cannot resolve the model, the tool refuses the spawn. Pass llmConnection to choose the connection yourself or call with help=true to see the available connections and models.

Fabric sends the report as a separate turn when the parent and its pending turn continuations are idle. The parent's running background tasks do not hold up the report. An archived parent can receive the report after it is restored. It includes the end state, the delegated turn’s final assistant reply if it produced one, and any error. Queued work, automatic retries, tracked background work, human checkpoints, and outstanding report-back delegations of the child can delay settlement. The result comes from the last turn that continues the delegated task. This includes retries, checkpoint resumes, background wakes, and turns that receive outcomes from tasks it delegated. New messages from a person or another session start separate work.

Fabric can start an autonomous report turn for a settled delegation. After recording dispatch, it uses normal error display and recovery. A turn that completes or hands off to plan review or sign-in delivers the report if it published no error. If the turn fails, including agent setup failure, Fabric adds the outcome as context to the parent's next dispatch that can carry turn context. The receiving turn keeps its original message. This can be a person's message, a background wake, a notice, a plan approval, or another delegation's report turn. A /compact command or an already-started SDK turn leaves the report pending.

The carried report includes its delegation ID and may repeat one the model already saw. Fabric keeps it pending through ordinary recovery and reattaches it to the resend. A completion, plan handoff, or sign-in handoff delivers it if the carrying turn published no error. If the carrying turn fails, the report can attach again when another turn starts. Carry-over starts no turns of its own. If the report turn fails and the parent runs no further turns, the model receives no carry-over. The outcome remains readable with get_delegation_result.

The report includes up to 8,192 characters of reply text and 4,096 characters of error text. The parent can call get_delegation_result with the child session ID or delegation ID to read the saved outcome. The workspace journal saves up to 262,144 characters of each reply and 16,384 characters of error text. The tool indicates when the saved reply was cut and returns up to 65,536 characters per call. Pass nextReplyOffset as replyOffset to read the next page.

The journal keeps delivered outcomes while both sessions exist. Deleting a parent removes its delegations. If a child is deleted while its report is pending, the record is kept until delivery or cancellation. A surviving child whose parent’s record was removed can start a new delegation chain.

The journal records when the autonomous report is dispatched. After restart, a saved dispatch becomes a pending carry-over. A report saved as settled can still start its autonomous turn. Saved carry-overs stay pending, and saved deliveries and cancellations stay final.

If a journal write fails, Fabric continues with the in-memory state and retries the write. If Fabric dies before a new delegation’s first journal write reaches disk, the delegation is lost and the parent gets no report. The child stays an ordinary session. If Fabric quits or crashes while a child is still starting, the delegation reports as interrupted even though the child never ran. If Fabric dies before a later update reaches disk, it restarts from the last saved journal. An unresolved delegation then reports as interrupted. This can produce an interrupted report for work the parent stopped if that Stop did not reach disk. A lost dispatch write can allow another autonomous report turn after restart.

If Fabric cannot read the journal, it leaves the file untouched and retries the read. Until it succeeds, Fabric sends no reports from that journal, and report-back spawns, result reads, and Stops say they could not check it. If Fabric can read the journal but its contents are invalid, it starts with an empty journal and moves the invalid file aside when it can write to the directory. When moved, it replaces any previous diagnostic copy. The children from the invalid journal remain ordinary sessions.

A parent can have up to three delegations running at once. A finished delegation waiting to report does not count toward this limit. Delegations can be nested up to three levels deep. Fabric refuses a spawn if its ancestry contains a cycle. The child stays in the parent’s workspace and project and can use only sources selected from the parent’s enabled sources. Fabric refuses report-back if either session uses the GrokBot CLI backend or if the tool transport lacks a report host.

Stopping the parent’s running turn, or deleting the parent, cancels outstanding report-back work and drops its pending reports. The child sessions remain available. To stop a running session, open its row menu in the session list and choose Stop. If you stop a report-back child this way, Fabric retires its delegated work and the parent receives a stopped outcome.

The parent can call stop_delegation with the delegation ID. A successful cancellation drops the pending report and requests a stop for work belonging to that task, including report-back tasks it started. The child stays available. Other work in the child and the parent’s other delegations can continue. After cancellation, a person can start an ordinary turn by sending a message, approving a plan, or signing in from the child.

The tool keeps any saved outcome. If the current turn already has the report, the tool says it has arrived and leaves normal delivery in place. If interrupting a delegated turn would also stop other work in its session, Fabric refuses the request. The delegation continues and can report normally. Retry once the other work ends, or have a person choose Stop from that session. If the delegated task is between turns and a person has a turn running in the child, Fabric can cancel the delegation and report that the child is still busy with other work.

Fabric waits up to five seconds to observe requested stops. A cancellation result means the journal saved the cancellation. The result describes work it observed ending, any unconfirmed stop, and whether the child is still busy with other work or was deleted during confirmation. Concurrent calls share in-flight stop requests. A later call checks again and can retry an outstanding stop while the report stays cancelled.

If a stopped turn is still ending, Fabric refuses new report-back spawns from it and skips automatic sign-in resumes and background wakes for its work. A late report for that task is saved as cancelled_by_parent and excluded from subsequent turns. get_delegation_result returns the cancellation and any outcome already saved.

A message another session sends to the child with send_agent_message can still start a turn there after a cancellation or an ordinary Stop. If the cancelled task asked another session a question, that session’s reply can lead the child to pick the task up again.

With reportBack omitted or set to false, the child runs independently and these delegation limits do not apply.

Start a child from an agent

Pass agent with the agent’s slug to capture its instructions when the child is created. Fabric looks in the child’s working folder first, then the workspace, then your home folders. The result names the agent. An unknown slug or an unusable definition stops the spawn.

The agent’s model and thinking level apply unless you pass model or thinkingLevel yourself. If Fabric cannot resolve the agent’s model, the child uses its usual spawn model and the result explains the fallback. The agent file adds no sources and the child’s permission mode stays at or below the parent’s. You can use agent with or without reportBack.

Coding work in its own worktree

Set codingMode to choose whether the child starts in Coding mode; left out, it takes the parent's mode. To give the child its own checkout, create a git worktree first (for example git worktree add ../repo-feature -b feature from the repository) and pass its path as worktreePath. The child starts in Coding mode in that folder, so its edits never collide with the parent's. Fabric refuses the spawn if the path is not inside a git work tree, if codingMode is false, or if workingDirectory names a different folder. With worktreePath, no isolated worktree is made for the child. The tool's result names the child's folder and whether it runs in Coding mode.

Messaging another session

send_agent_message returns when the recipient starts a turn or queues the message for a separate turn. The sender can keep working while the recipient runs. A queued result means delivery is still pending.

Fabric refuses a send if the recipient's enforced permission mode is looser than the sender's. When a queued message reaches the front, Fabric compares the recipient's current mode with the sender's mode at send time. If that check fails, the recipient's chat shows a delivery notice.

A chain can reach six agent messages. A session at that limit needs a user message to reset its depth before it can send again. Agent mentions in messages from other sessions are treated as text.

Agents also share a budget of 100 actions between one message from you and the next. Each agent message, each spawned or mentioned session, and each automation that runs because a session's status, labels, flag or permission mode changed uses one. Sessions an agent starts or messages draw on the same budget as the session that started them, and a report coming back from a delegated session uses nothing itself, though an automation set off by the session's status changing as it handles the report does. When the budget is used up, the agent is told that the exchange needs a message from you; the new budget starts when your message starts running. Changing a session's status or labels by hand doesn't start a new budget. Automations use the changed session's budget, except for one minute after an agent in another session changed its status or labels: then they count against that agent's budget. Automations that run on a schedule do not use the budget. A budget that nothing has used for 30 days starts again from zero.

On this page