Skip to main content

A T3 Code workflow wakes Grok Bot only when a coding loop needs input or ends

GitHubGitHubweugit2026-12-03

Code and reposSource read in fullRead first
GitHubGitHubweugit2026-12-03

Open original

Overview

A developer who already uses T3 Code can install this durable workflow, give Grok Bot a webhook Routine, and let a local implement-and-review loop run until the bot is needed to decide or to receive the final summary.

Workflow

  1. What it is: A generic durable coding loop and Grok Bot webhook-callback bridge that runs inside T3 Code Durable Workflows on Windows, macOS, and Linux. The inner loop — implement, verify, independent review, revise — runs on the user's machine without waking Grok Bot on every small turn. The outer loop wakes Grok Bot, via an async webhook with exponential-backoff retries, only when human or bot input is needed (needs_input) or when the workflow ends (onEnd). Grok Bot can resume a waiting run with t3_workflow(action="signal").
  2. Grok Bot parts used: A webhook-triggered Routine, whose prompt is taken from templates/grokbot-routine-prompt.md, plus the T3 MCP tool t3_workflow so Grok Bot can start, signal, or resume a run. There is no x.ai/bot/... template link. Not part of Grok Bot: T3 Code and its Durable Workflows engine (~/.t3/workflows/), the workflow file workflows/grokbot-loop.ts, T3's key-value store (T3.store) for webhook URLs and Bearer keys, and the implement and review agents T3 launches. The README says all T3 providers are supported, including Codex, Claude Code, Cursor, Antigravity, Kiro, Grok Build, or any ACP agent configured in T3 Code. Grok Build is a T3 implementer option here, not a Grok Bot chat step.
  3. You need: T3 Code v0.1.12 or later with Settings, Labs, Workflows enabled; a Grok Bot account that can create a webhook-triggered Routine; and the T3 MCP connection so the bot can call t3_workflow. Webhook URLs and Bearer keys are stored in T3.store, not in Git. Not stated in the source: which Grok Bot plan is required.
  4. Install: Enable T3 Workflows, install this workflow into ~/.t3/workflows/, create the Grok Bot Routine from the template, and store the webhook. The README's path, kept as sub-steps:
    • Step 1: In T3 Code, enable Settings, Labs, Workflows (requires T3 Code v0.1.12+).
    • Step 2: Clone https://github.com/weugit/t3-grokbot-loop.git and run scripts/install.ps1 on Windows, or bash ./scripts/install.sh on macOS or Linux. T3 Code watches ~/.t3/workflows/ and hot-reloads grokbot-loop.ts.
    • Step 3: Create a webhook-triggered Routine in Grok Bot and paste the prompt from templates/grokbot-routine-prompt.md. That file is long, so this case points to the path rather than repeating it. Copy the Routine's webhook URL and Authorization header.
    • Step 4: Store them in T3 Code's durable store, replacing <bot-name> with a lowercase identifier such as mainbot. The README shows:

t3 workflow store set grokbot/webhook/<bot-name> '{"url":"https://your-grokbot-webhook-url","authHeader":"Bearer your-routine-key"}'

Verify with t3 workflow store list grokbot/webhook/.

  1. After install: Start a loop from Grok Bot via T3 MCP, or from the T3 CLI; Grok Bot is woken only for input or a final summary.
    • A start call passes project, task, and botName (required). Optional fields include maxRounds (default 3, clamped to 1–10), workspaceMode (default worktree), runtimeMode (default full-access), enableReview (default true), agentTimeout (default 2 hours), and decisionTimeout (default 24 hours) for waiting on a Grok Bot signal.
    • On needs_input, the Routine prompt tells the bot to review the question and, if it can decide safely, call t3_workflow with action signal; it should not interrupt the user unless the decision involves production deploy, destructive data changes, billing, or ambiguous product scope. Otherwise it should summarize the question for the user, including runId and waitName.
    • On workflow_ended, the bot reports completion (including branch and prUrl when present) or explains why the run stopped or was cancelled.
    • notifyOnRound defaults to false; if true, non-final rounds also POST round_feedback, which the prompt says to log without taking action.
    • The start payload example and the full Routine instructions stay in templates/grokbot-routine-prompt.md.
  2. Did the author run it: The repository has no run records from the author. The repo includes tests/workflow.test.mjs and a GitHub Actions test workflow; those are local or CI tests, not a record of a Grok Bot coding loop.

Key points and results

  • Maturity: At fetch time on 2026-12-03 the repo was created at 2026-12-02T16:46:37Z, last pushed at 2026-12-02T17:52:38Z, with 6 commits, 0 stars, 0 forks, 0 open issues or PRs, and an MIT license. The Grok Bot Routine prompt in templates/grokbot-routine-prompt.md was fetched. The README presents this as a generic bridge, with no author-run coding-loop record.
  • Permissions and boundaries: Webhook URLs and Bearer keys stay in T3.store, not in Git. The Routine prompt tells the bot not to interrupt the user unless the decision involves production deploy, destructive data changes, billing, or ambiguous product scope. The default runtimeMode for worker threads is full-access; other documented modes include auto, auto-accept-edits, and approval-required. The default workspace mode is an isolated worktree.
  • Known limits: T3 Code v0.1.12+ with Workflows enabled is required, and Grok Bot is not woken on every inner-loop turn. decisionTimeout defaults to 24 hours. The source does not say which Grok Bot plan is required, and the repository has no author run records. Grok Build, if used, is a T3 implementer, not the Grok Bot side of the loop.
  • Worth borrowing: Keep an inner coding loop on the local machine, and wake Grok Bot only for needs_input or onEnd. See the README's two-tier loop description and architecture diagram.
  • Worth borrowing: Store webhook URLs and Bearer keys in a durable host store, not in the git tree. See the Quick Start store commands in the README.
  • Worth borrowing: On a needs_input webhook, decide from context when it is safe, and only escalate production, destructive, billing, or ambiguous-scope decisions to the user. See templates/grokbot-routine-prompt.md.

Source

Platform
GitHub
Author
weugit
Published
Categories
Code and repos

What this evidence label means

Source read in full

We read the source (post, article or transcript). That only means the original was read. It does not mean this site reproduced the author's results.

Read the editorial and evidence policy

Other cases in this scenario

This unofficial community project is independent of xAI. xAI has neither approved nor endorsed it. No sign-up. The methods and figures come from the original authors.