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. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## 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. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: gsxdsm <gsxdsm@users.noreply.github.com>
This commit is contained in:
7
.changeset/fix-grok-acp-no-auto-update.md
Normal file
7
.changeset/fix-grok-acp-no-auto-update.md
Normal file
@@ -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.
|
||||||
@@ -9,23 +9,21 @@ import {
|
|||||||
} from "../acp-settings.js";
|
} from "../acp-settings.js";
|
||||||
|
|
||||||
describe("acp-settings", () => {
|
describe("acp-settings", () => {
|
||||||
it("builds grok agent stdio args without -m when model is absent", () => {
|
it("builds grok agent stdio args without --no-auto-update by default (Grok CLI v1.0.0 rejects the flag)", () => {
|
||||||
// Official docs: --no-auto-update for automated ACP/headless clients.
|
// --no-auto-update is opt-in only; the released Grok CLI does not support it.
|
||||||
expect(buildGrokAcpArgs()).toEqual(["--no-auto-update", "agent", "stdio"]);
|
expect(buildGrokAcpArgs()).toEqual(["agent", "stdio"]);
|
||||||
expect(buildGrokAcpArgs({})).toEqual(["--no-auto-update", "agent", "stdio"]);
|
expect(buildGrokAcpArgs({})).toEqual(["agent", "stdio"]);
|
||||||
expect(buildGrokAcpArgs({ noAutoUpdate: false })).toEqual(["agent", "stdio"]);
|
expect(buildGrokAcpArgs({ noAutoUpdate: true })).toEqual(["--no-auto-update", "agent", "stdio"]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("places plugin-dir and -m before the stdio subcommand", () => {
|
it("places plugin-dir and -m before the stdio subcommand", () => {
|
||||||
expect(buildGrokAcpArgs({ model: "grok-4.5" })).toEqual([
|
expect(buildGrokAcpArgs({ model: "grok-4.5" })).toEqual([
|
||||||
"--no-auto-update",
|
|
||||||
"agent",
|
"agent",
|
||||||
"-m",
|
"-m",
|
||||||
"grok-4.5",
|
"grok-4.5",
|
||||||
"stdio",
|
"stdio",
|
||||||
]);
|
]);
|
||||||
expect(buildGrokAcpArgs({ model: "grok-4.5", pluginDirs: ["/tmp/skills-plugin"] })).toEqual([
|
expect(buildGrokAcpArgs({ model: "grok-4.5", pluginDirs: ["/tmp/skills-plugin"] })).toEqual([
|
||||||
"--no-auto-update",
|
|
||||||
"agent",
|
"agent",
|
||||||
"--plugin-dir",
|
"--plugin-dir",
|
||||||
"/tmp/skills-plugin",
|
"/tmp/skills-plugin",
|
||||||
@@ -59,7 +57,7 @@ describe("acp-settings", () => {
|
|||||||
it("builds AcpRuntimeAdapter settings for Grok ACP", () => {
|
it("builds AcpRuntimeAdapter settings for Grok ACP", () => {
|
||||||
const settings = buildGrokAcpRuntimeSettings({ binary: "/usr/local/bin/grok", model: "grok-cli/grok-4.5" });
|
const settings = buildGrokAcpRuntimeSettings({ binary: "/usr/local/bin/grok", model: "grok-cli/grok-4.5" });
|
||||||
expect(settings.acpBinaryPath).toBe("/usr/local/bin/grok");
|
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.acpEnvAllowList).toEqual([...GROK_ACP_ENV_ALLOWLIST]);
|
||||||
expect(settings.acpFsRead).toBe(false);
|
expect(settings.acpFsRead).toBe(false);
|
||||||
expect(settings.acpFsWrite).toBe(false);
|
expect(settings.acpFsWrite).toBe(false);
|
||||||
|
|||||||
@@ -68,8 +68,13 @@ export function resolveGrokAcpAuthPreferMethods(
|
|||||||
* Official headless/ACP scripting docs recommend `--no-auto-update` for CI and
|
* Official headless/ACP scripting docs recommend `--no-auto-update` for CI and
|
||||||
* automated clients (https://docs.x.ai/build/cli/headless-scripting). Place it
|
* automated clients (https://docs.x.ai/build/cli/headless-scripting). Place it
|
||||||
* before the `agent` subcommand: `grok --no-auto-update agent … stdio`.
|
* 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 <dir>…] [-m <model>] 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?: {
|
export function buildGrokAcpArgs(options?: {
|
||||||
model?: string;
|
model?: string;
|
||||||
@@ -77,8 +82,8 @@ export function buildGrokAcpArgs(options?: {
|
|||||||
noAutoUpdate?: boolean;
|
noAutoUpdate?: boolean;
|
||||||
}): string[] {
|
}): string[] {
|
||||||
const args: string[] = [];
|
const args: string[] = [];
|
||||||
// Default ON for Fusion automation; callers can pass noAutoUpdate:false.
|
// Default OFF — Grok CLI v1.0.0 rejects --no-auto-update (unknown flag).
|
||||||
if (options?.noAutoUpdate !== false) {
|
if (options?.noAutoUpdate === true) {
|
||||||
args.push("--no-auto-update");
|
args.push("--no-auto-update");
|
||||||
}
|
}
|
||||||
args.push("agent");
|
args.push("agent");
|
||||||
|
|||||||
Reference in New Issue
Block a user