From a3e37757e6aca01591bba40b2155c0456fce5cc9 Mon Sep 17 00:00:00 2001 From: Drew Donaldson <49219012+Automata-intelligentsia@users.noreply.github.com> Date: Sun, 9 Aug 2026 19:51:03 -0400 Subject: [PATCH] fix: default --no-auto-update off to fix Grok ACP startup on CLI v1.0.0 (#3390) The released Grok CLI (v1.0.0, latest stable) does not recognize the --no-auto-update flag and exits immediately with error: unexpected argument. This causes Fusion to report 'ACP connection closed' when spawning grok agent stdio. buildGrokAcpArgs previously defaulted noAutoUpdate to true (via !== false). Changed to opt-in (=== true) so the flag is only passed when explicitly enabled. Updated acp-settings.test.ts assertions accordingly. ## Summary by CodeRabbit - **Bug Fixes** - Grok ACP startup no longer disables automatic updates by default. - Automatic update prevention is applied only when explicitly enabled in settings. - **Tests** - Updated startup argument validation to reflect the revised default behavior. - **Documentation** - Added release notes documenting the change. --------- Co-authored-by: gsxdsm --- .changeset/fix-grok-acp-no-auto-update.md | 7 +++++++ .../src/__tests__/acp-settings.test.ts | 14 ++++++-------- .../fusion-plugin-grok-runtime/src/acp-settings.ts | 13 +++++++++---- 3 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 .changeset/fix-grok-acp-no-auto-update.md diff --git a/.changeset/fix-grok-acp-no-auto-update.md b/.changeset/fix-grok-acp-no-auto-update.md new file mode 100644 index 0000000000..ee18bea66f --- /dev/null +++ b/.changeset/fix-grok-acp-no-auto-update.md @@ -0,0 +1,7 @@ +--- +"@runfusion/fusion": patch +--- + +summary: Fix Grok ACP startup by making --no-auto-update opt-in. +category: fix +dev: Released Grok CLI v1.0.0 rejects --no-auto-update; buildGrokAcpArgs now only pushes it when noAutoUpdate === true. Updated acp-settings.test.ts. diff --git a/plugins/fusion-plugin-grok-runtime/src/__tests__/acp-settings.test.ts b/plugins/fusion-plugin-grok-runtime/src/__tests__/acp-settings.test.ts index 64b26b8bee..587a63ec22 100644 --- a/plugins/fusion-plugin-grok-runtime/src/__tests__/acp-settings.test.ts +++ b/plugins/fusion-plugin-grok-runtime/src/__tests__/acp-settings.test.ts @@ -9,23 +9,21 @@ import { } from "../acp-settings.js"; describe("acp-settings", () => { - it("builds grok agent stdio args without -m when model is absent", () => { - // Official docs: --no-auto-update for automated ACP/headless clients. - expect(buildGrokAcpArgs()).toEqual(["--no-auto-update", "agent", "stdio"]); - expect(buildGrokAcpArgs({})).toEqual(["--no-auto-update", "agent", "stdio"]); - expect(buildGrokAcpArgs({ noAutoUpdate: false })).toEqual(["agent", "stdio"]); + it("builds grok agent stdio args without --no-auto-update by default (Grok CLI v1.0.0 rejects the flag)", () => { + // --no-auto-update is opt-in only; the released Grok CLI does not support it. + expect(buildGrokAcpArgs()).toEqual(["agent", "stdio"]); + expect(buildGrokAcpArgs({})).toEqual(["agent", "stdio"]); + expect(buildGrokAcpArgs({ noAutoUpdate: true })).toEqual(["--no-auto-update", "agent", "stdio"]); }); it("places plugin-dir and -m before the stdio subcommand", () => { expect(buildGrokAcpArgs({ model: "grok-4.5" })).toEqual([ - "--no-auto-update", "agent", "-m", "grok-4.5", "stdio", ]); expect(buildGrokAcpArgs({ model: "grok-4.5", pluginDirs: ["/tmp/skills-plugin"] })).toEqual([ - "--no-auto-update", "agent", "--plugin-dir", "/tmp/skills-plugin", @@ -59,7 +57,7 @@ describe("acp-settings", () => { it("builds AcpRuntimeAdapter settings for Grok ACP", () => { const settings = buildGrokAcpRuntimeSettings({ binary: "/usr/local/bin/grok", model: "grok-cli/grok-4.5" }); expect(settings.acpBinaryPath).toBe("/usr/local/bin/grok"); - expect(settings.acpArgs).toEqual(["--no-auto-update", "agent", "-m", "grok-4.5", "stdio"]); + expect(settings.acpArgs).toEqual(["agent", "-m", "grok-4.5", "stdio"]); expect(settings.acpEnvAllowList).toEqual([...GROK_ACP_ENV_ALLOWLIST]); expect(settings.acpFsRead).toBe(false); expect(settings.acpFsWrite).toBe(false); diff --git a/plugins/fusion-plugin-grok-runtime/src/acp-settings.ts b/plugins/fusion-plugin-grok-runtime/src/acp-settings.ts index ca3b3cd65e..3a1c5ff7d7 100644 --- a/plugins/fusion-plugin-grok-runtime/src/acp-settings.ts +++ b/plugins/fusion-plugin-grok-runtime/src/acp-settings.ts @@ -68,8 +68,13 @@ export function resolveGrokAcpAuthPreferMethods( * Official headless/ACP scripting docs recommend `--no-auto-update` for CI and * automated clients (https://docs.x.ai/build/cli/headless-scripting). Place it * before the `agent` subcommand: `grok --no-auto-update agent … stdio`. - * Model / plugin-dir flags belong on `grok agent` before the transport: - * `grok --no-auto-update agent [--plugin-dir …] [-m ] stdio`. + * + * FNXC:GrokAcp 2026-08-09-00:00: + * The released Grok CLI (v1.0.0, latest stable) does not recognize + * `--no-auto-update` and exits immediately with "unexpected argument". + * Default is now OFF; callers must opt in via noAutoUpdate:true. Fusion + * manages its own update cycle, so disabling auto-update in the subprocess + * is unnecessary and breaks startup for all users on current Grok CLI. */ export function buildGrokAcpArgs(options?: { model?: string; @@ -77,8 +82,8 @@ export function buildGrokAcpArgs(options?: { noAutoUpdate?: boolean; }): string[] { const args: string[] = []; - // Default ON for Fusion automation; callers can pass noAutoUpdate:false. - if (options?.noAutoUpdate !== false) { + // Default OFF — Grok CLI v1.0.0 rejects --no-auto-update (unknown flag). + if (options?.noAutoUpdate === true) { args.push("--no-auto-update"); } args.push("agent");