Serialize plugin install requests (#32894)

## What changed

- Mark `request_plugin_install` as not supporting parallel tool calls so install requests execute serially.
- Add a unit test covering the handler's parallel-call capability.

GitOrigin-RevId: 5f2c8184562bd776b0e527e5e258c61c604a0910
This commit is contained in:
Matthew Zeng
2026-07-13 23:13:08 +00:00
committed by copyberry
parent fb350d1e7d
commit 7fdf2f254b
2 changed files with 11 additions and 1 deletions

View File

@@ -79,7 +79,7 @@ impl ToolExecutor<ToolInvocation> for RequestPluginInstallHandler {
}
fn supports_parallel_tool_calls(&self) -> bool {
true
false
}
fn handle(&self, invocation: ToolInvocation) -> codex_tools::ToolExecutorFuture<'_> {

View File

@@ -21,6 +21,16 @@ use rmcp::model::ElicitationAction;
use serde_json::json;
use tempfile::tempdir;
#[test]
fn request_plugin_install_does_not_support_parallel_tool_calls() {
let handler = RequestPluginInstallHandler::new(
Vec::new(),
ToolSuggestPresentation::RecommendationContext,
);
assert!(!handler.supports_parallel_tool_calls());
}
#[tokio::test]
async fn verified_plugin_install_completed_requires_installed_plugin() {
let codex_home = tempdir().expect("tempdir should succeed");