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:
dozaki-openai
2026-08-14 02:54:38 +00:00
committed by copyberry
parent 9d012ca4f5
commit cbe85e117b
3 changed files with 63 additions and 12 deletions
+7
View File
@@ -1134,6 +1134,13 @@ async fn explicit_plugin_mentions_use_apps_for_chatgpt_dual_surface_plugins(
app_enabled,
"plugin app guidance should match app enablement: {developer_messages:?}"
);
assert_eq!(
developer_messages
.iter()
.any(|text| text.contains("if `tool_search` is available")),
app_enabled,
"plugin app search guidance should match app enablement: {developer_messages:?}"
);
assert!(
request
.tool_by_name(SAMPLE_PLUGIN_MCP_NAMESPACE, "echo")