Skip to content

fix(acp): default Grok (and tier-2 presets) to ACP entrypoint args - #3458

Open
madhu-korada wants to merge 1 commit into
block:mainfrom
madhu-korada:fix/grok-default-agent-args
Open

fix(acp): default Grok (and tier-2 presets) to ACP entrypoint args#3458
madhu-korada wants to merge 1 commit into
block:mainfrom
madhu-korada:fix/grok-default-agent-args

Conversation

@madhu-korada

Copy link
Copy Markdown

Summary

Fixes #3457.

Selecting Grok Build as the managed-agent runtime launched bare grok (the interactive TUI) because managed-agent records intentionally store empty agent_args and spawn is supposed to fill defaults via normalize_agent_args / default_agent_args.

Grok (and other Tier-2 presets) were not in that default table, so Buzz spawned:

agent_cmd=…/grok   # no agent stdio args

Under the desktop (no controlling TTY) that dies with:

Error: Device not configured (os error 6)
all 10 agents failed to start — cannot continue

The catalog already documents the correct entrypoint:

// PRESET_HARNESSES
args: &["agent", "--always-approve", "stdio"],

…but empty instance args never resolved to those defaults.

Changes

  1. desktop/.../discovery.rsdefault_agent_args falls through to PRESET_HARNESSES by command identity (single source of truth for Tier-2).
  2. crates/buzz-acp/src/config.rs — mirror the same defaults for env/CLI launches (BUZZ_ACP_AGENT_COMMAND=grok with empty args).
  3. Tests — empty/path forms of grok["agent", "--always-approve", "stdio"]; other presets (omp, opencode, kimi, cursor-agent, openclaw, zero-arg adapters).

Explicit non-empty agent_args are still preserved.

Test plan

  • cargo test -p buzz-acp normalizes_
  • cargo test --manifest-path desktop/src-tauri/Cargo.toml normalizes_
  • Manual: set preferred runtime to Grok Build, start Fizz/Honey/Bumble, confirm harness log shows ACP initialize (not ENXIO) and agents stay running

Workaround (pre-fix)

Set instance args to agent,stdio (or agent,--always-approve,stdio) or wrap with grok-acpexec grok agent stdio "$@".

@madhu-korada
madhu-korada requested a review from a team as a code owner July 29, 2026 03:23

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e2487dd5d7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +703 to +707
"grok" => Some(vec![
"agent".to_string(),
"--always-approve".to_string(),
"stdio".to_string(),
]),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Apply the Grok default when CLI args are omitted

When BUZZ_ACP_AGENT_COMMAND=grok (or --agent-command grok) is used without explicitly setting agent args, both CliArgs and AuthAgentArgs supply the legacy default "acp", so normalize_agent_args sees a nonempty vector and preserves it instead of selecting this new default. Standalone relay, models, and authentication launches therefore execute grok acp rather than grok agent --always-approve stdio; represent omitted args as empty before normalization or treat the legacy sole acp value as absent for Grok.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — fixed in d82a729.

normalize_agent_args now treats a sole bare "acp" as omitted for any command that has a known default (not only when the default is empty). So:

  • BUZZ_ACP_AGENT_COMMAND=grok with clap/env default agent_args=["acp"]agent --always-approve stdio
  • goose still gets ["acp"]
  • zero-arg adapters still get []
  • explicit multi-arg lists are unchanged

Also added DCO Signed-off-by on the commit.

@madhu-korada
madhu-korada force-pushed the fix/grok-default-agent-args branch from e2487dd to d82a729 Compare July 29, 2026 04:32
Empty agent_args on managed-agent records is intentional; spawn is
supposed to fill runtime defaults via normalize_agent_args. Grok was
missing from default_agent_args, so selecting Grok Build launched bare
`grok` (interactive TUI). Under the desktop (no controlling TTY) that
exits with ENXIO and every pool worker fails.

Also treat a sole legacy clap/env default of "acp" as omitted for known
runtimes, so `BUZZ_ACP_AGENT_COMMAND=grok` without explicit args does not
spawn `grok acp`.

- default_agent_args: grok → agent --always-approve stdio
- normalize: sole "acp" → runtime default
- tests for empty, path, and legacy-acp grok args

Fixes block#3457

Signed-off-by: Madhu Korada <madhu.korada@nimble.ai>
@madhu-korada
madhu-korada force-pushed the fix/grok-default-agent-args branch from d82a729 to fb9d097 Compare July 29, 2026 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Grok Build runtime spawns bare grok (TUI) instead of grok agent --always-approve stdio — agents fail with ENXIO

2 participants