Skip to content

[Bug] Claude Code agents ignore the model set in Buzz Desktop — model picker persists but nothing applies it at spawn #2692

Description

@bosoud

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

  1. Create/edit a Claude Code harness agent in Buzz Desktop; set model to any non-default (e.g. Sonnet).
  2. Restart the agent, ask it what model it runs on.
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions