Use app-server skill metadata directly in the TUI (#34368)

## Why

The TUI already receives skill metadata from the app-server protocol, but converted it into the core-skills model before using it.

## What changed

- Use `codex_app_server_protocol::SkillMetadata` throughout skill toggles, mentions, and input submission.
- Remove the protocol-to-core conversion and the TUI's `codex-core-skills` dependency.

GitOrigin-RevId: 43d43d74bfb67fc21ef11a0ca0592aa44b89a122
This commit is contained in:
felixxia-oai authored and copyberry committed 2026-07-20 15:44:37 +00:00
1 parent 28aacbb9d9
commit b6de5b524c
11 files changed
+46 -116

No files matched your search

+12 -16
View File
@@ -292,10 +292,10 @@ use crate::history_cell;
use crate::skills_helpers::skill_display_name;
use crate::tui::FrameRequester;
use crate::ui_consts::LIVE_PREFIX_COLS;
use codex_connectors::AppInfo;
#[cfg(test)]
use codex_core_skills::model::SkillInterface;
use codex_core_skills::model::SkillMetadata;
use codex_app_server_protocol::SkillInterface;
use codex_app_server_protocol::SkillMetadata;
use codex_connectors::AppInfo;
use codex_file_search::FileMatch;
#[cfg(test)]
use codex_plugin::AppConnectorId;
@@ -4027,7 +4027,7 @@ impl ChatComposer {
description,
insert_text: format!("${skill_name}"),
search_terms,
path: Some(skill.path_to_skills_md.to_string_lossy().into_owned()),
path: Some(skill.path.to_string_lossy().into_owned()),
category_tag: Some("[Skill]".to_string()),
sort_rank: 1,
});
@@ -6641,10 +6641,9 @@ mod tests {
short_description: None,
interface: None,
dependencies: None,
policy: None,
path_to_skills_md: test_path_buf(&format!("/tmp/{name}/SKILL.md")).abs(),
path: test_path_buf(&format!("/tmp/{name}/SKILL.md")).abs(),
scope: crate::test_support::skill_scope_user(),
plugin_id: None,
enabled: true,
}
}
@@ -7292,10 +7291,9 @@ mod tests {
short_description: None,
interface: None,
dependencies: None,
policy: None,
path_to_skills_md: skill_path.clone(),
path: skill_path.clone(),
scope: crate::test_support::skill_scope_user(),
plugin_id: None,
enabled: true,
}]));
let ActivePopup::Skill(popup) = &composer.popups.active else {
@@ -7335,10 +7333,9 @@ mod tests {
default_prompt: None,
}),
dependencies: None,
policy: None,
path_to_skills_md: skill_path.clone(),
path: skill_path.clone(),
scope: crate::test_support::skill_scope_repo(),
plugin_id: None,
enabled: true,
}]));
composer.set_plugin_mentions(Some(vec![PluginCapabilitySummary {
config_name: "google-calendar@debug".to_string(),
@@ -7451,10 +7448,9 @@ mod tests {
default_prompt: None,
}),
dependencies: None,
policy: None,
path_to_skills_md: test_path_buf("/tmp/repo/google-calendar/SKILL.md").abs(),
path: test_path_buf("/tmp/repo/google-calendar/SKILL.md").abs(),
scope: crate::test_support::skill_scope_repo(),
plugin_id: None,
enabled: true,
}]));
composer.set_plugin_mentions(Some(vec![PluginCapabilitySummary {
config_name: "google-calendar@debug".to_string(),
@@ -1,4 +1,4 @@
use codex_core_skills::model::SkillMetadata;
use codex_app_server_protocol::SkillMetadata;
use codex_plugin::PluginCapabilitySummary;
use crate::skills_helpers::skill_description;
@@ -40,7 +40,7 @@ fn skill_candidate(skill: &SkillMetadata) -> Candidate {
mention_type: MentionType::Skill,
selection: Selection::Tool {
insert_text: format!("${skill_name}"),
path: Some(skill.path_to_skills_md.to_string_lossy().into_owned()),
path: Some(skill.path.to_string_lossy().into_owned()),
},
}
}
+3 -4
View File
@@ -36,8 +36,8 @@ use crate::terminal_palette::effective_stdout_color_level;
use crate::tui::FrameRequester;
pub(crate) use bottom_pane_view::BottomPaneView;
pub(crate) use bottom_pane_view::ViewCompletion;
use codex_app_server_protocol::SkillMetadata;
use codex_app_server_protocol::ToolRequestUserInputParams;
use codex_core_skills::model::SkillMetadata;
use codex_features::Features;
use codex_file_search::FileMatch;
use codex_plugin::PluginCapabilitySummary;
@@ -2650,10 +2650,9 @@ mod tests {
short_description: None,
interface: None,
dependencies: None,
policy: None,
path_to_skills_md: test_path_buf("/tmp/test-skill/SKILL.md").abs(),
path: test_path_buf("/tmp/test-skill/SKILL.md").abs(),
scope: crate::test_support::skill_scope_user(),
plugin_id: None,
enabled: true,
}]),
});