mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
Emit plan-mode prompt notifications for questionnaires (#17417)
Addresses #17252 Problem: Plan-mode clarification questionnaires used the generic user-input notification type, so configs listening for plan-mode-prompt did not fire when request_user_input waited for an answer. Solution: Map request_user_input prompts to the plan-mode-prompt notification and remove the obsolete user-input TUI notification variant.
This commit is contained in:
@@ -265,25 +265,6 @@ fn plan_mode_prompt_notification_uses_dedicated_type_name() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn user_input_requested_notification_uses_dedicated_type_name() {
|
||||
let notification = Notification::UserInputRequested {
|
||||
question_count: 1,
|
||||
summary: Some("Reasoning scope".to_string()),
|
||||
};
|
||||
|
||||
assert!(notification.allowed_for(&Notifications::Custom(vec![
|
||||
"user-input-requested".to_string(),
|
||||
])));
|
||||
assert!(!notification.allowed_for(&Notifications::Custom(vec![
|
||||
"approval-requested".to_string(),
|
||||
])));
|
||||
assert_eq!(
|
||||
notification.display(),
|
||||
"Question requested: Reasoning scope"
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn open_plan_implementation_prompt_sets_pending_notification() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.1-codex-max")).await;
|
||||
@@ -331,7 +312,7 @@ async fn agent_turn_complete_does_not_override_pending_plan_mode_prompt_notifica
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn user_input_notification_overrides_pending_agent_turn_complete_notification() {
|
||||
async fn request_user_input_notification_overrides_pending_agent_turn_complete_notification() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.1-codex-max")).await;
|
||||
|
||||
chat.notify(Notification::AgentTurnComplete {
|
||||
@@ -355,10 +336,7 @@ async fn user_input_notification_overrides_pending_agent_turn_complete_notificat
|
||||
|
||||
assert_matches!(
|
||||
chat.pending_notification,
|
||||
Some(Notification::UserInputRequested {
|
||||
question_count: 1,
|
||||
summary: Some(ref summary),
|
||||
}) if summary == "Reasoning scope"
|
||||
Some(Notification::PlanModePrompt { ref title }) if title == "Reasoning scope"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -366,7 +344,7 @@ async fn user_input_notification_overrides_pending_agent_turn_complete_notificat
|
||||
async fn handle_request_user_input_sets_pending_notification() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.1-codex-max")).await;
|
||||
chat.config.tui_notifications.notifications =
|
||||
Notifications::Custom(vec!["user-input-requested".to_string()]);
|
||||
Notifications::Custom(vec!["plan-mode-prompt".to_string()]);
|
||||
|
||||
chat.handle_request_user_input_now(RequestUserInputEvent {
|
||||
call_id: "call-1".to_string(),
|
||||
@@ -386,10 +364,7 @@ async fn handle_request_user_input_sets_pending_notification() {
|
||||
|
||||
assert_matches!(
|
||||
chat.pending_notification,
|
||||
Some(Notification::UserInputRequested {
|
||||
question_count: 1,
|
||||
summary: Some(ref summary),
|
||||
}) if summary == "Reasoning scope"
|
||||
Some(Notification::PlanModePrompt { ref title }) if title == "Reasoning scope"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user