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
@@ -482,8 +482,8 @@ impl App {
|
||||
/// Persist prompt text in the local cross-session message history.
|
||||
pub(super) fn append_message_history_entry(&self, thread_id: ThreadId, text: String) {
|
||||
let history_config = codex_message_history::HistoryConfig::new(
|
||||
self.chat_widget.config_ref().codex_home.clone(),
|
||||
&self.chat_widget.config_ref().history,
|
||||
self.local_settings.codex_home.clone(),
|
||||
&self.local_settings.history,
|
||||
);
|
||||
tokio::spawn(async move {
|
||||
if let Err(err) =
|
||||
@@ -506,8 +506,8 @@ impl App {
|
||||
log_id: u64,
|
||||
) -> Result<()> {
|
||||
let history_config = codex_message_history::HistoryConfig::new(
|
||||
self.chat_widget.config_ref().codex_home.clone(),
|
||||
&self.chat_widget.config_ref().history,
|
||||
self.local_settings.codex_home.clone(),
|
||||
&self.local_settings.history,
|
||||
);
|
||||
let app_event_tx = self.app_event_tx.clone();
|
||||
tokio::spawn(async move {
|
||||
@@ -540,8 +540,8 @@ impl App {
|
||||
log_id: u64,
|
||||
) -> Result<()> {
|
||||
let history_config = codex_message_history::HistoryConfig::new(
|
||||
self.chat_widget.config_ref().codex_home.clone(),
|
||||
&self.chat_widget.config_ref().history,
|
||||
self.local_settings.codex_home.clone(),
|
||||
&self.local_settings.history,
|
||||
);
|
||||
let app_event_tx = self.app_event_tx.clone();
|
||||
tokio::spawn(async move {
|
||||
@@ -1417,6 +1417,7 @@ impl App {
|
||||
|
||||
match app_server
|
||||
.resume_thread(
|
||||
&self.local_settings,
|
||||
self.config.clone(),
|
||||
thread_id,
|
||||
crate::app_server_session::ResumeModelSettings::PreserveExistingThread,
|
||||
|
||||
Reference in new issue
Block a user