mirror of
https://github.com/openai/codex.git
synced 2026-09-13 11:47:17 +00:00
fixes
This commit is contained in:
@@ -44,7 +44,7 @@ pub fn discover_prompts_in_excluding(dir: &Path, exclude: &HashSet<String>) -> V
|
||||
}
|
||||
|
||||
/// Discover prompt files in the default prompts directory, excluding any with names in `exclude`.
|
||||
pub fn discover_prompts_excluding(exclude: &HashSet<String>) -> Vec<CustomPrompt> {
|
||||
pub(crate) fn discover_prompts_excluding(exclude: &HashSet<String>) -> Vec<CustomPrompt> {
|
||||
let dir = default_prompts_dir();
|
||||
discover_prompts_in_excluding(&dir, exclude)
|
||||
}
|
||||
|
||||
@@ -1115,8 +1115,7 @@ impl ChatComposer {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn set_custom_prompts(&mut self, mut prompts: Vec<CustomPrompt>) {
|
||||
prompts.sort_by(|a, b| a.name.cmp(&b.name));
|
||||
pub(crate) fn set_custom_prompts(&mut self, prompts: Vec<CustomPrompt>) {
|
||||
self.custom_prompts = prompts.clone();
|
||||
if let ActivePopup::Command(popup) = &mut self.active_popup {
|
||||
popup.set_prompts(prompts);
|
||||
|
||||
@@ -31,7 +31,6 @@ use codex_core::protocol::TokenUsage;
|
||||
use codex_core::protocol::TurnAbortReason;
|
||||
use codex_core::protocol::TurnDiffEvent;
|
||||
use codex_core::protocol::WebSearchBeginEvent;
|
||||
use codex_protocol::custom_prompts::CustomPrompt;
|
||||
use codex_protocol::parse_command::ParsedCommand;
|
||||
use crossterm::event::KeyCode;
|
||||
use crossterm::event::KeyEvent;
|
||||
@@ -116,8 +115,6 @@ pub(crate) struct ChatWidget {
|
||||
last_history_was_exec: bool,
|
||||
// User messages queued while a turn is in progress
|
||||
queued_user_messages: VecDeque<UserMessage>,
|
||||
// Cached custom prompts discovered via protocol event
|
||||
custom_prompts: Vec<CustomPrompt>,
|
||||
}
|
||||
|
||||
struct UserMessage {
|
||||
@@ -606,7 +603,6 @@ impl ChatWidget {
|
||||
last_history_was_exec: false,
|
||||
queued_user_messages: VecDeque::new(),
|
||||
show_welcome_banner: true,
|
||||
custom_prompts: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -652,7 +648,6 @@ impl ChatWidget {
|
||||
last_history_was_exec: false,
|
||||
queued_user_messages: VecDeque::new(),
|
||||
show_welcome_banner: false,
|
||||
custom_prompts: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1166,12 +1161,10 @@ impl ChatWidget {
|
||||
}
|
||||
|
||||
fn on_list_custom_prompts(&mut self, ev: ListCustomPromptsResponseEvent) {
|
||||
// Cache prompts locally; UI surfaces them from this store.
|
||||
self.custom_prompts = ev.custom_prompts;
|
||||
debug!("received {} custom prompts", self.custom_prompts.len());
|
||||
let len = ev.custom_prompts.len();
|
||||
debug!("received {} custom prompts", len);
|
||||
// Forward to bottom pane so the slash popup can show them now.
|
||||
self.bottom_pane
|
||||
.set_custom_prompts(self.custom_prompts.clone());
|
||||
self.bottom_pane.set_custom_prompts(ev.custom_prompts);
|
||||
}
|
||||
|
||||
/// Programmatically submit a user text message as if typed in the
|
||||
|
||||
@@ -185,7 +185,6 @@ fn make_chatwidget_manual() -> (
|
||||
show_welcome_banner: true,
|
||||
last_history_was_exec: false,
|
||||
queued_user_messages: std::collections::VecDeque::new(),
|
||||
custom_prompts: Vec::new(),
|
||||
};
|
||||
(widget, rx, op_rx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user