This commit is contained in:
canvrno-oai
2026-05-29 11:40:49 -07:00
parent 3511908812
commit 87b35e30eb
3 changed files with 25 additions and 13 deletions
+1 -2
View File
@@ -456,13 +456,12 @@ fn rollout_path_is_resumable(rollout_path: &Path) -> bool {
std::fs::metadata(rollout_path).is_ok_and(|metadata| metadata.is_file() && metadata.len() > 0)
}
fn errors_for_cwd(cwd: &Path, response: &SkillsListResponse) -> Vec<SkillErrorInfo> {
fn errors_for_cwd(cwd: &Path, response: &SkillsListResponse) -> Option<Vec<SkillErrorInfo>> {
response
.data
.iter()
.find(|entry| entry.cwd.as_path() == cwd)
.map(|entry| entry.errors.clone())
.unwrap_or_default()
}
#[derive(Debug, Clone, PartialEq, Eq)]
+12
View File
@@ -2313,6 +2313,18 @@ async fn repeated_skill_load_warnings_emit_once_until_errors_clear() {
rendered,
);
app.handle_skills_list_response(codex_app_server_protocol::SkillsListResponse {
data: vec![codex_app_server_protocol::SkillsListEntry {
cwd: test_path_buf("/tmp/other-project"),
skills: Vec::new(),
errors: Vec::new(),
}],
});
assert!(drain_insert_history_cells(&mut app_event_rx).is_empty());
app.handle_skills_list_response(response.clone());
assert!(drain_insert_history_cells(&mut app_event_rx).is_empty());
app.handle_skills_list_response(codex_app_server_protocol::SkillsListResponse {
data: vec![codex_app_server_protocol::SkillsListEntry {
cwd,
+12 -11
View File
@@ -1339,17 +1339,18 @@ impl App {
#[allow(clippy::too_many_arguments)]
pub(super) fn handle_skills_list_response(&mut self, response: SkillsListResponse) {
let cwd = self.chat_widget.config_ref().cwd.clone();
let errors = errors_for_cwd(&cwd, &response);
if errors.is_empty() {
self.skill_load_warnings_by_cwd.remove(&cwd);
} else if !self
.skill_load_warnings_by_cwd
.get(&cwd)
.is_some_and(|previous_errors| previous_errors == &errors)
{
emit_skill_load_warnings(&self.app_event_tx, &errors);
self.skill_load_warnings_by_cwd.insert(cwd, errors);
let cwd = self.chat_widget.config_ref().cwd.to_path_buf();
if let Some(errors) = errors_for_cwd(&cwd, &response) {
if errors.is_empty() {
self.skill_load_warnings_by_cwd.remove(&cwd);
} else if !self
.skill_load_warnings_by_cwd
.get(&cwd)
.is_some_and(|previous_errors| previous_errors == &errors)
{
emit_skill_load_warnings(&self.app_event_tx, &errors);
self.skill_load_warnings_by_cwd.insert(cwd, errors);
}
}
self.chat_widget.handle_skills_list_response(response);