tui: remove underscore placeholders and dead-code locals

remove leading-underscore placeholders introduced by realtime refactor

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Ahmed Ibrahim
2026-02-23 19:59:51 -08:00
co-authored by Codex
parent 60dc38b962
commit 2648a7c52b
3 changed files with 21 additions and 17 deletions
+3 -2
View File
@@ -1002,8 +1002,9 @@ impl App {
let codex_op_tx = if let Some(thread) = live_thread {
crate::chatwidget::spawn_op_forwarder(thread)
} else {
let (codex_op_tx, _codex_op_rx) = unbounded_channel();
let (realtime_audio_op_tx, _realtime_audio_op_rx) = tokio::sync::mpsc::channel(1);
let (codex_op_tx, codex_op_rx) = unbounded_channel();
let (realtime_audio_op_tx, realtime_audio_op_rx) = tokio::sync::mpsc::channel(1);
drop((codex_op_rx, realtime_audio_op_rx));
crate::chatwidget::ChatWidgetOpSenders {
codex_op_tx,
realtime_audio_op_tx,
+5 -4
View File
@@ -1649,7 +1649,8 @@ async fn make_chatwidget_manual(
},
};
let current_collaboration_mode = base_mode;
let (realtime_audio_op_tx, _realtime_audio_op_rx) = tokio::sync::mpsc::channel(1);
let (realtime_audio_op_tx, realtime_audio_op_rx) = tokio::sync::mpsc::channel(1);
drop(realtime_audio_op_rx);
let active_collaboration_mask = collaboration_modes::default_mask(models_manager.as_ref());
let mut widget = ChatWidget {
app_event_tx,
@@ -3390,7 +3391,7 @@ async fn unified_exec_begin_restores_working_status_snapshot() {
#[tokio::test]
async fn steer_enter_queues_while_plan_stream_is_active() {
let (mut chat, _rx, mut op_rx) = make_chatwidget_manual(None).await;
let (mut chat, _, mut op_rx) = make_chatwidget_manual(None).await;
chat.thread_id = Some(ThreadId::new());
chat.set_feature_enabled(Feature::CollaborationModes, true);
let plan_mask =
@@ -3415,7 +3416,7 @@ async fn steer_enter_queues_while_plan_stream_is_active() {
#[tokio::test]
async fn steer_enter_queues_while_final_answer_stream_is_active() {
let (mut chat, _rx, mut op_rx) = make_chatwidget_manual(None).await;
let (mut chat, _, mut op_rx) = make_chatwidget_manual(None).await;
chat.thread_id = Some(ThreadId::new());
chat.on_task_started();
// Keep the assistant stream open (no commit tick/finalize) to model the repro window:
@@ -3539,7 +3540,7 @@ async fn steer_enter_submits_when_plan_stream_is_not_active() {
#[tokio::test]
async fn ctrl_c_shutdown_works_with_caps_lock() {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(None).await;
let (mut chat, mut rx, _) = make_chatwidget_manual(None).await;
chat.handle_key_event(KeyEvent::new(KeyCode::Char('C'), KeyModifiers::CONTROL));
+13 -11
View File
@@ -4,7 +4,9 @@ use base64::Engine;
use codex_protocol::protocol::ConversationAudioParams;
use codex_protocol::protocol::Op;
use codex_protocol::protocol::RealtimeAudioFrame;
use cpal::traits::{DeviceTrait, HostTrait, StreamTrait};
use cpal::traits::DeviceTrait;
use cpal::traits::HostTrait;
use cpal::traits::StreamTrait;
use std::collections::VecDeque;
use std::sync::Arc;
use std::sync::Mutex;
@@ -40,9 +42,9 @@ enum RealtimeAudioBackend {
Stub,
}
struct LiveRealtimeAudioController {
_input_capture: crate::voice::VoiceCapture,
_input_capture_thread: Option<thread::JoinHandle<()>>,
_output_stream: cpal::Stream,
input_capture: crate::voice::VoiceCapture,
input_capture_thread: Option<thread::JoinHandle<()>>,
output_stream: cpal::Stream,
playback_state: Arc<Mutex<PlaybackState>>,
last_input_peak: Arc<AtomicU16>,
meter_stop: Arc<AtomicBool>,
@@ -51,7 +53,7 @@ struct LiveRealtimeAudioController {
impl RealtimeAudioController {
pub(crate) fn start(realtime_audio_op_tx: Sender<Op>) -> Result<Self> {
if cfg!(test) {
let _ = realtime_audio_op_tx;
drop(realtime_audio_op_tx);
return Ok(Self {
backend: RealtimeAudioBackend::Stub,
});
@@ -132,9 +134,9 @@ impl RealtimeAudioController {
Ok(Self {
backend: RealtimeAudioBackend::Live(LiveRealtimeAudioController {
_input_capture: input_capture,
_input_capture_thread: Some(input_capture_thread),
_output_stream: output_stream,
input_capture,
input_capture_thread: Some(input_capture_thread),
output_stream,
playback_state,
last_input_peak,
meter_stop,
@@ -152,7 +154,7 @@ impl RealtimeAudioController {
state.enqueue(frame)?;
}
RealtimeAudioBackend::Stub => {
let _ = frame;
return Ok(());
}
}
Ok(())
@@ -160,10 +162,10 @@ impl RealtimeAudioController {
pub(crate) fn shutdown(self) {
if let RealtimeAudioBackend::Live(controller) = self.backend {
if let Err(err) = controller._input_capture.stop().map(|_| ()) {
if let Err(err) = controller.input_capture.stop().map(|_| ()) {
warn!("failed to stop realtime microphone capture: {err}");
}
if let Some(handle) = controller._input_capture_thread {
if let Some(handle) = controller.input_capture_thread {
if let Err(err) = handle.join() {
warn!("failed to join realtime microphone input thread: {err:?}");
}