diff --git a/codex-rs/tui/src/app/tests.rs b/codex-rs/tui/src/app/tests.rs index dda8d9212d..a12eac1635 100644 --- a/codex-rs/tui/src/app/tests.rs +++ b/codex-rs/tui/src/app/tests.rs @@ -5123,6 +5123,26 @@ async fn interrupt_without_active_turn_is_treated_as_handled() { assert_eq!(handled, true); } +#[tokio::test] +async fn owner_activity_is_routed_to_app_server() { + let mut app = make_test_app().await; + let mut app_server = crate::start_embedded_app_server_for_picker(app.chat_widget.config_ref()) + .await + .expect("embedded app server"); + let op = AppCommand::note_owner_activity(); + + let err = app + .try_submit_active_thread_op_via_app_server(&mut app_server, ThreadId::new(), &op) + .await + .expect_err("missing thread should fail after routing owner activity to app-server"); + + assert!( + err.to_string() + .contains("thread/inputActivity failed in TUI"), + "owner activity should reach the app-server path: {err:#}" + ); +} + #[tokio::test] async fn clear_only_ui_reset_preserves_chat_session_state() { let mut app = make_test_app().await; diff --git a/codex-rs/tui/src/app/thread_routing.rs b/codex-rs/tui/src/app/thread_routing.rs index b4ce19689d..a171d1ad21 100644 --- a/codex-rs/tui/src/app/thread_routing.rs +++ b/codex-rs/tui/src/app/thread_routing.rs @@ -526,6 +526,10 @@ impl App { } Ok(true) } + AppCommandView::NoteOwnerActivity => { + app_server.thread_input_activity(thread_id).await?; + Ok(true) + } AppCommandView::UserTurn { items, cwd, @@ -715,7 +719,15 @@ impl App { .await?; Ok(true) } - _ => Ok(false), + AppCommandView::ExecApproval { .. } + | AppCommandView::PatchApproval { .. } + | AppCommandView::ResolveElicitation { .. } + | AppCommandView::UserInputAnswer { .. } + | AppCommandView::RequestPermissionsResponse { .. } + | AppCommandView::Shutdown + | AppCommandView::Other(Op::AddToHistory { .. }) + | AppCommandView::Other(Op::GetHistoryEntryRequest { .. }) + | AppCommandView::Other(_) => Ok(false), } }