Use the active thread's provider in the TUI model picker (#63553)

## Why

A resumed thread can use a different model provider from the app server's
default. A single catalog can show models from the wrong provider when the
user opens `/model` in that thread.

## What changed

Fetch and cache model lists by provider on servers that support provider
selection, and clear cached lists when the account changes. Keep the server's
default catalog available for new threads.

Apply model choices for alternate providers to the current session only.
When a non-Cloud server's catalog cannot be scoped to a provider, show the
server's default models and limit changes to the current session as well.

## Testing

Cover provider-scoped requests, fallback to unscoped lists, session-only
picker actions, and preservation of new-thread defaults after refreshing an
alternate provider's catalog.

GitOrigin-RevId: 9e82c99613dba5de73cb2210dc61835b812cedf5
This commit is contained in:
Abhinav
2026-11-24 06:15:04 +00:00
committed by copyberry
parent baf9b39b16
commit 9038698ffa
58 changed files with 658 additions and 167 deletions
@@ -258,8 +258,8 @@ impl ChatWidget {
self.add_error_message("Daybreak requires the OpenAI provider with either ChatGPT sign-in or an API key with Daybreak support enabled.".into());
return;
}
if !crate::daybreak::available(&self.model_catalog.models) {
if crate::daybreak::availability(&self.model_catalog.models) == Some(false)
if !crate::daybreak::available(self.model_catalog.models()) {
if crate::daybreak::availability(self.model_catalog.models()) == Some(false)
{
self.add_info_message(
"Daybreak is not available for this account. Apply at https://openai.com/form/enterprise-trusted-access-for-cyber/. Learn more at https://help.openai.com/en/articles/20001326.".into(),