Skip to content

Fixed stale model aliases in model selector after profile type switch - #148

Merged
oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/stale-model-aliases-after-profile-type-switch
Jun 1, 2026
Merged

oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/stale-model-aliases-after-profile-type-switch

Conversation

@oleg68

@oleg68 oleg68 commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • When a profile had model aliases / custom models configured under Claude Compatible API and the user switched the profile to Managed by Claude, the stored aliases were never cleared
  • On the next session, customModels were loaded into customModelIds and appeared in the model combo box; modelAliases were also incorrectly injected as ANTHROPIC_DEFAULT_*_MODEL env vars into the claude process

Two fixes:

  1. ClaudeProfilesPanel.flushFormToCurrentProfile() — clear modelAliases and customModels when saving a connection type that does not support them (anything other than OTHER_API / OPENAI_PROXY)
  2. ClaudeProfile.toEnvVars() — guard ANTHROPIC_DEFAULT_*_MODEL injection so aliases are only emitted for OTHER_API and OPENAI_PROXY connections

Test plan

  • mvn test passes (873 tests, 0 failures)
  • Create a profile with Claude Compatible API, add model aliases via Model Aliases…, save → switch the same profile to Managed by Claude, save → open a new session: verify the model combo contains only standard models and no stale aliases
  • Verify that Model Aliases… dialog for the switched profile is empty

🤖 Generated with Claude Code

…e switch

When a profile had model aliases/custom models configured under
"Claude Compatible API" and was then switched to "Managed by Claude",
the stored aliases were never cleared. On the next session, customModels
were loaded into customModelIds and appeared in the model combo box;
modelAliases were also incorrectly injected as ANTHROPIC_DEFAULT_*_MODEL
env vars into the claude process.

Two fixes:
1. ClaudeProfilesPanel.flushFormToCurrentProfile(): clear modelAliases
   and customModels when saving a connection type that does not support
   them (anything other than OTHER_API / OPENAI_PROXY).
2. ClaudeProfile.toEnvVars(): guard ANTHROPIC_DEFAULT_*_MODEL injection
   so aliases are only emitted for OTHER_API and OPENAI_PROXY connections.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@oleg68
oleg68 merged commit da44434 into nbplugins:main Jun 1, 2026
3 checks passed
@oleg68
oleg68 deleted the bugfix/stale-model-aliases-after-profile-type-switch branch June 1, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant