fix: prioritize ANTHROPIC_MODEL env var over settings.model in model …#505
Merged
benbrandt merged 1 commit intoagentclientprotocol:mainfrom Apr 6, 2026
Merged
fix: prioritize ANTHROPIC_MODEL env var over settings.model in model …#505benbrandt merged 1 commit intoagentclientprotocol:mainfrom
benbrandt merged 1 commit intoagentclientprotocol:mainfrom
Conversation
…selection The getAvailableModels function was not checking the ANTHROPIC_MODEL environment variable, causing it to be ignored when users set model via environment variables. This aligns with the main Claude Code CLI behavior where ANTHROPIC_MODEL takes priority over settings.model. Model priority (highest to lowest): 1. ANTHROPIC_MODEL environment variable 2. settings.model (user configuration) 3. models[0] (default first model)
Contributor
Author
|
I noticed this problem was already reported by another user at #504 - this appears to be the same issue. |
benbrandt
pushed a commit
that referenced
this pull request
Apr 6, 2026
🤖 I have created a release *beep* *boop* --- ## [0.25.2](v0.25.1...v0.25.2) (2026-04-06) ### Bug Fixes * prioritize ANTHROPIC_MODEL env var over settings.model in model … ([#505](#505)) ([bea1a40](bea1a40)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: acp-release-bot[bot] <246668977+acp-release-bot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title:
fix: ANTHROPIC_MODEL env var not respected in ACP agent model selection
Body:
Summary
The
ANTHROPIC_MODELenvironment variable is not being respected when using Claude Code via the ACP (Agent Client Protocol). This causes users who set their preferred model viaenvironment variable to have their setting ignored, with the default model (
claude-sonnet-4-6) being used instead.Problem
When using Claude Code through ACP integrations (e.g., agent platforms), users expect the
ANTHROPIC_MODELenvironment variable to control which model is used for LLM requests.However, the current implementation only checks
settings.model(from configuration files) and completely ignoresANTHROPIC_MODEL.Root Cause
In
src/acp-agent.ts, thegetAvailableModelsfunction only checkssettings.model: