Skip to content

Commit 7a757b7

Browse files
committed
fix: Claude Code model vars not updated when switching providers
ANTHROPIC_DEFAULT_*_MODEL and CLAUDE_CODE_SUBAGENT_MODEL were using ${VAR:-default} syntax which preserved stale values from previous sessions instead of updating to the new provider's model.
1 parent 51b4a7e commit 7a757b7

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

llm-env

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,11 +1015,11 @@ set_single_provider() {
10151015
# Export Anthropic-specific variables (only set what's configured)
10161016
export ANTHROPIC_BASE_URL="$base"
10171017
export ANTHROPIC_MODEL="$model"
1018-
# Set Claude Code specific model variables to the same model for fallback during Anthropic outage
1019-
export ANTHROPIC_DEFAULT_OPUS_MODEL="${ANTHROPIC_DEFAULT_OPUS_MODEL:-$model}"
1020-
export ANTHROPIC_DEFAULT_SONNET_MODEL="${ANTHROPIC_DEFAULT_SONNET_MODEL:-$model}"
1021-
export ANTHROPIC_DEFAULT_HAIKU_MODEL="${ANTHROPIC_DEFAULT_HAIKU_MODEL:-$model}"
1022-
export CLAUDE_CODE_SUBAGENT_MODEL="${CLAUDE_CODE_SUBAGENT_MODEL:-$model}"
1018+
# Set Claude Code specific model variables to the provider's model
1019+
export ANTHROPIC_DEFAULT_OPUS_MODEL="$model"
1020+
export ANTHROPIC_DEFAULT_SONNET_MODEL="$model"
1021+
export ANTHROPIC_DEFAULT_HAIKU_MODEL="$model"
1022+
export CLAUDE_CODE_SUBAGENT_MODEL="$model"
10231023
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC="${CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:-false}"
10241024

10251025
if [[ -n "$key" ]]; then

0 commit comments

Comments
 (0)