mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Add live WebRTC voice conversations to the TUI (#43581)
## What changed - Add feature-gated `/voice`, `/voice mute`, and `/voice stop` commands with local WebRTC audio and app-server signaling. - Show live transcripts, conversation status, and microphone and speaker levels. Preserve captions and undelivered answers across thread switches. - Speak final answers from voice handoffs while keeping delegated reasoning and commentary hidden and typed answers unspoken. - Retry eligible startup failures once and clean up voice sessions on thread switches and disconnects. - Stop voice and block late handoffs after a misalignment policy violation. Remove realtime event payloads and spoken text from receipt and debug logs. ## Testing Add coverage for voice command mapping, rejected starts, disconnect cleanup, delegated final-answer speech, late handoff rejection, and transcript and footer rendering. GitOrigin-RevId: 11def1f86b0e023b21d0d92072d6636ccad89815
This commit is contained in:
1 parent
4110342321
commit
b01c3986fd
70 files changed
+4421
-69
No files matched your search
@@ -42,6 +42,10 @@ mod patch_approval_tests;
|
||||
mod permission_shortcuts_tests;
|
||||
mod plugin_catalog;
|
||||
mod rate_limits;
|
||||
#[path = "tests/realtime_handoff_e2e.rs"]
|
||||
mod realtime_handoff_e2e;
|
||||
#[path = "tests/realtime_start.rs"]
|
||||
mod realtime_start;
|
||||
#[path = "tests/recap_generation_tests.rs"]
|
||||
mod recap_generation;
|
||||
mod safety_buffering;
|
||||
@@ -1334,6 +1338,7 @@ async fn replayed_turn_complete_submits_restored_queued_follow_up() {
|
||||
while new_op_rx.try_recv().is_ok() {}
|
||||
app.replay_thread_snapshot(
|
||||
ThreadEventSnapshot {
|
||||
delegated_turns: Vec::new(),
|
||||
session: None,
|
||||
turns: Vec::new(),
|
||||
events: vec![ThreadBufferedEvent::Notification(Box::new(
|
||||
@@ -1387,6 +1392,7 @@ async fn replay_only_thread_keeps_restored_queue_visible() {
|
||||
|
||||
app.replay_thread_snapshot(
|
||||
ThreadEventSnapshot {
|
||||
delegated_turns: Vec::new(),
|
||||
session: None,
|
||||
turns: Vec::new(),
|
||||
events: vec![ThreadBufferedEvent::Notification(Box::new(
|
||||
@@ -1438,6 +1444,7 @@ async fn replay_thread_snapshot_keeps_queue_when_running_state_only_comes_from_s
|
||||
|
||||
app.replay_thread_snapshot(
|
||||
ThreadEventSnapshot {
|
||||
delegated_turns: Vec::new(),
|
||||
session: None,
|
||||
turns: Vec::new(),
|
||||
events: vec![],
|
||||
@@ -1487,6 +1494,7 @@ async fn replay_thread_snapshot_in_progress_turn_restores_running_queue_state()
|
||||
|
||||
app.replay_thread_snapshot(
|
||||
ThreadEventSnapshot {
|
||||
delegated_turns: Vec::new(),
|
||||
session: None,
|
||||
turns: vec![test_turn("turn-1", TurnStatus::InProgress, Vec::new())],
|
||||
events: Vec::new(),
|
||||
@@ -1516,6 +1524,7 @@ async fn replay_thread_snapshot_in_progress_turn_restores_running_state_without_
|
||||
|
||||
app.replay_thread_snapshot(
|
||||
ThreadEventSnapshot {
|
||||
delegated_turns: Vec::new(),
|
||||
session: None,
|
||||
turns: vec![test_turn("turn-1", TurnStatus::InProgress, Vec::new())],
|
||||
events: Vec::new(),
|
||||
@@ -1558,6 +1567,7 @@ async fn replay_thread_snapshot_does_not_submit_queue_before_replay_catches_up()
|
||||
|
||||
app.replay_thread_snapshot(
|
||||
ThreadEventSnapshot {
|
||||
delegated_turns: Vec::new(),
|
||||
session: None,
|
||||
turns: Vec::new(),
|
||||
events: vec![
|
||||
@@ -1699,6 +1709,7 @@ async fn replay_thread_snapshot_restores_collaboration_mode_for_draft_submit() {
|
||||
|
||||
app.replay_thread_snapshot(
|
||||
ThreadEventSnapshot {
|
||||
delegated_turns: Vec::new(),
|
||||
session: None,
|
||||
turns: Vec::new(),
|
||||
events: vec![],
|
||||
@@ -1779,6 +1790,7 @@ async fn replay_thread_snapshot_restores_collaboration_mode_without_input() {
|
||||
|
||||
app.replay_thread_snapshot(
|
||||
ThreadEventSnapshot {
|
||||
delegated_turns: Vec::new(),
|
||||
session: None,
|
||||
turns: Vec::new(),
|
||||
events: vec![],
|
||||
@@ -1829,6 +1841,7 @@ async fn replayed_interrupted_turn_restores_queued_input_to_composer() {
|
||||
|
||||
app.replay_thread_snapshot(
|
||||
ThreadEventSnapshot {
|
||||
delegated_turns: Vec::new(),
|
||||
session: None,
|
||||
turns: Vec::new(),
|
||||
events: vec![ThreadBufferedEvent::Notification(Box::new(
|
||||
@@ -3714,6 +3727,7 @@ async fn replay_snapshot_with_pending_request_suppresses_replay_notices() {
|
||||
|
||||
app.replay_thread_snapshot(
|
||||
ThreadEventSnapshot {
|
||||
delegated_turns: Vec::new(),
|
||||
session: Some(test_thread_session(thread_id, test_path_buf("/tmp/main"))),
|
||||
turns: Vec::new(),
|
||||
events: vec![
|
||||
@@ -4096,6 +4110,7 @@ async fn replayed_file_change_approval_recovers_snapshot_changes() {
|
||||
let cwd = test_path_buf("/tmp/project").abs();
|
||||
app.replay_thread_snapshot(
|
||||
ThreadEventSnapshot {
|
||||
delegated_turns: Vec::new(),
|
||||
session: Some(test_thread_session(thread_id, cwd.clone().into_path_buf())),
|
||||
turns: vec![test_turn(
|
||||
"turn-replayed-approval",
|
||||
@@ -5053,6 +5068,7 @@ async fn side_thread_snapshot_does_not_refresh_from_fork_history() {
|
||||
.insert(side_thread_id, SideThreadState::new(parent_thread_id));
|
||||
|
||||
let snapshot = ThreadEventSnapshot {
|
||||
delegated_turns: Vec::new(),
|
||||
session: Some(ThreadSessionState {
|
||||
rollout_path: None,
|
||||
..test_thread_session(side_thread_id, test_path_buf("/tmp/side"))
|
||||
@@ -5081,6 +5097,7 @@ async fn side_thread_snapshot_skips_session_header_preamble() {
|
||||
.insert(side_thread_id, SideThreadState::new(parent_thread_id));
|
||||
|
||||
let snapshot = ThreadEventSnapshot {
|
||||
delegated_turns: Vec::new(),
|
||||
session: Some(ThreadSessionState {
|
||||
forked_from_id: Some(parent_thread_id),
|
||||
fork_parent_title: None,
|
||||
@@ -5256,6 +5273,7 @@ async fn active_side_thread_renders_live_mcp_startup_notifications() {
|
||||
app.activate_thread_channel(side_thread_id).await;
|
||||
app.replay_thread_snapshot(
|
||||
ThreadEventSnapshot {
|
||||
delegated_turns: Vec::new(),
|
||||
session: Some(test_thread_session(
|
||||
side_thread_id,
|
||||
test_path_buf("/tmp/side"),
|
||||
@@ -5839,6 +5857,9 @@ async fn make_test_app() -> App {
|
||||
pending_shutdown_exit_thread_id: None,
|
||||
windows_sandbox: WindowsSandboxState::default(),
|
||||
thread_event_channels: HashMap::new(),
|
||||
pending_realtime_speech_replay: HashMap::new(),
|
||||
pending_realtime_transcript_replay: HashMap::new(),
|
||||
realtime_replay_order: VecDeque::new(),
|
||||
temporary_structured_requests: HashMap::new(),
|
||||
pending_thread_titles: HashSet::new(),
|
||||
thread_event_listener_tasks: HashMap::new(),
|
||||
@@ -5933,6 +5954,9 @@ pub(super) async fn make_test_app_with_channels() -> (
|
||||
pending_shutdown_exit_thread_id: None,
|
||||
windows_sandbox: WindowsSandboxState::default(),
|
||||
thread_event_channels: HashMap::new(),
|
||||
pending_realtime_speech_replay: HashMap::new(),
|
||||
pending_realtime_transcript_replay: HashMap::new(),
|
||||
realtime_replay_order: VecDeque::new(),
|
||||
temporary_structured_requests: HashMap::new(),
|
||||
pending_thread_titles: HashSet::new(),
|
||||
thread_event_listener_tasks: HashMap::new(),
|
||||
@@ -8049,6 +8073,7 @@ async fn replay_thread_snapshot_replays_turn_history_in_order() {
|
||||
let thread_id = ThreadId::new();
|
||||
app.replay_thread_snapshot(
|
||||
ThreadEventSnapshot {
|
||||
delegated_turns: Vec::new(),
|
||||
session: Some(test_thread_session(
|
||||
thread_id,
|
||||
test_path_buf("/home/user/project"),
|
||||
@@ -8165,6 +8190,7 @@ async fn replace_chat_widget_reseeds_collab_agent_metadata_for_replay() {
|
||||
|
||||
app.replay_thread_snapshot(
|
||||
ThreadEventSnapshot {
|
||||
delegated_turns: Vec::new(),
|
||||
session: None,
|
||||
turns: Vec::new(),
|
||||
events: vec![ThreadBufferedEvent::Notification(Box::new(
|
||||
@@ -8240,6 +8266,7 @@ async fn refreshed_snapshot_session_persists_resumed_turns() {
|
||||
..initial_session.clone()
|
||||
};
|
||||
let mut snapshot = ThreadEventSnapshot {
|
||||
delegated_turns: Vec::new(),
|
||||
session: Some(initial_session),
|
||||
turns: Vec::new(),
|
||||
events: Vec::new(),
|
||||
|
||||
Reference in new issue
Block a user