mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
tui_app_server: cancel active login before Ctrl+C exit (#15673)
## Summary Fixes slow `Ctrl+C` exit from the ChatGPT browser-login screen in `tui_app_server`. ## Root cause Onboarding-level `Ctrl+C` quit bypassed the auth widget's cancel path. That let the active ChatGPT login keep running, and in-process app-server shutdown then waited on the stale login attempt before finishing. ## Changes - Extract a shared `cancel_active_attempt()` path in the auth widget - Use that path from onboarding-level `Ctrl+C` before exiting the TUI - Add focused tests for canceling browser-login and device-code attempts - Add app-server shutdown cleanup that explicitly drops any active login before draining background work
This commit is contained in:
committed by
GitHub
Unverified
parent
1b86377635
commit
c023e9d959
@@ -1931,6 +1931,13 @@ impl CodexMessageProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) async fn cancel_active_login(&self) {
|
||||
let mut guard = self.active_login.lock().await;
|
||||
if let Some(active_login) = guard.take() {
|
||||
drop(active_login);
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) async fn clear_all_thread_listeners(&self) {
|
||||
self.thread_state_manager.clear_all_listeners().await;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user