mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00: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:
1 parent
a5783f90c9
commit
ce5ad7b295
2 files changed
+18
-64
No files matched your search
@@ -4555,10 +4555,14 @@ impl ChatWidget {
|
||||
|
||||
pub(crate) fn handle_request_user_input_now(&mut self, ev: RequestUserInputEvent) {
|
||||
self.flush_answer_stream_with_separator();
|
||||
self.notify(Notification::UserInputRequested {
|
||||
question_count: ev.questions.len(),
|
||||
summary: Notification::user_input_request_summary(&ev.questions),
|
||||
});
|
||||
let question_count = ev.questions.len();
|
||||
let summary = Notification::user_input_request_summary(&ev.questions);
|
||||
let title = match (question_count, summary.as_deref()) {
|
||||
(1, Some(summary)) => summary.to_string(),
|
||||
(1, None) => "Question requested".to_string(),
|
||||
(count, _) => format!("{count} questions requested"),
|
||||
};
|
||||
self.notify(Notification::PlanModePrompt { title });
|
||||
self.bottom_pane.push_user_input_request(ev);
|
||||
self.request_redraw();
|
||||
}
|
||||
@@ -10668,26 +10672,11 @@ impl Renderable for ChatWidget {
|
||||
|
||||
#[derive(Debug)]
|
||||
enum Notification {
|
||||
AgentTurnComplete {
|
||||
response: String,
|
||||
},
|
||||
ExecApprovalRequested {
|
||||
command: String,
|
||||
},
|
||||
EditApprovalRequested {
|
||||
cwd: PathBuf,
|
||||
changes: Vec<PathBuf>,
|
||||
},
|
||||
ElicitationRequested {
|
||||
server_name: String,
|
||||
},
|
||||
PlanModePrompt {
|
||||
title: String,
|
||||
},
|
||||
UserInputRequested {
|
||||
question_count: usize,
|
||||
summary: Option<String>,
|
||||
},
|
||||
AgentTurnComplete { response: String },
|
||||
ExecApprovalRequested { command: String },
|
||||
EditApprovalRequested { cwd: PathBuf, changes: Vec<PathBuf> },
|
||||
ElicitationRequested { server_name: String },
|
||||
PlanModePrompt { title: String },
|
||||
}
|
||||
|
||||
impl Notification {
|
||||
@@ -10720,14 +10709,6 @@ impl Notification {
|
||||
Notification::PlanModePrompt { title } => {
|
||||
format!("Plan mode prompt: {title}")
|
||||
}
|
||||
Notification::UserInputRequested {
|
||||
question_count,
|
||||
summary,
|
||||
} => match (*question_count, summary.as_deref()) {
|
||||
(1, Some(summary)) => format!("Question requested: {summary}"),
|
||||
(1, None) => "Question requested".to_string(),
|
||||
(count, _) => format!("Questions requested: {count}"),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10738,7 +10719,6 @@ impl Notification {
|
||||
| Notification::EditApprovalRequested { .. }
|
||||
| Notification::ElicitationRequested { .. } => "approval-requested",
|
||||
Notification::PlanModePrompt { .. } => "plan-mode-prompt",
|
||||
Notification::UserInputRequested { .. } => "user-input-requested",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10748,8 +10728,7 @@ impl Notification {
|
||||
Notification::ExecApprovalRequested { .. }
|
||||
| Notification::EditApprovalRequested { .. }
|
||||
| Notification::ElicitationRequested { .. }
|
||||
| Notification::PlanModePrompt { .. }
|
||||
| Notification::UserInputRequested { .. } => 1,
|
||||
| Notification::PlanModePrompt { .. } => 1,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user