mirror of
https://github.com/openai/codex.git
synced 2026-09-10 20:26:47 +00:00
Expose plugin app IDs in invocation guidance
This commit is contained in:
@@ -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::<Vec<_>>()
|
||||
.join(", ")
|
||||
));
|
||||
}
|
||||
|
||||
if lines.len() == 1 {
|
||||
return None;
|
||||
}
|
||||
|
||||
@@ -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."
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user