mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Separate TUI preferences from server configuration (#42202)
## Why TUI preferences and persistence paths belong to the local client, while thread configuration and account requirements may come from the active app server. Keeping both in the same resolved `Config` can replace live local preferences when a thread is resumed, forked, reconnected, or switched. ## What changed - Add `LocalSettings` as the TUI-owned source for UI, history, notice, and local persistence settings, and preserve it across session lifecycle transitions. - Write preference changes to the selected user config file and reload local settings from disk when changing roots. - Use the app server's account response for authentication-dependent onboarding and status UI instead of the local model-provider configuration. - Retain platform family and OS metadata reported by remote app servers. ## Testing - Cover local setting defaults, overrides, persistence destinations, reloads, and preservation across widget replacement and root switching. - Cover remote platform metadata and server-controlled authentication UI. GitOrigin-RevId: dbc2965fb1d6cbecb3f973f6133f3dcd4467b753
This commit is contained in:
1 parent
0b509e930e
commit
9d57be71ba
87 files changed
+1188
-459
No files matched your search
@@ -122,8 +122,13 @@ impl HistoryCell for SessionInfoCell {
|
||||
}
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::too_many_arguments,
|
||||
reason = "keep local preferences separate while the legacy Config parameter is still required"
|
||||
)]
|
||||
pub(crate) fn new_session_info(
|
||||
config: &Config,
|
||||
local_settings: &crate::local_settings::LocalSettings,
|
||||
requested_model: &str,
|
||||
session: &ThreadSessionState,
|
||||
is_first_event: bool,
|
||||
@@ -181,7 +186,7 @@ pub(crate) fn new_session_info(
|
||||
|
||||
parts.push(Box::new(PlainHistoryCell { lines: help_lines }));
|
||||
} else {
|
||||
if config.show_tooltips
|
||||
if local_settings.tui.show_tooltips
|
||||
&& let Some(tooltips) = tooltip_override
|
||||
.or_else(|| tooltips::get_tooltip(auth_plan, show_fast_status))
|
||||
.map(|tip| TooltipHistoryCell::new(tip, &config.cwd))
|
||||
|
||||
@@ -677,6 +677,7 @@ async fn session_info_uses_availability_nux_tooltip_override() {
|
||||
let config = test_config().await;
|
||||
let cell = new_session_info(
|
||||
&config,
|
||||
&crate::local_settings::LocalSettings::from(&config),
|
||||
"gpt-5",
|
||||
&session_configured_event("gpt-5"),
|
||||
/*is_first_event*/ false,
|
||||
@@ -699,6 +700,7 @@ async fn session_info_availability_nux_tooltip_snapshot() {
|
||||
config.cwd = test_path_buf("/tmp/project").abs();
|
||||
let cell = new_session_info(
|
||||
&config,
|
||||
&crate::local_settings::LocalSettings::from(&config),
|
||||
"gpt-5",
|
||||
&session_configured_event("gpt-5"),
|
||||
/*is_first_event*/ false,
|
||||
@@ -716,6 +718,7 @@ async fn session_info_first_event_suppresses_tooltips_and_nux() {
|
||||
let config = test_config().await;
|
||||
let cell = new_session_info(
|
||||
&config,
|
||||
&crate::local_settings::LocalSettings::from(&config),
|
||||
"gpt-5",
|
||||
&session_configured_event("gpt-5"),
|
||||
/*is_first_event*/ true,
|
||||
@@ -735,6 +738,7 @@ async fn session_info_hides_tooltips_when_disabled() {
|
||||
config.show_tooltips = false;
|
||||
let cell = new_session_info(
|
||||
&config,
|
||||
&crate::local_settings::LocalSettings::from(&config),
|
||||
"gpt-5",
|
||||
&session_configured_event("gpt-5"),
|
||||
/*is_first_event*/ false,
|
||||
|
||||
Reference in new issue
Block a user