From ed0601b15b40ff2453d2cf571b38037ff8d72f89 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Sat, 14 Mar 2026 14:44:04 -0600 Subject: [PATCH] Remove reload auth --- codex-rs/app-server-client/src/lib.rs | 9 --------- codex-rs/tui/src/onboarding/account_login.rs | 1 - .../src/onboarding/auth/headless_chatgpt_login.rs | 6 ++---- codex-rs/tui/src/onboarding/onboarding_screen.rs | 13 ------------- 4 files changed, 2 insertions(+), 27 deletions(-) diff --git a/codex-rs/app-server-client/src/lib.rs b/codex-rs/app-server-client/src/lib.rs index 2fcdefedea..dfa504b2df 100644 --- a/codex-rs/app-server-client/src/lib.rs +++ b/codex-rs/app-server-client/src/lib.rs @@ -576,15 +576,6 @@ impl InProcessAppServerClient { })? } - /// Reloads managed auth state from disk for the embedded runtime. - /// - /// This keeps embedders off direct `AuthManager` access while still - /// allowing onboarding flows to observe auth changes performed outside the - /// app-server request path. - pub fn reload_auth_from_storage(&self) -> bool { - self.shared_core.auth_manager.reload() - } - /// Returns the next in-process event, or `None` when worker exits. /// /// Callers are expected to drain this stream promptly. If they fall behind, diff --git a/codex-rs/tui/src/onboarding/account_login.rs b/codex-rs/tui/src/onboarding/account_login.rs index c1d872252f..e7b5b32067 100644 --- a/codex-rs/tui/src/onboarding/account_login.rs +++ b/codex-rs/tui/src/onboarding/account_login.rs @@ -17,7 +17,6 @@ pub(crate) enum AuthCommand { StartApiKey { api_key: String }, StartChatgpt, CancelChatgpt { login_id: String }, - ReloadManagedChatgptAuth, DeviceCodeFailed { message: String }, } diff --git a/codex-rs/tui/src/onboarding/auth/headless_chatgpt_login.rs b/codex-rs/tui/src/onboarding/auth/headless_chatgpt_login.rs index 68f9ec264c..08e17f9496 100644 --- a/codex-rs/tui/src/onboarding/auth/headless_chatgpt_login.rs +++ b/codex-rs/tui/src/onboarding/auth/headless_chatgpt_login.rs @@ -63,14 +63,12 @@ pub(super) fn start_headless_chatgpt_login(widget: &mut AuthModeWidget, opts: Se result = complete_device_code_login(opts, device_code) => { match result { Ok(()) => { - if set_device_code_state_for_active_attempt( + let _ = set_device_code_state_for_active_attempt( &sign_in_state, &request_frame, &cancel, SignInState::ChatGptSuccessMessage, - ) { - let _ = auth_command_tx.send(AuthCommand::ReloadManagedChatgptAuth); - } + ); } Err(err) => { if set_device_code_state_for_active_attempt( diff --git a/codex-rs/tui/src/onboarding/onboarding_screen.rs b/codex-rs/tui/src/onboarding/onboarding_screen.rs index 7a97003b3e..9456a54d58 100644 --- a/codex-rs/tui/src/onboarding/onboarding_screen.rs +++ b/codex-rs/tui/src/onboarding/onboarding_screen.rs @@ -576,19 +576,6 @@ async fn handle_auth_command( tracing::warn!("failed to cancel onboarding login: {err}"); } } - AuthCommand::ReloadManagedChatgptAuth => { - app_server.reload_auth_from_storage(); - match account_api.read_account(app_server).await { - Ok(response) => { - if let Some(auth_widget) = onboarding_screen.auth_widget_mut() { - auth_widget.apply_account(response.account.as_ref()); - } - } - Err(err) => { - tracing::warn!("failed to refresh managed auth after device code login: {err}") - } - } - } AuthCommand::DeviceCodeFailed { message } => { if let Some(auth_widget) = onboarding_screen.auth_widget_mut() { auth_widget.show_device_code_login_error(message);