From 2ba77e3aa30c9ffab4763709cfd4b9590566ce68 Mon Sep 17 00:00:00 2001 From: pewdiepie-archdaemon Date: Fri, 5 Jun 2026 14:41:54 +0900 Subject: [PATCH] Settings polish: /setup provider subs, Add API defaults to api kind, picker shows offline endpoints, doc library tracks sub-tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - /setup gains explicit provider subcommands (deepseek, openai, anthropic, openrouter, groq, gemini, xai, ollama, copilot, local, endpoint) so the autocomplete popup surfaces "/setup de…" suggestions with format hints, and bare-provider invocations still prompt for the key. - Add API endpoint defaults to kind=api (auto-refresh /v1/models) instead of kind=proxy. Proxy was a frequent footgun for OpenAI- compatible endpoints that DO serve /v1/models — the user got an empty model list and had to flip the dropdown. - Model picker now includes offline endpoints with stale:true so a briefly-down local server doesn't vanish from the picker (it dims and shows the offline pill, clickable anyway). Dedup prefers the online entry when the same model is exposed by both. - Document library modal header reflects the active sub-tab via _TAB_HEADERS so it no longer shows the wrong section name when switching between Documents / Skills / Templates. --- static/js/admin.js | 6 ++-- static/js/documentLibrary.js | 41 ++++++++++++++++++++++++++-- static/js/modelPicker.js | 53 ++++++++++++++++++++++++++---------- static/js/slashCommands.js | 36 ++++++++++++++++++++++-- 4 files changed, 114 insertions(+), 22 deletions(-) diff --git a/static/js/admin.js b/static/js/admin.js index 25e3faa..5019096 100644 --- a/static/js/admin.js +++ b/static/js/admin.js @@ -731,14 +731,14 @@ function initEndpointForm() { urlInput.addEventListener('input', () => { if (provider.value && urlInput.value.trim() !== provider.value) { provider.value = ''; - if (kindSel) kindSel.value = 'proxy'; + if (kindSel) kindSel.value = 'api'; _renderPickerMenu(); _syncPickerCurrent(); } }); - if (kindSel) kindSel.value = provider.value ? 'api' : (kindSel.value || 'proxy'); + if (kindSel) kindSel.value = kindSel.value || 'api'; function _apiEndpointKind() { - return (kindSel && kindSel.value) ? kindSel.value : (provider.value ? 'api' : 'proxy'); + return (kindSel && kindSel.value) ? kindSel.value : 'api'; } function _normalizeBaseUrl(raw) { let u = raw.trim(); diff --git a/static/js/documentLibrary.js b/static/js/documentLibrary.js index 0341594..642a91f 100644 --- a/static/js/documentLibrary.js +++ b/static/js/documentLibrary.js @@ -1598,7 +1598,11 @@ let _libraryArchivedView = false; // Documents tab showing archived docs? modal.innerHTML = `