fix: prevent stale OAuth model provider selection

Render the OAuth model provider select as unchosen when the stored model slot still points at a non-connected or non-OAuth provider. This avoids showing Codex/ChatGPT as selected while the model input remains disabled, keeping account-backed model selection explicit.
This commit is contained in:
Alessandro 2026-07-02 16:53:18 +02:00
parent 0a9e15be87
commit da505de50a
2 changed files with 2 additions and 1 deletions

View file

@ -217,7 +217,7 @@
<label class="oauth-model-provider-field">
<span>Provider</span>
<select
:value="$store.oauthConfig.modelSlot(slot.key).provider"
:value="$store.oauthConfig.slotCanUseModels(slot.key) ? $store.oauthConfig.modelSlot(slot.key).provider : ''"
@change="$store.oauthConfig.useProviderForSlot(slot.key, $event.target.value)"
:disabled="!$store.oauthConfig.connectedProviderCards().length"
>

View file

@ -23,6 +23,7 @@ def test_oauth_settings_exposes_provider_cards_and_model_slots():
assert "slotProviderChoices(slot.key)" in config_html
assert "connectedProviderCards().length" in config_html
assert "useProviderForSlot(slot.key, $event.target.value)" in config_html
assert ":value=\"$store.oauthConfig.slotCanUseModels(slot.key) ? $store.oauthConfig.modelSlot(slot.key).provider : ''\"" in config_html
assert "slotCanUseModels(slot.key)" in config_html
assert "<span>Account</span>" not in config_html
assert "oauth-connected-panel" not in config_html