mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Discover TUI collaboration modes from the app server (#42401)
## What changed - Fetch `collaborationMode/list` during TUI startup and reconnect, and use the returned catalog for visible collaboration-mode selection. - Keep collaboration-mode discovery optional with a two-second timeout so an unavailable, invalid, or unsupported response does not block bootstrap. - Preserve discovered modes when the model catalog refreshes, clear restored developer-instruction overrides when selecting a server mode, and retain a `/plan` draft when plan mode is unavailable. ## Testing - Cover optional discovery failures and catalog refresh on reconnect. - Cover server mode selection, model refreshes, restored settings, and unavailable plan mode. GitOrigin-RevId: a6e35c14aab2e38526606164091ac64c500151bb
This commit is contained in:
1 parent
54a4077c8b
commit
d4dc882998
15 files changed
+292
-22
No files matched your search
@@ -8,6 +8,10 @@ mod history;
|
||||
mod models;
|
||||
mod rollout_history;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "app_server_session/collaboration_catalog_tests.rs"]
|
||||
mod collaboration_catalog_tests;
|
||||
|
||||
pub(crate) use history::HISTORY_ITEM_PAGE_LIMIT;
|
||||
pub(crate) use history::HISTORY_ITEM_SCAN_LIMIT;
|
||||
pub(crate) use history::HistoryHydrationScope;
|
||||
@@ -290,6 +294,7 @@ pub(crate) struct AppServerBootstrap {
|
||||
pub(crate) feedback_audience: FeedbackAudience,
|
||||
pub(crate) has_chatgpt_account: bool,
|
||||
pub(crate) available_models: Vec<ModelPreset>,
|
||||
pub(crate) collaboration_modes: Vec<codex_protocol::config_types::CollaborationModeMask>,
|
||||
}
|
||||
|
||||
pub(crate) struct AppServerSession {
|
||||
@@ -560,7 +565,7 @@ impl AppServerSession {
|
||||
// requirements together so an uncached model fetch can overlap both config requests.
|
||||
let model_request_id = self.next_request_id();
|
||||
let requirements_request_id = self.next_request_id();
|
||||
let (models, requirements) = tokio::try_join!(
|
||||
let (models, requirements, collaboration_modes) = tokio::try_join!(
|
||||
async {
|
||||
self.client
|
||||
.request_typed::<ModelListResponse>(ClientRequest::ModelList {
|
||||
@@ -592,6 +597,7 @@ impl AppServerSession {
|
||||
)
|
||||
})
|
||||
},
|
||||
async { Ok(crate::collaboration_modes::list(self.request_handle()).await) },
|
||||
)?;
|
||||
self.managed_new_thread_defaults = requirements
|
||||
.requirements
|
||||
@@ -669,6 +675,7 @@ impl AppServerSession {
|
||||
feedback_audience,
|
||||
has_chatgpt_account,
|
||||
available_models,
|
||||
collaboration_modes,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user