mirror of
https://github.com/openai/codex.git
synced 2026-11-24 23:20:47 +00:00
Remove no-op rate limit polling hooks from the TUI (#63661)
## What changed Remove `ChatWidget`'s prefetch and poller shutdown hooks from widget creation, teardown, and the transition to background voice mode. Prefetch only called the empty shutdown hook. GitOrigin-RevId: c25c33a53d63be982d8cfebf405401a4c4f0e0c4
This commit is contained in:
@@ -2142,7 +2142,6 @@ impl Drop for ChatWidget {
|
||||
self.app_event_tx
|
||||
.send(AppEvent::StopRealtimeConversation { thread_id });
|
||||
}
|
||||
self.stop_rate_limit_poller();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -331,7 +331,6 @@ impl ChatWidget {
|
||||
widget.local_settings.codex_home.as_path(),
|
||||
widget.local_settings.history.persistence,
|
||||
);
|
||||
widget.prefetch_rate_limits();
|
||||
if let Some(keymap) = runtime_keymap {
|
||||
widget.bottom_pane.set_keymap_bindings(&keymap);
|
||||
}
|
||||
|
||||
@@ -457,13 +457,6 @@ impl ChatWidget {
|
||||
self.refresh_status_line();
|
||||
}
|
||||
|
||||
pub(super) fn stop_rate_limit_poller(&mut self) {}
|
||||
|
||||
#[cfg_attr(not(test), allow(dead_code))]
|
||||
pub(super) fn prefetch_rate_limits(&mut self) {
|
||||
self.stop_rate_limit_poller();
|
||||
}
|
||||
|
||||
#[cfg_attr(not(test), allow(dead_code))]
|
||||
pub(super) fn should_prefetch_rate_limits(&self) -> bool {
|
||||
self.requires_openai_auth && self.has_chatgpt_account
|
||||
|
||||
@@ -20,7 +20,6 @@ impl ChatWidget {
|
||||
self.app_event_tx.voice_only.store(true, Ordering::Relaxed);
|
||||
self.statusline_read = None;
|
||||
self.set_queue_autosend_suppressed(/*suppressed*/ true);
|
||||
self.stop_rate_limit_poller();
|
||||
}
|
||||
|
||||
pub(crate) fn prepare_background_voice_replay(
|
||||
|
||||
@@ -822,9 +822,6 @@ async fn prefetch_rate_limits_is_gated_on_chatgpt_auth_provider() {
|
||||
chat.config.model_provider.requires_openai_auth = true;
|
||||
chat.requires_openai_auth = false;
|
||||
assert!(!chat.should_prefetch_rate_limits());
|
||||
|
||||
chat.prefetch_rate_limits();
|
||||
assert!(!chat.should_prefetch_rate_limits());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
Reference in New Issue
Block a user