From 3378621cc04485cf388d4d3c77c4549e402c30f2 Mon Sep 17 00:00:00 2001 From: Alex Daley Date: Fri, 29 May 2026 20:33:15 -0400 Subject: [PATCH] Expose plugin app IDs in invocation guidance --- codex-rs/core/src/plugins/render.rs | 12 ++++++++++++ codex-rs/core/src/plugins/render_tests.rs | 23 +++++++++++++++++++++++ 2 files changed, 35 insertions(+) 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." + ); +}