Skip to content

Agent Zero AI framework

fix: prevent stale OAuth model provider selection

Alessandroda505de50af8
diff --git a/plugins/_oauth/webui/config.html b/plugins/_oauth/webui/config.html
index c6153d7be..72177d99d 100644
--- a/plugins/_oauth/webui/config.html
+++ b/plugins/_oauth/webui/config.html
@@ -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"
>
diff --git a/tests/test_oauth_static.py b/tests/test_oauth_static.py
index b45803a64..4dac3b18f 100644
--- a/tests/test_oauth_static.py
+++ b/tests/test_oauth_static.py
@@ -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