feat(grok): add Grok CLI provider via ACP#2809
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 30e7372. Configure here.
| Effect.mapError((error) => | ||
| mapAcpToAdapterError(PROVIDER, input.threadId, "session/prompt", error), | ||
| ), | ||
| ); |
There was a problem hiding this comment.
Concurrent turns during Grok prompt
Medium Severity
The per-thread lock in sendTurn covers preparation and turn.started but not the in-flight session/prompt. A second sendTurn on the same thread can acquire the lock and start another ACP prompt while the first is still running, interleaving two turns on one Grok ACP session.
Reviewed by Cursor Bugbot for commit 30e7372. Configure here.
ApprovabilityVerdict: Needs human review This PR introduces a complete new Grok provider integration with substantial new logic (~2600 lines) including driver, adapter, text generation, and UI components. New feature integrations of this scope require human review, and there is also an unresolved comment identifying a potential concurrency issue in turn handling. You can customize Macroscope's approvability policy. Learn more. |
Wires the Grok CLI (https://x.ai/cli) into the existing ACP runtime so X Premium / SuperGrok users get a first-class provider. - GrokDriver registered through builtInDrivers - GrokProvider / GrokAdapter handle session lifecycle, event streams, and model switching via session/set_model - GrokAcpSupport probes auth methods and drives the xai.api_key flow - GrokTextGeneration adds Grok as an option (not a default) for git commit/branch generation - grok-build registered as the only Grok model id (only one currently exposed by the CLI) - UI: Grok icon, provider selector entry, settings driver metadata, provider icon mapping Defaults are unchanged: Codex remains the default provider. Closes pingdotgg#2808
30e7372 to
a58e850
Compare


What Changed
#2808
Add Grok Build via ACL
Why
Grok Build was recently released and its accessible via X Premium Subs and Supergrok Subs
UI Changes
Checklist
Note
Medium Risk
New provider spawns Grok child processes for chat, probes, and text generation; Grok defaults to enabled in settings, so fresh installs may probe the CLI immediately. Auth and subprocess handling are security-sensitive but follow existing ACP driver patterns.
Overview
Adds Grok as a first-class provider using the Grok CLI over ACP (
grok agent stdio), alongside existing Codex/Cursor-style drivers.Server: New
GrokDriverwires adapter, snapshot health (grok --version+ ACP model discovery), andGrokTextGenerationfor git/thread helpers.GrokAdapterruns full chat sessions: ACP lifecycle,session/set_model, permissions (auto-approve in full-access), streaming runtime events, image attachments, and resume cursors. Shared ACP runtime gainssetSessionModel; Grok-specific spawn/auth (GROK_OAUTH2_REFERRER=t3code, API key vs cached token) lives inGrokAcpSupport.Contracts & defaults:
GrokSettings(enabled,binaryPath,customModels), server settings patches, default modelgrok-build, and registry/tests updated so Grok boots with other built-in drivers.Web: Grok in provider picker (Early Access / new badge), settings form metadata, and
GrokIcon.Tests / mock:
acp-mock-agentadvertises Grok models and implementssession/set_model; unit/integration tests cover adapter, provider probes, and headless text generation.Reviewed by Cursor Bugbot for commit a58e850. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add Grok CLI provider via ACP with session management, text generation, and UI integration
grokCLI binary, discovers models via ACP, and emitsdisabled/error/readyprovider snapshots with a 15s ACP discovery timeout and 4s version check timeout.session/set_model, and ACP event translation to runtime events.session/set_modeland model state reporting for use in integration tests.Macroscope summarized a58e850.