mirror of
https://github.com/openai/codex.git
synced 2026-05-15 16:53:05 +00:00
fix(tui): route owner activity through app server
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user