From 04ecaac0cd75cb7b8fb20eee34179b20e5971594 Mon Sep 17 00:00:00 2001 From: Alessandro <155005371+3clyp50@users.noreply.github.com> Date: Thu, 2 Jul 2026 11:46:01 +0200 Subject: [PATCH] Add deferred first-send model gate Move missing-model setup out of the welcome screen and into an in-thread gate that preserves the pending prompt, survives refresh, and auto-dispatches after a usable model is configured. Reuse existing onboarding, OAuth account settings, and advanced model configuration surfaces instead of duplicating provider forms. Connected OAuth accounts can now populate Main and Utility defaults when no chat model is configured. Update model readiness checks, focused static regressions, and DOX contracts for the new deferred setup flow. --- plugins/_discovery/AGENTS.md | 1 + .../welcome-actions-end/discovery-cards.html | 2 +- plugins/_model_config/AGENTS.md | 1 + plugins/_model_config/api/model_config_get.py | 8 + .../python/banners/_20_missing_api_key.py | 4 - plugins/_model_config/helpers/model_config.py | 10 + .../_model_config/webui/model-config-store.js | 4 + plugins/_oauth/AGENTS.md | 2 + plugins/_oauth/webui/oauth-config-store.js | 69 ++++- tests/test_model_config_api_keys.py | 38 ++- tests/test_oauth_static.py | 9 + tests/test_welcome_composer_static.py | 61 ++++- webui/components/chat/AGENTS.md | 7 + .../components/chat/input/chat-bar-input.html | 11 +- webui/components/chat/input/chat-bar.html | 74 +----- webui/components/chat/input/input-store.js | 13 +- webui/components/chat/model-gate-store.js | 244 ++++++++++++++++++ webui/components/chat/model-setup-gate.html | 179 +++++++++++++ webui/components/welcome/AGENTS.md | 1 + webui/components/welcome/welcome-screen.html | 151 +---------- webui/components/welcome/welcome-store.js | 18 -- webui/index.js | 55 +++- webui/js/messages.js | 18 ++ 23 files changed, 695 insertions(+), 285 deletions(-) create mode 100644 webui/components/chat/model-gate-store.js create mode 100644 webui/components/chat/model-setup-gate.html diff --git a/plugins/_discovery/AGENTS.md b/plugins/_discovery/AGENTS.md index 0a41f079b..91a769b8b 100644 --- a/plugins/_discovery/AGENTS.md +++ b/plugins/_discovery/AGENTS.md @@ -16,6 +16,7 @@ - CTA actions must match supported welcome-screen action contracts. - Keep card IDs unique and plugin-prefixed. - The Welcome screen `welcome-actions-end` surface renders feature channel cards plus the compact OAuth account-provider card; other hero discovery cards stay out of the lower welcome grid. +- Do not hide discovery cards solely because model setup is incomplete; model setup gating belongs to the chat thread. ## Work Guidance diff --git a/plugins/_discovery/extensions/webui/welcome-actions-end/discovery-cards.html b/plugins/_discovery/extensions/webui/welcome-actions-end/discovery-cards.html index 1d6ad7ca9..23f483b0e 100644 --- a/plugins/_discovery/extensions/webui/welcome-actions-end/discovery-cards.html +++ b/plugins/_discovery/extensions/webui/welcome-actions-end/discovery-cards.html @@ -7,7 +7,7 @@