feat(desktop): add first-class Grok Build ACP runtime support - #5742
feat(desktop): add first-class Grok Build ACP runtime support#5742ravz wants to merge 3 commits into
Conversation
Adds a genuine 'grok' runtime to the managed-agent catalog and bridges the
managed model into Grok Build's subscription-backed ACP argv
`grok agent --model <model> stdio` as discrete arguments (never shell
interpolated). The model is not an env var for Grok (provider locked;
model_env_var None); it travels in the argv via the harness config bridge.
- crates/buzz-acp: default_agent_args('grok') = the pinned grok-4.6 argv;
new effective_agent_args() substitutes the managed model as a discrete
argument, fails closed on an empty model, and leaves every other runtime
byte-identical to normalize_agent_args(). Deterministic unit tests cover
the pinned default, model substitution, empty-model fail-closed, .exe
identity normalization, explicit-args precedence and non-grok behavior.
- desktop: KNOWN_ACP_RUNTIMES 'grok' entry (provider_locked, no model env
var, required normalized model), ~/.grok/bin added to binary discovery
paths, desktop default_agent_args mirror, and catalog metadata tests.
No default runtime preference order change, no alias, no PATH dependence
when the official binary is discovered, no API key/credential path, no
unmanaged child (supervised spawn unchanged).
Co-authored-by: Rav Panchalingam <rav@risebt.com.au>
Signed-off-by: Rav Panchalingam <rav@risebt.com.au>
Root cause (Nyx FAIL 8e8d2528): the desktop emitted a non-empty pinned
default agent_args for grok ('agent --model grok-4.6 stdio'), which was
exported as BUZZ_ACP_AGENT_ARGS and took precedence over BUZZ_ACP_MODEL
in effective_agent_args — so an alternate managed model was accepted,
stored and displayed but silently ignored.
Fix: the desktop now emits NO default agent_args for grok (normalize
returns empty; BUZZ_ACP_AGENT_ARGS is empty/absent), so buzz-acp's
effective_agent_args builds the exact argv ['agent','--model',model,
'stdio'] from the managed model (BUZZ_ACP_MODEL), default grok-4.6.
An operator-supplied explicit agent_args remains distinguishable and
wins. Blank model fails closed. The discovery comment now states the
real contract instead of the false bridge claim.
Regression coverage:
- desktop runtime_metadata: grok emits no default args; explicit
override passes through.
- buzz-acp config integration tests through the real clap env/flags
boundary -> Config::from_args -> effective_agent_args -> child argv:
managed grok-4.6, alternate grok-5, blank-model fail-closed, explicit
override precedence. 8/8 grok tests pass; full lib 752/28 vs base
740/31 — zero new failures, none grok-related.
Co-authored-by: Rav Panchalingam <rav@risebt.com.au>
Signed-off-by: Rav Panchalingam <rav@risebt.com.au>
|
separately: the default model is pinned in two places, |
Signed-off-by: Rav Panchalingam <rav@risebt.com.au>
|
Addressed both points in f0d73ce.
Local verification:
The full desktop crate still cannot link on this Windows host because the unrelated native |
Summary
Adds first-class Grok Build ACP runtime support to the managed-agent catalog and supervised launch path, pinned to the subscription-backed ACP argv contract
grok agent --model <model> stdio(discrete arguments, never shell-interpolated, no API-key/credit fallback — the child inherits only the existing local grok.com session).Harness (
crates/buzz-acp/src/config.rs)default_agent_args("grok")= the pinned["agent", "--model", "grok-4.6", "stdio"]default.effective_agent_args(command, agent_args, model)bridges the managed model into the argv as a discrete argument, fails closed on an empty model, and leaves every other runtime byte-identical tonormalize_agent_args. Explicitagent_argswin..exeidentity normalization, explicit-args precedence, non-grok behavior unchanged.Desktop (
desktop/src-tauri/src/managed_agents/discovery.rs+runtime_metadata.rs)grokentry inKNOWN_ACP_RUNTIMES: provider locked,model_env_var: None(model travels in argv, not env),required_normalized_fields: ["model"], direct ACP runtime (no adapter), login hint.~/.grok/binadded to binary discovery paths (official Grok Build install layout, matching the existing per-runtime well-known-path probes).default_agent_argsmirror + catalog metadata tests.Invariants preserved: no change to the default runtime preference order (
getDefaultPersonaRuntimeuntouched), no alias, no PATH dependence when the exact official binary is discovered, no shell string, no ambient API key, supervised one-child spawn unchanged (identity, system prompt, policy, queue, locks, timeout, cancellation all remain buzz-acp-owned).Local verification (Windows host):
cargo fmt --checkclean;cargo test -p buzz-acp --libat head: 759 passed / 17 failed, and the failure set is a strict subset of the base failure set (31 failures at base — timing/env-sensitive steer tests on this host;BUZZ_ACP_*ambient env), i.e. zero new failures attributable to this change; all new grok tests pass. Desktop crate full suite not runnable locally: the native build dependencycmakeis absent on this host (nocmakeanywhere on PATH/MSYS2); CI is authoritative for the desktop suite.