diff --git a/codex-rs/core/src/plugins/render.rs b/codex-rs/core/src/plugins/render.rs index fc197dbbea..6cb7f77b82 100644 --- a/codex-rs/core/src/plugins/render.rs +++ b/codex-rs/core/src/plugins/render.rs @@ -48,6 +48,18 @@ pub(crate) fn render_explicit_plugin_instructions( )); } + if !plugin.app_connector_ids.is_empty() { + lines.push(format!( + "- App IDs declared by this plugin, including templates: {}.", + plugin + .app_connector_ids + .iter() + .map(|connector_id| format!("`{}`", connector_id.0)) + .collect::>() + .join(", ") + )); + } + if lines.len() == 1 { return None; } diff --git a/codex-rs/core/src/plugins/render_tests.rs b/codex-rs/core/src/plugins/render_tests.rs index a0ec531209..35c475905b 100644 --- a/codex-rs/core/src/plugins/render_tests.rs +++ b/codex-rs/core/src/plugins/render_tests.rs @@ -1,4 +1,5 @@ use super::*; +use codex_plugin::AppConnectorId; use pretty_assertions::assert_eq; #[test] @@ -21,3 +22,25 @@ fn render_plugins_section_includes_descriptions_and_skill_naming_guidance() { assert_eq!(rendered, expected); } + +#[test] +fn render_explicit_plugin_instructions_include_declared_app_ids() { + let rendered = render_explicit_plugin_instructions( + &PluginCapabilitySummary { + display_name: "sample".to_string(), + app_connector_ids: vec![ + AppConnectorId("connector_calendar".to_string()), + AppConnectorId("templated_apps_Databricks".to_string()), + ], + ..PluginCapabilitySummary::default() + }, + &[], + &[], + ) + .expect("plugin app IDs should render"); + + assert_eq!( + rendered, + "Capabilities from the `sample` plugin:\n- App IDs declared by this plugin, including templates: `connector_calendar`, `templated_apps_Databricks`.\nUse these plugin-associated capabilities to help solve the task." + ); +}