From b8a7a5210756bd733e41b536e0235f4dcdd8318f Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 13 May 2026 15:40:27 +0100 Subject: [PATCH] Remove TUI plugin mention authority --- notes/fresh-workspace-handoff.md | 9 + state/ledgers.msgpack | Bin 99596 -> 99993 bytes state/map.yaml | 7 +- vendor/codex/codex-rs/Cargo.lock | 2 - vendor/codex/codex-rs/tui/Cargo.toml | 2 - .../tui/src/app/background_requests.rs | 5 - .../codex-rs/tui/src/app/event_dispatch.rs | 9 - vendor/codex/codex-rs/tui/src/app_event.rs | 9 - .../tui/src/bottom_pane/chat_composer.rs | 162 +----------------- .../codex/codex-rs/tui/src/bottom_pane/mod.rs | 10 -- vendor/codex/codex-rs/tui/src/chatwidget.rs | 48 ------ .../codex-rs/tui/src/chatwidget/skills.rs | 3 +- .../codex-rs/tui/src/chatwidget/tests.rs | 3 +- .../tui/src/chatwidget/tests/plan_mode.rs | 27 +-- .../codex/codex-rs/tui/src/mention_codec.rs | 34 +--- 15 files changed, 30 insertions(+), 300 deletions(-) diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 4bcac3d6..530bf399 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -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 diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 90d970d63aeac8ae139b34da6d043e879234d305..747b6b85f9f0fb7875a11a847cfff50f89a2c872 100644 GIT binary patch delta 376 zcmYk2y-EW?6onbleF00G3t}T1QfQM+qbwHb1huh|*`3MmCA)Wq`3Y{7B4Qy5f?&*J zSlQ%B?5uqWXX8TB-MROi^Bv~-DO$cnuZKI2cb`Y^jP1==>}$nXGG7emY=8G;ket5# zd>qfd*(mi6u5U)5D_ F1pu7m4#NNd diff --git a/state/map.yaml b/state/map.yaml index 89ea2466..3ecaf9cc 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -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. diff --git a/vendor/codex/codex-rs/Cargo.lock b/vendor/codex/codex-rs/Cargo.lock index f37c2398..e49b549e 100644 --- a/vendor/codex/codex-rs/Cargo.lock +++ b/vendor/codex/codex-rs/Cargo.lock @@ -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", diff --git a/vendor/codex/codex-rs/tui/Cargo.toml b/vendor/codex/codex-rs/tui/Cargo.toml index e3df93f3..16771d4d 100644 --- a/vendor/codex/codex-rs/tui/Cargo.toml +++ b/vendor/codex/codex-rs/tui/Cargo.toml @@ -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 } diff --git a/vendor/codex/codex-rs/tui/src/app/background_requests.rs b/vendor/codex/codex-rs/tui/src/app/background_requests.rs index acf03eb8..75175524 100644 --- a/vendor/codex/codex-rs/tui/src/app/background_requests.rs +++ b/vendor/codex/codex-rs/tui/src/app/background_requests.rs @@ -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, diff --git a/vendor/codex/codex-rs/tui/src/app/event_dispatch.rs b/vendor/codex/codex-rs/tui/src/app/event_dispatch.rs index d4bfa45e..1d767071 100644 --- a/vendor/codex/codex-rs/tui/src/app/event_dispatch.rs +++ b/vendor/codex/codex-rs/tui/src/app/event_dispatch.rs @@ -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) diff --git a/vendor/codex/codex-rs/tui/src/app_event.rs b/vendor/codex/codex-rs/tui/src/app_event.rs index 8654684a..dce1e433 100644 --- a/vendor/codex/codex-rs/tui/src/app_event.rs +++ b/vendor/codex/codex-rs/tui/src/app_event.rs @@ -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>, - }, - /// Advance the post-install plugin app-auth flow. PluginInstallAuthAdvance { refresh_connectors: bool, diff --git a/vendor/codex/codex-rs/tui/src/bottom_pane/chat_composer.rs b/vendor/codex/codex-rs/tui/src/bottom_pane/chat_composer.rs index a529d169..a03c35ce 100644 --- a/vendor/codex/codex-rs/tui/src/bottom_pane/chat_composer.rs +++ b/vendor/codex/codex-rs/tui/src/bottom_pane/chat_composer.rs @@ -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, skills: Option>, - plugins: Option>, connectors_snapshot: Option, dismissed_mention_popup_token: Option, mention_bindings: HashMap, @@ -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>) { - 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> { - 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::(); - 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::(); @@ -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::(); 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(), diff --git a/vendor/codex/codex-rs/tui/src/bottom_pane/mod.rs b/vendor/codex/codex-rs/tui/src/bottom_pane/mod.rs index c9dc4db2..622a23cc 100644 --- a/vendor/codex/codex-rs/tui/src/bottom_pane/mod.rs +++ b/vendor/codex/codex-rs/tui/src/bottom_pane/mod.rs @@ -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>) { - 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> { - self.composer.plugins() - } - #[cfg(test)] pub(crate) fn context_window_percent(&self) -> Option { self.context_window_percent diff --git a/vendor/codex/codex-rs/tui/src/chatwidget.rs b/vendor/codex/codex-rs/tui/src/chatwidget.rs index 7d2ee249..284cf1ea 100644 --- a/vendor/codex/codex-rs/tui/src/chatwidget.rs +++ b/vendor/codex/codex-rs/tui/src/chatwidget.rs @@ -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 = HashSet::new(); let mut selected_skill_paths: HashSet = HashSet::new(); - let mut selected_plugin_ids: HashSet = 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 = 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 { 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>, - ) { - self.bottom_pane.set_plugin_mentions(plugins); } pub(crate) fn sync_plugin_mentions_config(&mut self, config: &Config) { diff --git a/vendor/codex/codex-rs/tui/src/chatwidget/skills.rs b/vendor/codex/codex-rs/tui/src/chatwidget/skills.rs index 90467800..cfa0fdd0 100644 --- a/vendor/codex/codex-rs/tui/src/chatwidget/skills.rs +++ b/vendor/codex/codex-rs/tui/src/chatwidget/skills.rs @@ -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) { diff --git a/vendor/codex/codex-rs/tui/src/chatwidget/tests.rs b/vendor/codex/codex-rs/tui/src/chatwidget/tests.rs index f001c3af..bc3d2fc2 100644 --- a/vendor/codex/codex-rs/tui/src/chatwidget/tests.rs +++ b/vendor/codex/codex-rs/tui/src/chatwidget/tests.rs @@ -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" diff --git a/vendor/codex/codex-rs/tui/src/chatwidget/tests/plan_mode.rs b/vendor/codex/codex-rs/tui/src/chatwidget/tests/plan_mode.rs index 1f91a8e1..fd0d3824 100644 --- a/vendor/codex/codex-rs/tui/src/chatwidget/tests/plan_mode.rs +++ b/vendor/codex/codex-rs/tui/src/chatwidget/tests/plan_mode.rs @@ -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(), + }] ); } diff --git a/vendor/codex/codex-rs/tui/src/mention_codec.rs b/vendor/codex/codex-rs/tui/src/mention_codec.rs index f6cd38bd..e957bc1d 100644 --- a/vendor/codex/codex-rs/tui/src/mention_codec.rs +++ b/vendor/codex/codex-rs/tui/src/mention_codec.rs @@ -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).");