mirror of
https://github.com/openai/codex.git
synced 2026-11-26 23:40:43 +00:00
Search selected plugin apps before falling back (#38484)
## What changed - When an explicitly selected plugin has apps available, instruct the model to use `tool_search` to discover relevant tools before falling back to unrelated or built-in tools. - Scope the guidance to the request that selected the plugin and omit it for plugins without available apps. ## Testing - Cover app-specific rendering, non-app plugins, bounded instruction output, and app enablement in dual-surface plugin requests. GitOrigin-RevId: 1b9501cc403d2817334a9307e683e99c140a794a
This commit is contained in:
@@ -24,6 +24,17 @@ pub(crate) fn render_explicit_plugin_instructions(
|
||||
plugin.display_name
|
||||
)];
|
||||
|
||||
if !available_apps.is_empty() {
|
||||
lines.push(
|
||||
concat!(
|
||||
"- For the user request that explicitly selected this plugin, and only for that ",
|
||||
"request, if `tool_search` is available and an app from this plugin may help, ",
|
||||
"search for its tools before falling back to unrelated or built-in tools."
|
||||
)
|
||||
.to_string(),
|
||||
);
|
||||
}
|
||||
|
||||
if plugin.has_skills {
|
||||
let skill_namespace = plugin
|
||||
.plugin_namespace
|
||||
@@ -34,17 +45,6 @@ pub(crate) fn render_explicit_plugin_instructions(
|
||||
));
|
||||
}
|
||||
|
||||
if !available_mcp_servers.is_empty() {
|
||||
lines.push(format!(
|
||||
"- MCP servers from this plugin available in this session: {}.",
|
||||
available_mcp_servers
|
||||
.iter()
|
||||
.map(|server| format!("`{server}`"))
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ")
|
||||
));
|
||||
}
|
||||
|
||||
if !available_apps.is_empty() {
|
||||
lines.push(format!(
|
||||
"- Apps from this plugin available in this session: {}.",
|
||||
@@ -56,6 +56,17 @@ pub(crate) fn render_explicit_plugin_instructions(
|
||||
));
|
||||
}
|
||||
|
||||
if !available_mcp_servers.is_empty() {
|
||||
lines.push(format!(
|
||||
"- MCP servers from this plugin available in this session: {}.",
|
||||
available_mcp_servers
|
||||
.iter()
|
||||
.map(|server| format!("`{server}`"))
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ")
|
||||
));
|
||||
}
|
||||
|
||||
if lines.len() == 1 {
|
||||
return None;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user