FIX: Fix per-subagent model configs

Louis Giliberto committed May 30, 2026 at 20:12 UTC 45a223dae0895376c470926d722ea31fd0f22c43
2 files changed +12 -4
plugins/_model_config/webui/config.html
+11 -3
@@ -7,12 +7,20 @@
7 </head>
8
9 <body>
10 - <div x-data
10 + <div x-data="{ lastConfig: null }"
11 + x-effect="
12 + if (config && config !== lastConfig) {
13 + lastConfig = config;
14 + $store.modelConfig.initConfigFields(config);
15 + if (typeof context !== 'undefined') {
16 + context.settingsSnapshotJson = context._toComparableJson(config);
17 + }
18 + }
19 + "
20 x-init="
21 await $store.modelConfig.ensureLoaded();
22 $store.modelConfig.resetApiKeyDrafts();
23 await $store.modelConfig.refreshApiKeyStatus();
15 - $store.modelConfig.initConfigFields(config);
24 $store.modelConfig.installSettingsHooks(context, config);
25 ">
26 <template x-if="config && $store.modelConfig._loaded">
@@ -21,7 +29,7 @@
29 <!-- Model Sections (Main, Utility, Embedding) -->
30 <template x-for="section in $store.modelConfig.MODEL_SECTIONS" :key="section.key">
31 <div class="model-section"
24 - x-data="{ model: config[section.key], modelType: section.key.replace('_model', ''), providers: $store.modelConfig.getProviders(section.key), searchType: $store.modelConfig.getSearchType(section.key), apiKeyMode: 'store' }">
32 + x-data="{ get model() { return config[section.key]; }, modelType: section.key.replace('_model', ''), providers: $store.modelConfig.getProviders(section.key), searchType: $store.modelConfig.getSearchType(section.key), apiKeyMode: 'store' }">
33 <div class="section-title" x-text="section.title"></div>
34 <div class="section-description" x-text="section.desc"></div>
35 <x-component path="/plugins/_model_config/webui/model-field.html"></x-component>
plugins/_model_config/webui/model-config-store.js
+1 -1
@@ -311,7 +311,7 @@ export const store = createStore("modelConfig", {
311 context.save = async () => {
312 context.error = null;
313 try {
314 - await this.persistApiKeysForConfig(config);
314 + await this.persistApiKeysForConfig(context.settings);
315 } catch (e) {
316 context.error = e?.message || 'Failed to save API keys.';
317 return;