Grok Bot delegation
Let your Grok Bot bots hand coding work to Fabric Agents on your computer, and get the results back in their threads.
Grok Bot bots work on their cloud computer. With delegation on, a bot can hand a task to Fabric Agents on your own computer, where your projects, tools and sign-ins are. Fabric works on it in a session you can see, with the agent and permission mode you chose, and posts the result back to the bot's thread.
Delegation is off until you turn it on. It works on macOS and Linux.
How it works
- The bot runs
fabric-delegateon your computer through Grok Bot Shell with your computer's machineId. - Fabric starts a session named after the bot, in the workspace, folder, connection and permission mode you chose. The task arrives marked as a request from another agent.
- In Ask mode (the default) every tool the agent wants to run waits for your approval in Fabric.
- When the work is over (no queued message, retry or background work follows), Fabric sends the result to the bot with
gbot send, once, as a reply in the same thread. Whatever you do in that session afterwards stays in Fabric. - If a bot delegates again because of a message it got, it passes that message's relay metadata on, and Fabric replies one hop higher. Fabric refuses a delegation whose reply would reach gbot's hop limit (4, or
GROK_BOT_MAX_HOPS), so bots and Fabric cannot message each other in a loop.
A bot cannot choose the connection or the permission mode, nor a folder you did not allow (folders are compared after resolving symlinks). Delegated sessions run in a workspace on this computer, never on a remote server. At most the number of tasks you set are worked on at once; a task waiting for your approval counts.
Turn it on
Open Settings → Grok Bot:
| Setting | What it does |
|---|---|
| Let Grok Bot bots delegate work to Fabric | Starts listening on an owner-only socket in Fabric's config folder and writes the fabric-delegate command beside it. |
| Workspace, Connection, Model | Where delegated sessions are created and which agent runs them. |
| Permission mode | Ask by default. Explore is read only; Execute runs tools without asking. |
| Folders | The project folders bots may work in. The first is the default. |
| Post results back to the bot | Sends each session's result to the bot's thread (needs the gbot CLI, signed in through the Grok Bot desktop app). |
| At most running at once | Further requests are refused until one finishes. |
Add skill to Grok Bot adds a delegate-to-fabric-agents skill to your Grok Bot skill library, so every bot knows how to delegate. This changes your Grok Bot account, so Fabric does it only when you click.
The command
fabric-delegate delegate --from "<bot name>" [--folder <dir>] [--wait <seconds>]
[--correlation-id <corr> --reply-to <msg> --hop <n>] "<task>"
fabric-delegate status <session>
fabric-delegate wait <session> [--wait <seconds>]
fabric-delegate cancel <session>It prints JSON: {"ok":true,"session":"…","status":"running|needs-you|done|stopped|error","reply":"…"}. needs-you means the session waits for you in Fabric: a tool approval, a sign-in or a plan to accept. Settings, Grok Bot shows the full path of the command on your computer.
The relay flags take the values of the [gbot msg=… corr=… hop=…] header that starts each message gbot relays; a bot passes them only when it acts on such a message. Wrong values are refused, never replaced.