Describe the bug
Setting a model for a Claude Code harness agent in Buzz Desktop (agent edit → model picker) persists the selection but never applies it: the spawned session runs on the user's global Claude Code default (~/.claude/settings.json / account default) instead. No error, no warning — the agent simply answers as a different model than the one configured.
Observed on Buzz Desktop 0.4.24 (macOS): a stock agent set to Sonnet reports claude-fable-5 in-session, across restarts.
Root cause
The model reaches spawned agents through runtime_metadata_env_vars (desktop/src-tauri/src/managed_agents/runtime.rs), which injects (model_env_var, effective_model) — but only when the runtime declares a model_env_var. The claude entry in KNOWN_ACP_RUNTIMES (desktop/src-tauri/src/managed_agents/discovery.rs) declares:
supports_acp_model_switching: false,
model_env_var: None,
provider_env_var: None,
provider_locked: true,
So for Claude Code there is no channel at all from the persisted model to the session: no env var, no ACP model switch. Goose (GOOSE_MODEL) and Buzz Agent (BUZZ_AGENT_MODEL) both have one. Meanwhile the model picker UI happily lists Anthropic models for the claude harness (discover_anthropic_models in commands/agent_models.rs) and persists the choice — a selection surface with no application path behind it.
Notably the readiness checker already knows the right key — readiness.rs maps Some("anthropic") => Some("ANTHROPIC_MODEL") — it's only the spawn-time runtime entry that lacks it.
Suggested fix
model_env_var: Some("ANTHROPIC_MODEL") on the claude runtime entry. The Claude Code CLI honors ANTHROPIC_MODEL as a session model override (verified locally: ANTHROPIC_MODEL=claude-sonnet-5 claude --print "…model id…" → claude-sonnet-5), and the ACP adapter's child claude process inherits the spawn env. provider_locked: true already keeps provider injection off, which is correct for this harness.
If that's adopted, ANTHROPIC_MODEL should probably also join DERIVED_PROVIDER_MODEL_ENV_KEYS (managed_agents/env_vars.rs) so a stale persisted copy can't shadow later UI edits — same treatment as GOOSE_MODEL/BUZZ_AGENT_MODEL.
Workaround
Until fixed, add ANTHROPIC_MODEL=<model-id> as a custom env var on the agent (edit agent → environment variables) and restart it.
To Reproduce
- Create/edit a Claude Code harness agent in Buzz Desktop; set model to any non-default (e.g. Sonnet).
- Restart the agent, ask it what model it runs on.
- It reports the user's global Claude Code default, not the configured model.
Environment
- Buzz Desktop 0.4.24 (official Block-signed build), macOS (Intel), Darwin 25.5.0
- Claude Code harness via
claude-agent-acp
- Repo state:
block/buzz @ 06e3d82b
Describe the bug
Setting a model for a Claude Code harness agent in Buzz Desktop (agent edit → model picker) persists the selection but never applies it: the spawned session runs on the user's global Claude Code default (
~/.claude/settings.json/ account default) instead. No error, no warning — the agent simply answers as a different model than the one configured.Observed on Buzz Desktop 0.4.24 (macOS): a stock agent set to Sonnet reports
claude-fable-5in-session, across restarts.Root cause
The model reaches spawned agents through
runtime_metadata_env_vars(desktop/src-tauri/src/managed_agents/runtime.rs), which injects(model_env_var, effective_model)— but only when the runtime declares amodel_env_var. Theclaudeentry inKNOWN_ACP_RUNTIMES(desktop/src-tauri/src/managed_agents/discovery.rs) declares:So for Claude Code there is no channel at all from the persisted model to the session: no env var, no ACP model switch. Goose (
GOOSE_MODEL) and Buzz Agent (BUZZ_AGENT_MODEL) both have one. Meanwhile the model picker UI happily lists Anthropic models for the claude harness (discover_anthropic_modelsincommands/agent_models.rs) and persists the choice — a selection surface with no application path behind it.Notably the readiness checker already knows the right key —
readiness.rsmapsSome("anthropic") => Some("ANTHROPIC_MODEL")— it's only the spawn-time runtime entry that lacks it.Suggested fix
model_env_var: Some("ANTHROPIC_MODEL")on theclauderuntime entry. The Claude Code CLI honorsANTHROPIC_MODELas a session model override (verified locally:ANTHROPIC_MODEL=claude-sonnet-5 claude --print "…model id…"→claude-sonnet-5), and the ACP adapter's childclaudeprocess inherits the spawn env.provider_locked: truealready keeps provider injection off, which is correct for this harness.If that's adopted,
ANTHROPIC_MODELshould probably also joinDERIVED_PROVIDER_MODEL_ENV_KEYS(managed_agents/env_vars.rs) so a stale persisted copy can't shadow later UI edits — same treatment asGOOSE_MODEL/BUZZ_AGENT_MODEL.Workaround
Until fixed, add
ANTHROPIC_MODEL=<model-id>as a custom env var on the agent (edit agent → environment variables) and restart it.To Reproduce
Environment
claude-agent-acpblock/buzz@06e3d82b