fix(acp): keep Grok managed agents on headless stdio with Buzz auth - #7418
fix(acp): keep Grok managed agents on headless stdio with Buzz auth#7418Trevongit wants to merge 2 commits into
Conversation
Empty grok argv launched the interactive TUI (ENXIO under Desktop). Catalog argv without --no-leader shared the TUI leader socket when [cli] use_leader is on. grokShell also dropped BUZZ_PRIVATE_KEY via the *KEY* denylist, so buzz messages send failed and the model hunted /proc. Default grok argv to agent --always-approve --no-leader stdio, insert --no-leader on existing ACP argv unless --leader is explicit, and inject GROK_CONFIG so grokShell keeps harness auth env. Some grok security gates still read ~/.grok/config.toml; README documents the operator disk fallback. Related: block#3457 block#4224 Signed-off-by: Trevor P <trev2005@gmail.com>
🔐 Codex Security Review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9fac1e0f79
ℹ️ 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".
| fn default_agent_args(command: &str) -> Option<Vec<String>> { | ||
| match normalize_agent_command_identity(command).as_str() { | ||
| "goose" => Some(vec!["acp".to_string()]), | ||
| "grok" => Some(grok_acp_args()), |
There was a problem hiding this comment.
Treat the legacy
acp parser default as empty for Grok
When BUZZ_ACP_AGENT_COMMAND=grok is set without BUZZ_ACP_AGENT_ARGS—the documented standalone quick start—Clap supplies the existing default agent_args = ["acp"], so this Grok default is never selected: normalize_agent_args returns ["acp"] rather than the headless stdio argv. Thus buzz-acp, models, and authentication helpers invoke grok acp, leaving the advertised no-args workflow unfixed; handle the legacy acp sentinel for Grok and cover the parsed CLI path rather than testing only a manually constructed empty vector.
AGENTS.md reference: AGENTS.md:L188-L192
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in 935c213.
Clap still defaults BUZZ_ACP_AGENT_ARGS to acp. normalize_agent_args now treats that sentinel as empty whenever the command has a table default, so BUZZ_ACP_AGENT_COMMAND=grok without args resolves to agent --always-approve --no-leader stdio instead of grok acp.
grok_cli_without_agent_args_uses_headless_stdio covers CliArgs::parse_from → Config::from_args.
BUZZ_ACP_AGENT_ARGS defaults to acp. That blocked Grok's headless stdio default and launched grok acp. Collapse the sentinel whenever the command has a table default, and cover Config::from_args. Signed-off-by: Trevor P <trev2005@gmail.com>
Summary
Managed Grok Build agents were slow and often mute in the room for two harness reasons, not model reasons:
agent_argslaunched interactivegrok(ENXIO under Desktop). Catalog argvagent --always-approve stdiostill omitted--no-leader, so a managed agent shared the interactive TUI leader socket when[cli] use_leaderis on.*KEY*/*SECRET*/*TOKEN*unlessshell_environment_policy.ignore_default_excludesis true.BUZZ_PRIVATE_KEYmatches*KEY*, sobuzz messages sendfailed withauth_errorand the model spent a dozen tool calls scraping/proc.This PR makes any Grok-harnessed managed agent use headless ACP and keep harness auth env in grokShell. It does not rewrite stored persona JSON.
Changes
default_agent_args:agent --always-approve --no-leader stdiofor command identitygrok.--no-leaderon existing ACP argv. Explicit--leaderis left alone.GROK_CONFIGwith overlay-allowlistedshell_environment_policyfilter fields so grokShell keepsBUZZ_*already on the grok process. It does not inject secret values.~/.grok/config.tomlinstead of the overlay.Related
grok(TUI) instead ofgrok agent --always-approve stdio— agents fail with ENXIO #3457 (open PRs fix(acp): default Grok (and tier-2 presets) to ACP entrypoint args #3458 / fix(acp): register grok preset args for grok-build runtime (#3457) #3521 / fix(acp): launch ACP/stdio mode for managed agents with no runtime preset #3804 cover defaults without--no-leaderor grokShell auth).Test plan
cargo test -p buzz-acp --lib groktauribuild cannot compile the desktop lib here)buzz messages sendsucceeds without/prochunting, and does not attach to an interactivegrokTUI leader