Skip to main content

agentmux_srv_core/backend/providers/
grok.rs

1// Copyright 2026, AgentMux Corp.
2// SPDX-License-Identifier: Apache-2.0
3
4use super::{Tier, ControllerType, ProviderConfig};
5
6// Grok Build (xAI): `grok agent stdio` speaks ACP over stdio. Not on npm: AgentMux
7// downloads the pinned release itself (`cli_download::SPECS`), and a copy the user
8// installed is still found on PATH or in `known_install_paths`. Checked against
9// 1.0.52 on 2026-10-14 (SPEC_NINE_NEW_HARNESSES_2026_10_14.md ยง7.5); pin moved to 1.0.77
10// on 2026-11-09 after an ACP `initialize` against the real binary, and to 1.0.92 on 2026-11-25 with its hashes, no live run.
11pub(super) static GROK: ProviderConfig = ProviderConfig {
12    id: "grok",
13    tier: Tier::FirstClass,
14    cli_command: "grok",
15    controller_type: ControllerType::Acp,
16    app_server: None,
17    launch_args: &["agent", "stdio"],
18    persistent_launch_args: None,
19    resume_flag: None,
20    session_id_field: "sessionId",
21    styled_output_format: "acp",
22    // Moves ~/.grok: config, sign-in, sessions, trusted folders.
23    auth_config_dir_env_var: "GROK_HOME",
24    auth_dir_name: "grok",
25    history_native_subdir: None,
26    // No self-update (the pin holds) and no telemetry. Grok also imports
27    // Claude Code's and Cursor's rules, skills, MCP servers and hooks by
28    // default, which would pull an AgentMux agent's Claude setup into a
29    // Grok one.
30    auth_extra_env: &[
31        ("GROK_DISABLE_AUTOUPDATER", "1"),
32        ("GROK_TELEMETRY_ENABLED", "false"),
33        ("GROK_CLAUDE_SKILLS_ENABLED", "0"),
34        ("GROK_CLAUDE_RULES_ENABLED", "0"),
35        ("GROK_CLAUDE_AGENTS_ENABLED", "0"),
36        ("GROK_CLAUDE_MCPS_ENABLED", "0"),
37        ("GROK_CLAUDE_HOOKS_ENABLED", "0"),
38        ("GROK_CLAUDE_SESSIONS_ENABLED", "0"),
39        ("GROK_CURSOR_SKILLS_ENABLED", "0"),
40        ("GROK_CURSOR_RULES_ENABLED", "0"),
41        ("GROK_CURSOR_AGENTS_ENABLED", "0"),
42        ("GROK_CURSOR_MCPS_ENABLED", "0"),
43        ("GROK_CURSOR_HOOKS_ENABLED", "0"),
44        ("GROK_CURSOR_SESSIONS_ENABLED", "0"),
45    ],
46    unset_env: &[],
47    npm_package: "",
48    pinned_version: "1.0.92",
49    base_url_env_var: None,
50    supported_vendors: &["xai"],
51    // Read only in a trusted folder: srv trusts the agent's own
52    // (blockcontroller/acp_prelaunch.rs).
53    startup_instructions_filename: Some("AGENTS.md"),
54    native_instruction_sources: &["AGENTS.md"],
55    native_instruction_dirs: &[],
56};