From 32119bac269b881d512b82df74af285e8c60adc2 Mon Sep 17 00:00:00 2001 From: jif Date: Tue, 24 Nov 2026 10:32:46 +0000 Subject: [PATCH] Remove the test-only plugin guidance renderer (#63605) The turn context renders generic plugin guidance through `AvailablePluginsInstructions`. Remove `render_plugins_section` and its sole caller, a test that checks the bundled guidance through that helper. GitOrigin-RevId: 30e2b7aaab9432b7a29b8124676907b8dc1228e9 --- codex-rs/core/src/plugins/render.rs | 15 --------------- codex-rs/core/src/plugins/render_tests.rs | 17 ----------------- 2 files changed, 32 deletions(-) diff --git a/codex-rs/core/src/plugins/render.rs b/codex-rs/core/src/plugins/render.rs index f721eb35e1..dd34a16924 100644 --- a/codex-rs/core/src/plugins/render.rs +++ b/codex-rs/core/src/plugins/render.rs @@ -1,26 +1,11 @@ -#[cfg(test)] -use crate::context::AvailablePluginsInstructions; -#[cfg(test)] -use crate::context::ContextualUserFragment; use crate::plugins::PluginCapabilitySummary; use codex_features::Feature; use codex_features::Features; use codex_prompts::ResolvedSelectedPluginMessages; -#[cfg(test)] -use codex_protocol_test_support::ContentItemTestExt; use codex_utils_string::take_bytes_at_char_boundary; const MAX_EXPLICIT_PLUGIN_INSTRUCTIONS_BYTES: usize = 4 * 1024; -#[cfg(test)] -pub(crate) fn render_plugins_section(plugins: &[PluginCapabilitySummary]) -> Option { - (!plugins.is_empty()).then(|| { - AvailablePluginsInstructions::default() - .render() - .expect_text() - }) -} - pub(crate) fn render_explicit_plugin_instructions( plugin: &PluginCapabilitySummary, available_mcp_servers: &[String], diff --git a/codex-rs/core/src/plugins/render_tests.rs b/codex-rs/core/src/plugins/render_tests.rs index 0074d26fca..60111e25e0 100644 --- a/codex-rs/core/src/plugins/render_tests.rs +++ b/codex-rs/core/src/plugins/render_tests.rs @@ -1,23 +1,6 @@ use super::*; use pretty_assertions::assert_eq; -#[test] -fn render_plugins_section_keeps_plugin_usage_guidance_without_listing_plugins() { - let rendered = render_plugins_section(&[PluginCapabilitySummary { - config_name: "sample@test".to_string(), - display_name: "sample".to_string(), - plugin_namespace: None, - description: Some("inspect sample data".to_string()), - has_skills: true, - ..PluginCapabilitySummary::default() - }]) - .expect("plugin section should render"); - - let expected = "\n## Plugins\nA plugin is a local bundle of skills, MCP servers, and apps.\n### How to use plugins\n- Skill naming: If a plugin contributes skills, those skill entries are prefixed with `plugin_name:` in the Skills list.\n- MCP naming: Plugin-provided MCP tools keep standard MCP identifiers such as `mcp__server__tool`; use tool provenance to tell which plugin they come from.\n- Trigger rules: If the user explicitly names a plugin, prefer capabilities associated with that plugin for that turn.\n- Relationship to capabilities: Plugins are not invoked directly. Use their underlying skills, MCP tools, and app tools to help solve the task.\n- Relevance: Determine what a plugin can help with from explicit user mention or from the plugin-associated skills, MCP tools, and apps exposed elsewhere in this turn.\n- Missing/blocked: If the user requests a plugin that does not have relevant callable capabilities for the task, say so briefly and continue with the best fallback.\n"; - - assert_eq!(rendered, expected); -} - #[test] fn explicit_plugin_instructions_use_manifest_namespace_for_skills() { let rendered = render_explicit_plugin_instructions(