From 986c1b1cee7f47417758d989517d8fa58528b887 Mon Sep 17 00:00:00 2001 From: frdel <38891707+frdel@users.noreply.github.com> Date: Tue, 24 Mar 2026 19:17:12 +0100 Subject: [PATCH] Refactor default presets, fix chardet version conflict, improve welcome banner refresh logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rename presets: "Efficiency" → "Max Power", "Intelligence" → "Balance", add "Cost Efficient" - Update preset models: use Claude Opus 4.6, Sonnet 4.6, Kimi K2.5, GPT-5.4-mini/nano, Gemini 3.1 Flash Lite - Adjust context lengths and vision capabilities across presets - Pin chardet<6 to avoid import warnings from requests when unstructured is installed - Replace settings-updated listener with modal-closed event --- plugins/_model_config/default_presets.yaml | 54 ++++++++++++++-------- requirements2.txt | 5 +- webui/components/welcome/welcome-store.js | 8 ++-- webui/js/modals.js | 9 ++++ 4 files changed, 53 insertions(+), 23 deletions(-) diff --git a/plugins/_model_config/default_presets.yaml b/plugins/_model_config/default_presets.yaml index 1a575dff9..1d20b6232 100644 --- a/plugins/_model_config/default_presets.yaml +++ b/plugins/_model_config/default_presets.yaml @@ -1,31 +1,47 @@ -- name: "Efficiency" - chat: - provider: "openrouter" - name: "openai/gpt-5.2-chat" - api_key: "" - api_base: "" - ctx_length: 128000 - ctx_history: 0.7 - vision: true - utility: - provider: "openrouter" - name: "openai/gpt-5-nano" - api_key: "" - api_base: "" - ctx_length: 128000 - ctx_input: 0.7 -- name: "Intelligence" +- name: "Max Power" chat: provider: "openrouter" name: "anthropic/claude-opus-4.6" api_key: "" api_base: "" - ctx_length: 128000 + ctx_length: 200000 ctx_history: 0.7 vision: true utility: provider: "openrouter" - name: "google/gemini-3-flash-preview" + name: "openai/gpt-5.4-mini" + api_key: "" + api_base: "" + ctx_length: 128000 + ctx_input: 0.7 +- name: "Balance" + chat: + provider: "openrouter" + name: "anthropic/claude-sonnet-4.6" + api_key: "" + api_base: "" + ctx_length: 200000 + ctx_history: 0.7 + vision: true + utility: + provider: "openrouter" + name: "google/gemini-3.1-flash-lite-preview" + api_key: "" + api_base: "" + ctx_length: 128000 + ctx_input: 0.7 +- name: "Cost Efficient" + chat: + provider: "openrouter" + name: "moonshotai/kimi-k2.5" + api_key: "" + api_base: "" + ctx_length: 128000 + ctx_history: 0.7 + vision: false + utility: + provider: "openrouter" + name: "openai/gpt-5.4-nano" api_key: "" api_base: "" ctx_length: 128000 diff --git a/requirements2.txt b/requirements2.txt index 7256765d8..859237a09 100644 --- a/requirements2.txt +++ b/requirements2.txt @@ -1,2 +1,5 @@ litellm==1.79.3 -openai==1.99.5 \ No newline at end of file +openai==1.99.5 +# `unstructured` pulls `chardet` without an upper bound, but `requests` +# warns on import when chardet>=6 is present in the same environment. +chardet<6 diff --git a/webui/components/welcome/welcome-store.js b/webui/components/welcome/welcome-store.js index b82e33266..5d9185894 100644 --- a/webui/components/welcome/welcome-store.js +++ b/webui/components/welcome/welcome-store.js @@ -18,9 +18,11 @@ const model = { }, init() { - // Reload banners when settings change - document.addEventListener("settings-updated", () => { - this.refreshBanners(true); + // Reload banners when a modal closes while the welcome screen is visible. + document.addEventListener("modal-closed", () => { + if (this.isVisible) { + this.refreshBanners(true); + } }); }, diff --git a/webui/js/modals.js b/webui/js/modals.js index 2cd4b0ad6..c4e444a80 100644 --- a/webui/js/modals.js +++ b/webui/js/modals.js @@ -306,6 +306,15 @@ export async function closeModal(modalPath = null) { restoreModalScrollSnapshot(modalStack[modalStack.length - 1]); } + document.dispatchEvent( + new CustomEvent("modal-closed", { + detail: { + modalPath: modal.path ?? null, + remainingModalCount: modalStack.length, + }, + }), + ); + return true; }); }