Skip to content

feat(executor): add Grok CLI as a task executor - #691

Merged
bborn merged 3 commits into
mainfrom
feat/grok-executor
Aug 20, 2026
Merged

feat(executor): add Grok CLI as a task executor#691
bborn merged 3 commits into
mainfrom
feat/grok-executor

Conversation

@bborn

@bborn bborn commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

Adds Grok as a first-class TaskYou executor with Claude parity for the things that make an agent actually finish a task: MCP tools, permission/dangerous mode, session resume, model/effort overrides, and WORKTREE_DB_PATH.

  • New GrokExecutor implements TaskExecutor; registered in the factory, CLI (--executor grok), TUI/GUI picker, desktop env check
  • Interactive launch: grok "$(cat promptfile)" in the task tmux window, never grok's own --worktree
  • Session resume via --resume <id> (~/.grok/sessions/<urlencoded-cwd>/)
  • Dangerous mode --always-approve (GROK_DANGEROUS_ARGS override); ResumeDangerous / ResumeSafe force bypass on/off
  • --effort and --model pass through when the task sets them
  • WORKTREE_DB_PATH is forwarded so ty mcp-server opens the same DB the daemon uses
  • Taskyou MCP stdio server written to <worktree>/.grok/config.toml (mcp_servers.taskyouty mcp-server --task-id) because Grok has no --mcp-config flag; GROK_FOLDER_TRUST=0 ungates project MCP/hooks
  • Worktree write-guard via Grok PreToolUse hook

Test Coverage

Shipped BuildCommand / factory / MCP wiring (not a reimplementation):

  • WORKTREE_* env, grok binary, no grok --worktree
  • --resume only when a session id is supplied
  • --always-approve / GROK_DANGEROUS_ARGS / WORKTREE_DANGEROUS_MODE
  • --effort and --model when task fields are set
  • WORKTREE_DB_PATH precedes grok when set
  • .grok/config.toml contains [mcp_servers.taskyou] + mcp-server --task-id <id>
  • ResumeDangerous vs ResumeSafe flag helper
  • Completion list includes grok
go test ./internal/executor/ ./internal/db/ ./cmd/task/

All passed.

QA

VHS screenshot of the new-task form executor picker (grok is in the cycle list):

new-task-executor-grok

new-task-executor

Test plan

  • go test ./internal/executor/ ./internal/db/ ./cmd/task/
  • go run ./cmd/task create --help lists grok (twice, stable)
  • VHS new-task form shows grok in the executor picker
  • ty create "try grok" -e grok -x on a machine with grok logged in
  • Retry resumes the same Grok session
  • Agent can taskyou_complete without a human in tmux

bborn added 2 commits August 19, 2026 23:32
Register grok alongside claude/codex/gemini so tasks can run on the
Grok CLI in tmux. Supports --resume session continuity, --always-approve
dangerous mode (GROK_DANGEROUS_ARGS override), permission-mode flags,
and the shared worktree write-guard via a PreToolUse hook.
Write a grok-native <worktree>/.grok/config.toml that points at the
same ty mcp-server --task-id stdio server Claude gets via --mcp-config,
so taskyou_complete / taskyou_needs_input load without a human in tmux.

Share one launch helper between daemon Execute and BuildCommand so
--effort, --model, WORKTREE_DB_PATH, and resume/dangerous flags stay in
sync. Tests drive the shipped BuildCommand and fail if the MCP server
or those flags go missing.
@bborn

bborn commented Aug 20, 2026

Copy link
Copy Markdown
Owner Author

Claude-parity follow-up is on this PR now (MCP + effort + WORKTREE_DB_PATH).

Grok is in the TUI new-task executor picker:

new-task-executor-grok

claude codex gemini grok opencode pi

Each letter was a fresh one-char prefix, so "g" picked gemini and "r"
matched nothing. Consecutive letters within a second now form one query
("gr" → grok). The buffer resets on timeout, tab, or left/right.
@bborn
bborn merged commit 006d446 into main Aug 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant