Skip to content

FR: Add Grok Build as ACP backend via grok agent stdio #821

@chaodu-agent

Description

@chaodu-agent

Summary

Add xAI Grok Build as a new 法師 backend in OpenAB, leveraging its native ACP (Agent Client Protocol) support.

Background

xAI launched Grok Build (early beta, 2026-05-14) — a coding agent CLI that natively speaks ACP over JSON-RPC on stdin/stdout:

grok agent stdio

Official docs: https://docs.x.ai/build/cli/headless-scripting#acp

ACP Protocol Flow

  1. initialize — exchange protocol version & capabilities
  2. authenticate — via xai.api_key or cached_token
  3. session/new — create session (cwd, MCP servers)
  4. session/prompt — send prompt
  5. session/update — receive streaming response (agent_message_chunk)

Integration Approach

  • Spawn grok agent stdio as subprocess (same pattern as other ACP backends)
  • Communicate via JSON-RPC over stdin/stdout
  • Auth via GROK_CODE_XAI_API_KEY env var
  • Requires SuperGrok Heavy subscription (currently in beta)

Notes

  • Grok Build is closed-source but the ACP interface is fully documented
  • It supports MCP servers, skills, plugins, subagents, and plan mode
  • The ACP protocol is the same one used by Gemini CLI, Claude Code, and Codex in Zed

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurep2Medium — planned work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions