Remove TUI plugin mention authority
This commit is contained in:
parent
c0d92cb8f8
commit
b8a7a52107
15 changed files with 30 additions and 300 deletions
|
|
@ -859,6 +859,15 @@ so `codex-cli` no longer depends on `codex-chatgpt` for ChatGPT task/apply
|
|||
product commands. `codex-chatgpt` remains in the workspace only as an orphaned
|
||||
product crate until the workspace itself is pruned.
|
||||
|
||||
TUI prompt composition no longer carries plugin mention authority. The composer
|
||||
does not store `PluginCapabilitySummary`, the AppEvent bus no longer has
|
||||
`RefreshPluginMentions` / `PluginMentionsLoaded`, submitted user messages no
|
||||
longer turn `plugin://` bindings into structured mentions, legacy
|
||||
`[@plugin](plugin://...)` history links are no longer decoded as live tool
|
||||
mentions, and `codex-tui` no longer depends on `codex-plugin` or
|
||||
`codex-utils-plugins`. The remaining TUI marketplace code is a product UI
|
||||
compatibility stump to cut next, not auth/model spine machinery.
|
||||
|
||||
The Phase 6 freshness slice is landed. It exposes read-only
|
||||
`thread/epiphany/freshness` from live retrieval summaries plus graph
|
||||
frontier/churn state and, for loaded threads, watcher-backed invalidation
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -302,7 +302,12 @@ current_status:
|
|||
path now uses the inert core connector stub instead of `codex-chatgpt`, so
|
||||
ChatGPT app connector listing is not a TUI dependency. CLI `apply` is now a
|
||||
disabled compatibility shell, so `codex-cli` no longer depends on
|
||||
`codex-chatgpt` for ChatGPT task/apply product commands. MCP remains
|
||||
`codex-chatgpt` for ChatGPT task/apply product commands. TUI prompt
|
||||
composition no longer owns plugin mention state, emits structured plugin
|
||||
mentions, refreshes plugin mentions through `AppEvent`, decodes legacy
|
||||
`[@plugin](plugin://...)` mention links, or depends on `codex-plugin` /
|
||||
`codex-utils-plugins`; the remaining TUI plugin marketplace code is a
|
||||
product UI compatibility stump, not prompt/runtime authority. MCP remains
|
||||
JSON-RPC at the edge; user-declared MCP servers are the only runtime MCP
|
||||
authority.
|
||||
next_action: Continue starving coordinator/runtime execution and operator surfaces off app-server JSON-RPC and out of `codex_message_processor.rs`; keep the vestigial Codex organ narrowed to subscription auth/model transport.
|
||||
|
|
|
|||
2
vendor/codex/codex-rs/Cargo.lock
generated
vendored
2
vendor/codex/codex-rs/Cargo.lock
generated
vendored
|
|
@ -3443,7 +3443,6 @@ dependencies = [
|
|||
"codex-model-provider-info",
|
||||
"codex-models-manager",
|
||||
"codex-otel",
|
||||
"codex-plugin",
|
||||
"codex-protocol",
|
||||
"codex-realtime-webrtc",
|
||||
"codex-rollout",
|
||||
|
|
@ -3458,7 +3457,6 @@ dependencies = [
|
|||
"codex-utils-fuzzy-match",
|
||||
"codex-utils-oss",
|
||||
"codex-utils-path",
|
||||
"codex-utils-plugins",
|
||||
"codex-utils-pty",
|
||||
"codex-utils-sandbox-summary",
|
||||
"codex-utils-sleep-inhibitor",
|
||||
|
|
|
|||
2
vendor/codex/codex-rs/tui/Cargo.toml
vendored
2
vendor/codex/codex-rs/tui/Cargo.toml
vendored
|
|
@ -43,7 +43,6 @@ codex-login = { workspace = true }
|
|||
codex-model-provider-info = { workspace = true }
|
||||
codex-models-manager = { workspace = true }
|
||||
codex-otel = { workspace = true }
|
||||
codex-plugin = { workspace = true }
|
||||
codex-protocol = { workspace = true }
|
||||
codex-realtime-webrtc = { workspace = true }
|
||||
codex-rollout = { workspace = true }
|
||||
|
|
@ -57,7 +56,6 @@ codex-utils-elapsed = { workspace = true }
|
|||
codex-utils-fuzzy-match = { workspace = true }
|
||||
codex-utils-oss = { workspace = true }
|
||||
codex-utils-path = { workspace = true }
|
||||
codex-utils-plugins = { workspace = true }
|
||||
codex-utils-sandbox-summary = { workspace = true }
|
||||
codex-utils-sleep-inhibitor = { workspace = true }
|
||||
codex-utils-string = { workspace = true }
|
||||
|
|
|
|||
|
|
@ -198,11 +198,6 @@ impl App {
|
|||
});
|
||||
}
|
||||
|
||||
pub(super) fn refresh_plugin_mentions(&mut self) {
|
||||
let app_event_tx = self.app_event_tx.clone();
|
||||
app_event_tx.send(AppEvent::PluginMentionsLoaded { plugins: None });
|
||||
}
|
||||
|
||||
pub(super) fn submit_feedback(
|
||||
&mut self,
|
||||
app_server: &AppServerSession,
|
||||
|
|
|
|||
|
|
@ -982,15 +982,6 @@ impl App {
|
|||
self.fetch_plugins_list(app_server, cwd);
|
||||
}
|
||||
}
|
||||
AppEvent::RefreshPluginMentions => {
|
||||
self.refresh_plugin_mentions();
|
||||
}
|
||||
AppEvent::PluginMentionsLoaded { mut plugins } => {
|
||||
if !self.config.features.enabled(Feature::Plugins) {
|
||||
plugins = None;
|
||||
}
|
||||
self.chat_widget.on_plugin_mentions_loaded(plugins);
|
||||
}
|
||||
AppEvent::PersistPersonalitySelection { personality } => {
|
||||
let profile = self.active_profile.as_deref();
|
||||
match ConfigEditsBuilder::new(&self.config.codex_home)
|
||||
|
|
|
|||
9
vendor/codex/codex-rs/tui/src/app_event.rs
vendored
9
vendor/codex/codex-rs/tui/src/app_event.rs
vendored
|
|
@ -36,7 +36,6 @@ use crate::bottom_pane::TerminalTitleItem;
|
|||
use crate::chatwidget::UserMessage;
|
||||
use codex_config::types::ApprovalsReviewer;
|
||||
use codex_features::Feature;
|
||||
use codex_plugin::PluginCapabilitySummary;
|
||||
use codex_protocol::config_types::CollaborationModeMask;
|
||||
use codex_protocol::config_types::Personality;
|
||||
use codex_protocol::config_types::ServiceTier;
|
||||
|
|
@ -318,14 +317,6 @@ pub(crate) enum AppEvent {
|
|||
result: Result<(), String>,
|
||||
},
|
||||
|
||||
/// Refresh plugin mention bindings from the current config.
|
||||
RefreshPluginMentions,
|
||||
|
||||
/// Result of refreshing plugin mention bindings.
|
||||
PluginMentionsLoaded {
|
||||
plugins: Option<Vec<PluginCapabilitySummary>>,
|
||||
},
|
||||
|
||||
/// Advance the post-install plugin app-auth flow.
|
||||
PluginInstallAuthAdvance {
|
||||
refresh_connectors: bool,
|
||||
|
|
|
|||
|
|
@ -214,9 +214,6 @@ use codex_app_server_protocol::AppInfo;
|
|||
use codex_core_skills::model::SkillInterface;
|
||||
use codex_core_skills::model::SkillMetadata;
|
||||
use codex_file_search::FileMatch;
|
||||
#[cfg(test)]
|
||||
use codex_plugin::AppConnectorId;
|
||||
use codex_plugin::PluginCapabilitySummary;
|
||||
use std::cell::RefCell;
|
||||
use std::collections::HashMap;
|
||||
use std::collections::HashSet;
|
||||
|
|
@ -363,7 +360,6 @@ pub(crate) struct ChatComposer {
|
|||
next_element_id: u64,
|
||||
context_window_used_tokens: Option<i64>,
|
||||
skills: Option<Vec<SkillMetadata>>,
|
||||
plugins: Option<Vec<PluginCapabilitySummary>>,
|
||||
connectors_snapshot: Option<ConnectorsSnapshot>,
|
||||
dismissed_mention_popup_token: Option<String>,
|
||||
mention_bindings: HashMap<u64, ComposerMentionBinding>,
|
||||
|
|
@ -508,7 +504,6 @@ impl ChatComposer {
|
|||
next_element_id: 0,
|
||||
context_window_used_tokens: None,
|
||||
skills: None,
|
||||
plugins: None,
|
||||
connectors_snapshot: None,
|
||||
dismissed_mention_popup_token: None,
|
||||
mention_bindings: HashMap::new(),
|
||||
|
|
@ -555,11 +550,6 @@ impl ChatComposer {
|
|||
self.sync_popups();
|
||||
}
|
||||
|
||||
pub fn set_plugin_mentions(&mut self, plugins: Option<Vec<PluginCapabilitySummary>>) {
|
||||
self.plugins = plugins;
|
||||
self.sync_popups();
|
||||
}
|
||||
|
||||
pub fn set_plugins_command_enabled(&mut self, enabled: bool) {
|
||||
self.plugins_command_enabled = enabled;
|
||||
}
|
||||
|
|
@ -1986,25 +1976,17 @@ impl ChatComposer {
|
|||
self.skills.as_ref()
|
||||
}
|
||||
|
||||
pub fn plugins(&self) -> Option<&Vec<PluginCapabilitySummary>> {
|
||||
self.plugins.as_ref()
|
||||
}
|
||||
|
||||
fn mentions_enabled(&self) -> bool {
|
||||
let skills_ready = self
|
||||
.skills
|
||||
.as_ref()
|
||||
.is_some_and(|skills| !skills.is_empty());
|
||||
let plugins_ready = self
|
||||
.plugins
|
||||
.as_ref()
|
||||
.is_some_and(|plugins| !plugins.is_empty());
|
||||
let connectors_ready = self.connectors_enabled
|
||||
&& self
|
||||
.connectors_snapshot
|
||||
.as_ref()
|
||||
.is_some_and(|snapshot| !snapshot.connectors.is_empty());
|
||||
skills_ready || plugins_ready || connectors_ready
|
||||
skills_ready || connectors_ready
|
||||
}
|
||||
|
||||
/// Extract a token prefixed with `prefix` under the cursor, if any.
|
||||
|
|
@ -3587,58 +3569,6 @@ impl ChatComposer {
|
|||
}
|
||||
}
|
||||
|
||||
if let Some(plugins) = self.plugins.as_ref() {
|
||||
for plugin in plugins {
|
||||
let (plugin_name, marketplace_name) = plugin
|
||||
.config_name
|
||||
.split_once('@')
|
||||
.unwrap_or((plugin.config_name.as_str(), ""));
|
||||
let mut capability_labels = Vec::new();
|
||||
if plugin.has_skills {
|
||||
capability_labels.push("skills".to_string());
|
||||
}
|
||||
if !plugin.mcp_server_names.is_empty() {
|
||||
let mcp_server_count = plugin.mcp_server_names.len();
|
||||
capability_labels.push(if mcp_server_count == 1 {
|
||||
"1 MCP server".to_string()
|
||||
} else {
|
||||
format!("{mcp_server_count} MCP servers")
|
||||
});
|
||||
}
|
||||
if !plugin.app_connector_ids.is_empty() {
|
||||
let app_count = plugin.app_connector_ids.len();
|
||||
capability_labels.push(if app_count == 1 {
|
||||
"1 app".to_string()
|
||||
} else {
|
||||
format!("{app_count} apps")
|
||||
});
|
||||
}
|
||||
let description = plugin.description.clone().or_else(|| {
|
||||
Some(if capability_labels.is_empty() {
|
||||
"Plugin".to_string()
|
||||
} else {
|
||||
format!("Plugin · {}", capability_labels.join(" · "))
|
||||
})
|
||||
});
|
||||
let mut search_terms = vec![plugin_name.to_string(), plugin.config_name.clone()];
|
||||
if plugin.display_name != plugin_name {
|
||||
search_terms.push(plugin.display_name.clone());
|
||||
}
|
||||
if !marketplace_name.is_empty() {
|
||||
search_terms.push(marketplace_name.to_string());
|
||||
}
|
||||
mentions.push(MentionItem {
|
||||
display_name: plugin.display_name.clone(),
|
||||
description,
|
||||
insert_text: format!("${plugin_name}"),
|
||||
search_terms,
|
||||
path: Some(format!("plugin://{}", plugin.config_name)),
|
||||
category_tag: Some("[Plugin]".to_string()),
|
||||
sort_rank: 0,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if self.connectors_enabled
|
||||
&& let Some(snapshot) = self.connectors_snapshot.as_ref()
|
||||
{
|
||||
|
|
@ -5334,39 +5264,6 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn set_plugin_mentions_refreshes_open_mention_popup() {
|
||||
let (tx, _rx) = unbounded_channel::<AppEvent>();
|
||||
let sender = AppEventSender::new(tx);
|
||||
let mut composer = ChatComposer::new(
|
||||
/*has_input_focus*/ true,
|
||||
sender,
|
||||
/*enhanced_keys_supported*/ false,
|
||||
"Ask Codex to do anything".to_string(),
|
||||
/*disable_paste_burst*/ false,
|
||||
);
|
||||
composer.set_text_content("$".to_string(), Vec::new(), Vec::new());
|
||||
assert!(matches!(composer.active_popup, ActivePopup::None));
|
||||
|
||||
composer.set_plugin_mentions(Some(vec![PluginCapabilitySummary {
|
||||
config_name: "sample@test".to_string(),
|
||||
display_name: "Sample Plugin".to_string(),
|
||||
description: None,
|
||||
has_skills: true,
|
||||
mcp_server_names: vec!["sample".to_string()],
|
||||
app_connector_ids: Vec::new(),
|
||||
}]));
|
||||
|
||||
let ActivePopup::Skill(popup) = &composer.active_popup else {
|
||||
panic!("expected mention popup to open after plugin update");
|
||||
};
|
||||
let mention = popup
|
||||
.selected_mention()
|
||||
.expect("expected plugin mention to be selected");
|
||||
assert_eq!(mention.insert_text, "$sample".to_string());
|
||||
assert_eq!(mention.path, Some("plugin://sample@test".to_string()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn set_skill_mentions_refreshes_open_mention_popup() {
|
||||
let (tx, _rx) = unbounded_channel::<AppEvent>();
|
||||
|
|
@ -5404,7 +5301,7 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn mention_items_show_plugin_owned_skill_and_app_duplicates() {
|
||||
fn mention_items_show_skill_and_app_duplicates() {
|
||||
let skill_path = test_path_buf("/tmp/repo/google-calendar/SKILL.md").abs();
|
||||
let (tx, _rx) = unbounded_channel::<AppEvent>();
|
||||
let sender = AppEventSender::new(tx);
|
||||
|
|
@ -5434,17 +5331,6 @@ mod tests {
|
|||
path_to_skills_md: skill_path.clone(),
|
||||
scope: codex_protocol::protocol::SkillScope::Repo,
|
||||
}]));
|
||||
composer.set_plugin_mentions(Some(vec![PluginCapabilitySummary {
|
||||
config_name: "google-calendar@debug".to_string(),
|
||||
display_name: "Google Calendar".to_string(),
|
||||
description: Some(
|
||||
"Connect Google Calendar for scheduling, availability, and event management."
|
||||
.to_string(),
|
||||
),
|
||||
has_skills: true,
|
||||
mcp_server_names: vec!["google-calendar".to_string()],
|
||||
app_connector_ids: vec![AppConnectorId("google_calendar".to_string())],
|
||||
}]));
|
||||
composer.set_connector_mentions(Some(ConnectorsSnapshot {
|
||||
connectors: vec![AppInfo {
|
||||
id: "google_calendar".to_string(),
|
||||
|
|
@ -5464,39 +5350,12 @@ mod tests {
|
|||
}));
|
||||
|
||||
let mentions = composer.mention_items();
|
||||
assert_eq!(mentions.len(), 3);
|
||||
assert_eq!(mentions.len(), 2);
|
||||
assert_eq!(mentions[0].category_tag, Some("[Skill]".to_string()));
|
||||
assert_eq!(mentions[0].path, Some(skill_path.display().to_string()));
|
||||
assert_eq!(mentions[0].display_name, "Google Calendar".to_string());
|
||||
assert_eq!(mentions[1].category_tag, Some("[Plugin]".to_string()));
|
||||
assert_eq!(
|
||||
mentions[1].path,
|
||||
Some("plugin://google-calendar@debug".to_string())
|
||||
);
|
||||
assert_eq!(mentions[2].category_tag, Some("[App]".to_string()));
|
||||
assert_eq!(mentions[2].path, Some("app://google_calendar".to_string()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn plugin_mention_popup_snapshot() {
|
||||
snapshot_composer_state(
|
||||
"plugin_mention_popup",
|
||||
/*enhanced_keys_supported*/ false,
|
||||
|composer| {
|
||||
composer.set_text_content("$sa".to_string(), Vec::new(), Vec::new());
|
||||
composer.set_plugin_mentions(Some(vec![PluginCapabilitySummary {
|
||||
config_name: "sample@test".to_string(),
|
||||
display_name: "Sample Plugin".to_string(),
|
||||
description: Some(
|
||||
"Plugin that includes the Figma MCP server and Skills for common workflows"
|
||||
.to_string(),
|
||||
),
|
||||
has_skills: true,
|
||||
mcp_server_names: vec!["sample".to_string()],
|
||||
app_connector_ids: vec![AppConnectorId("calendar".to_string())],
|
||||
}]));
|
||||
},
|
||||
);
|
||||
assert_eq!(mentions[1].category_tag, Some("[App]".to_string()));
|
||||
assert_eq!(mentions[1].path, Some("app://google_calendar".to_string()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
@ -5525,17 +5384,6 @@ mod tests {
|
|||
path_to_skills_md: test_path_buf("/tmp/repo/google-calendar/SKILL.md").abs(),
|
||||
scope: codex_protocol::protocol::SkillScope::Repo,
|
||||
}]));
|
||||
composer.set_plugin_mentions(Some(vec![PluginCapabilitySummary {
|
||||
config_name: "google-calendar@debug".to_string(),
|
||||
display_name: "Google Calendar".to_string(),
|
||||
description: Some(
|
||||
"Connect Google Calendar for scheduling, availability, and event management."
|
||||
.to_string(),
|
||||
),
|
||||
has_skills: false,
|
||||
mcp_server_names: vec!["google-calendar".to_string()],
|
||||
app_connector_ids: Vec::new(),
|
||||
}]));
|
||||
composer.set_connector_mentions(Some(ConnectorsSnapshot {
|
||||
connectors: vec![AppInfo {
|
||||
id: "google_calendar".to_string(),
|
||||
|
|
|
|||
10
vendor/codex/codex-rs/tui/src/bottom_pane/mod.rs
vendored
10
vendor/codex/codex-rs/tui/src/bottom_pane/mod.rs
vendored
|
|
@ -32,7 +32,6 @@ use bottom_pane_view::ViewCompletion;
|
|||
use codex_core_skills::model::SkillMetadata;
|
||||
use codex_features::Features;
|
||||
use codex_file_search::FileMatch;
|
||||
use codex_plugin::PluginCapabilitySummary;
|
||||
use codex_protocol::request_user_input::RequestUserInputEvent;
|
||||
use codex_protocol::user_input::TextElement;
|
||||
use crossterm::event::KeyCode;
|
||||
|
|
@ -275,11 +274,6 @@ impl BottomPane {
|
|||
self.request_redraw();
|
||||
}
|
||||
|
||||
pub fn set_plugin_mentions(&mut self, plugins: Option<Vec<PluginCapabilitySummary>>) {
|
||||
self.composer.set_plugin_mentions(plugins);
|
||||
self.request_redraw();
|
||||
}
|
||||
|
||||
pub fn set_plugins_command_enabled(&mut self, enabled: bool) {
|
||||
self.composer.set_plugins_command_enabled(enabled);
|
||||
self.request_redraw();
|
||||
|
|
@ -377,10 +371,6 @@ impl BottomPane {
|
|||
self.composer.skills()
|
||||
}
|
||||
|
||||
pub fn plugins(&self) -> Option<&Vec<PluginCapabilitySummary>> {
|
||||
self.composer.plugins()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) fn context_window_percent(&self) -> Option<i64> {
|
||||
self.context_window_percent
|
||||
|
|
|
|||
48
vendor/codex/codex-rs/tui/src/chatwidget.rs
vendored
48
vendor/codex/codex-rs/tui/src/chatwidget.rs
vendored
|
|
@ -122,7 +122,6 @@ use codex_git_utils::local_git_branches;
|
|||
use codex_git_utils::recent_commits;
|
||||
use codex_otel::RuntimeMetricsSummary;
|
||||
use codex_otel::SessionTelemetry;
|
||||
use codex_plugin::PluginCapabilitySummary;
|
||||
use codex_protocol::ThreadId;
|
||||
use codex_protocol::account::PlanType;
|
||||
use codex_protocol::approvals::ElicitationRequestEvent;
|
||||
|
|
@ -5815,8 +5814,6 @@ impl ChatWidget {
|
|||
.collect();
|
||||
let mut skill_names_lower: HashSet<String> = HashSet::new();
|
||||
let mut selected_skill_paths: HashSet<AbsolutePathBuf> = HashSet::new();
|
||||
let mut selected_plugin_ids: HashSet<String> = HashSet::new();
|
||||
|
||||
if let Some(skills) = self.bottom_pane.skills() {
|
||||
skill_names_lower = skills
|
||||
.iter()
|
||||
|
|
@ -5855,30 +5852,6 @@ impl ChatWidget {
|
|||
}
|
||||
}
|
||||
|
||||
if let Some(plugins) = self.plugins_for_mentions() {
|
||||
for binding in &mention_bindings {
|
||||
let Some(plugin_config_name) = binding
|
||||
.path
|
||||
.strip_prefix("plugin://")
|
||||
.filter(|id| !id.is_empty())
|
||||
else {
|
||||
continue;
|
||||
};
|
||||
if !selected_plugin_ids.insert(plugin_config_name.to_string()) {
|
||||
continue;
|
||||
}
|
||||
if let Some(plugin) = plugins
|
||||
.iter()
|
||||
.find(|plugin| plugin.config_name == plugin_config_name)
|
||||
{
|
||||
items.push(UserInput::Mention {
|
||||
name: plugin.display_name.clone(),
|
||||
path: binding.path.clone(),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let mut selected_app_ids: HashSet<String> = HashSet::new();
|
||||
if let Some(apps) = self.connectors_for_mentions() {
|
||||
for binding in &mention_bindings {
|
||||
|
|
@ -10267,14 +10240,6 @@ impl ChatWidget {
|
|||
}
|
||||
}
|
||||
|
||||
fn plugins_for_mentions(&self) -> Option<&[PluginCapabilitySummary]> {
|
||||
if !self.config.features.enabled(Feature::Plugins) {
|
||||
return None;
|
||||
}
|
||||
|
||||
self.bottom_pane.plugins().map(Vec::as_slice)
|
||||
}
|
||||
|
||||
/// Build a placeholder header cell while the session is configuring.
|
||||
fn placeholder_session_header_cell(config: &Config) -> Box<dyn HistoryCell> {
|
||||
let placeholder_style = Style::default().add_modifier(Modifier::DIM | Modifier::ITALIC);
|
||||
|
|
@ -10992,19 +10957,6 @@ impl ChatWidget {
|
|||
}
|
||||
|
||||
pub(crate) fn refresh_plugin_mentions(&mut self) {
|
||||
if !self.config.features.enabled(Feature::Plugins) {
|
||||
self.bottom_pane.set_plugin_mentions(/*plugins*/ None);
|
||||
return;
|
||||
}
|
||||
|
||||
self.app_event_tx.send(AppEvent::RefreshPluginMentions);
|
||||
}
|
||||
|
||||
pub(crate) fn on_plugin_mentions_loaded(
|
||||
&mut self,
|
||||
plugins: Option<Vec<PluginCapabilitySummary>>,
|
||||
) {
|
||||
self.bottom_pane.set_plugin_mentions(plugins);
|
||||
}
|
||||
|
||||
pub(crate) fn sync_plugin_mentions_config(&mut self, config: &Config) {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ use codex_protocol::protocol::ListSkillsResponseEvent;
|
|||
use codex_protocol::protocol::SkillMetadata as ProtocolSkillMetadata;
|
||||
use codex_protocol::protocol::SkillsListEntry;
|
||||
use codex_utils_absolute_path::AbsolutePathBuf;
|
||||
use codex_utils_plugins::mention_syntax::TOOL_MENTION_SIGIL;
|
||||
|
||||
const TOOL_MENTION_SIGIL: char = '$';
|
||||
|
||||
impl ChatWidget {
|
||||
pub(crate) fn open_skills_list(&mut self) {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ pub(super) use crate::legacy_core::config::Config;
|
|||
pub(super) use crate::legacy_core::config::ConfigBuilder;
|
||||
pub(super) use crate::legacy_core::config::Constrained;
|
||||
pub(super) use crate::legacy_core::config::ConstraintError;
|
||||
pub(super) use crate::legacy_core::plugins::OPENAI_CURATED_MARKETPLACE_NAME;
|
||||
pub(super) use crate::model_catalog::ModelCatalog;
|
||||
pub(super) use crate::test_backend::VT100Backend;
|
||||
pub(super) use crate::test_support::PathBufExt;
|
||||
|
|
@ -226,6 +225,8 @@ pub(super) use tokio::sync::mpsc::error::TryRecvError;
|
|||
pub(super) use tokio::sync::mpsc::unbounded_channel;
|
||||
pub(super) use toml::Value as TomlValue;
|
||||
|
||||
pub(super) const OPENAI_CURATED_MARKETPLACE_NAME: &str = "openai-curated";
|
||||
|
||||
pub(super) fn chatwidget_snapshot_dir() -> PathBuf {
|
||||
let snapshot_file = codex_utils_cargo_bin::find_resource!(
|
||||
"src/chatwidget/snapshots/codex_tui__chatwidget__tests__chatwidget_tall.snap"
|
||||
|
|
|
|||
|
|
@ -1047,7 +1047,7 @@ async fn submit_user_message_queues_while_compaction_turn_is_running() {
|
|||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn submit_user_message_emits_structured_plugin_mentions_from_bindings() {
|
||||
async fn submit_user_message_ignores_plugin_mentions_from_bindings() {
|
||||
let (mut chat, _rx, mut op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
let conversation_id = ThreadId::new();
|
||||
let rollout_file = NamedTempFile::new().unwrap();
|
||||
|
|
@ -1073,17 +1073,6 @@ async fn submit_user_message_emits_structured_plugin_mentions_from_bindings() {
|
|||
id: "initial".into(),
|
||||
msg: EventMsg::SessionConfigured(configured),
|
||||
});
|
||||
chat.set_feature_enabled(Feature::Plugins, /*enabled*/ true);
|
||||
chat.bottom_pane
|
||||
.set_plugin_mentions(Some(vec![codex_plugin::PluginCapabilitySummary {
|
||||
config_name: "sample@test".to_string(),
|
||||
display_name: "Sample Plugin".to_string(),
|
||||
description: None,
|
||||
has_skills: true,
|
||||
mcp_server_names: Vec::new(),
|
||||
app_connector_ids: Vec::new(),
|
||||
}]));
|
||||
|
||||
chat.submit_user_message(UserMessage {
|
||||
text: "$sample".to_string(),
|
||||
local_images: Vec::new(),
|
||||
|
|
@ -1100,16 +1089,10 @@ async fn submit_user_message_emits_structured_plugin_mentions_from_bindings() {
|
|||
};
|
||||
assert_eq!(
|
||||
items,
|
||||
vec![
|
||||
UserInput::Text {
|
||||
text: "$sample".to_string(),
|
||||
text_elements: Vec::new(),
|
||||
},
|
||||
UserInput::Mention {
|
||||
name: "Sample Plugin".to_string(),
|
||||
path: "plugin://sample@test".to_string(),
|
||||
},
|
||||
]
|
||||
vec![UserInput::Text {
|
||||
text: "$sample".to_string(),
|
||||
text_elements: Vec::new(),
|
||||
}]
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
34
vendor/codex/codex-rs/tui/src/mention_codec.rs
vendored
34
vendor/codex/codex-rs/tui/src/mention_codec.rs
vendored
|
|
@ -1,8 +1,7 @@
|
|||
use std::collections::HashMap;
|
||||
use std::collections::VecDeque;
|
||||
|
||||
use codex_utils_plugins::mention_syntax::PLUGIN_TEXT_MENTION_SIGIL;
|
||||
use codex_utils_plugins::mention_syntax::TOOL_MENTION_SIGIL;
|
||||
const TOOL_MENTION_SIGIL: char = '$';
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub(crate) struct LinkedMention {
|
||||
|
|
@ -109,7 +108,6 @@ fn parse_history_linked_mention<'a>(
|
|||
text_bytes: &[u8],
|
||||
start: usize,
|
||||
) -> Option<(&'a str, &'a str, usize)> {
|
||||
// TUI writes `$name`, but may read plugin `[@name](plugin://...)` links from other clients.
|
||||
if let Some(mention @ (name, path, _)) =
|
||||
parse_linked_tool_mention(text, text_bytes, start, TOOL_MENTION_SIGIL)
|
||||
&& !is_common_env_var(name)
|
||||
|
|
@ -118,14 +116,6 @@ fn parse_history_linked_mention<'a>(
|
|||
return Some(mention);
|
||||
}
|
||||
|
||||
if let Some(mention @ (name, path, _)) =
|
||||
parse_linked_tool_mention(text, text_bytes, start, PLUGIN_TEXT_MENTION_SIGIL)
|
||||
&& !is_common_env_var(name)
|
||||
&& path.starts_with("plugin://")
|
||||
{
|
||||
return Some(mention);
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
|
||||
|
|
@ -211,7 +201,6 @@ fn is_common_env_var(name: &str) -> bool {
|
|||
fn is_tool_path(path: &str) -> bool {
|
||||
path.starts_with("app://")
|
||||
|| path.starts_with("mcp://")
|
||||
|| path.starts_with("plugin://")
|
||||
|| path.starts_with("skill://")
|
||||
|| path
|
||||
.rsplit(['/', '\\'])
|
||||
|
|
@ -249,27 +238,6 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn decode_history_mentions_restores_plugin_links_with_at_sigil() {
|
||||
let decoded = decode_history_mentions(
|
||||
"Use [@sample](plugin://sample@test) and [$figma](app://figma-1).",
|
||||
);
|
||||
assert_eq!(decoded.text, "Use $sample and $figma.");
|
||||
assert_eq!(
|
||||
decoded.mentions,
|
||||
vec![
|
||||
LinkedMention {
|
||||
mention: "sample".to_string(),
|
||||
path: "plugin://sample@test".to_string(),
|
||||
},
|
||||
LinkedMention {
|
||||
mention: "figma".to_string(),
|
||||
path: "app://figma-1".to_string(),
|
||||
},
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn decode_history_mentions_ignores_at_sigil_for_non_plugin_paths() {
|
||||
let decoded = decode_history_mentions("Use [@figma](app://figma-1).");
|
||||
|
|
|
|||
Reference in a new issue