Skip to content

fix(desktop): apply Claude models and run Windows installers natively - #2696

Closed
tagadearpit wants to merge 1 commit into
block:mainfrom
tagadearpit:agent/fix-claude-model-and-windows-installer
Closed

fix(desktop): apply Claude models and run Windows installers natively#2696
tagadearpit wants to merge 1 commit into
block:mainfrom
tagadearpit:agent/fix-claude-model-and-windows-installer

Conversation

@tagadearpit

Copy link
Copy Markdown

Summary

  • inject ANTHROPIC_MODEL from the structured Claude Code model picker at spawn time
  • treat ANTHROPIC_MODEL as derived configuration so stale custom environment values cannot override later picker changes
  • run catalogued Windows PowerShell installers directly instead of routing them through Git Bash, preventing MSYS path conversion from corrupting native installer paths
  • add regression coverage for model injection and native PowerShell command construction

Root cause

Claude Code's runtime catalog had no model environment variable, so the picker value was saved but never reached the spawned Claude process. On Windows, Claude and Codex installer scripts were invoked through Git Bash; MSYS path conversion could turn C: paths into invalid arguments for native tools such as tar.

Closes #2692
Closes #2688

Issue #2690 is intentionally not duplicated here: upstream PR #2694 already addresses the macOS artifact-name collision.

Validation

  • cargo fmt --all -- --check
  • git diff --check
  • verified upstream comparison: one commit ahead of block/buzz:main, with only the five intended files
  • targeted Rust tests could not link in this Linux workspace because pkg-config and the required GLib/GObject development libraries are unavailable; CI should run the full platform matrix.

Signed-off-by: Arpit Tagade <143588157+tagadearpit@users.noreply.github.com>
@wpfleger96

Copy link
Copy Markdown
Member

🤖 hey @tagadearpit — thank you for this contribution. Closing it, with a note on each half, since it's really two changes and they land differently.

The Windows installer half is superseded by #2750 (f3981dbfe). Main's is_powershell_command does a case-insensitive check on the first token, so it matches any PowerShell invocation, where your powershell_install_script matched one exact literal command prefix. Same intent, and main's version handles more shapes of the command.

The Claude half — setting model_env_var: Some("ANTHROPIC_MODEL") and adding it to DERIVED_PROVIDER_MODEL_ENV_KEYS — is a separate question, and it's still unaddressed on main (claude currently has model_env_var: None). I don't want to silently drop it, but I also don't want it merged as a side effect of a Windows fix, since it changes model-selection behavior for every Claude user and deserves review on that basis. Could you open it as its own PR with a short note on what it fixes for you? That one I'll get proper eyes on.

@wpfleger96 wpfleger96 closed this Jul 26, 2026
wpfleger96 pushed a commit that referenced this pull request Jul 28, 2026
…itch (#2795)

## Summary

Fixes #2794. Related: #2692.

`resolve_model_switch_method()` reads the `configId` key from each
`session/new` `configOptions` entry and skips entries that lack it.
`claude-agent-acp` (v0.61.0) keys its entries with `id`, so every
model-category entry was skipped, the desired model never matched, and
Claude Code sessions fell back to the CLI default from the user's
`~/.claude/settings.json`. The only trace was a `pool::model` WARN that
never reaches the per-agent log files.

This is the ACP-side half of the symptom reported in #2692. The open
desktop-side PRs (#2695, #2701, #2696) inject `ANTHROPIC_MODEL` at
spawn, which masks the problem for spawn-time selection but leaves the
config-option switch path broken.

## Changes

- `resolve_model_switch_method()` accepts either `configId` or `id` when
extracting the config id. The set request is unchanged: the ACP SDK
schema takes `configId` as the request param and the adapter resolves it
against its `id`-keyed entries, so only the read side needed fixing.
- Regression test with an `id`-keyed `configOptions` payload mirroring
the real adapter response (including `models: null`, so the unstable
fallback path cannot rescue the match).
- Doc comment on `extract_model_config_options()` notes the key drift.

## Testing

`cargo test -p buzz-acp --lib`: 599 passed, 0 failed. The new test fails
on main and passes with this change.

Verified against the real adapter: a stdio JSON-RPC probe of the bundled
`claude-agent-acp` 0.61.0 confirms `session/new` returns `id`-keyed
config options with `opus[1m]` present as a value, and the SDK's
`SetSessionConfigOptionRequest` schema accepts `{sessionId, configId,
value}` as sent by `session_set_config_option()`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: chillerno1 <gh.chiller@pm.me>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants