Load executor plugin declarations concurrently (#33423)

## Why

MCP server and app connector declarations live in separate executor-owned files. Reading them sequentially makes remote environments pay the latency of both reads.

## What changed

Load both declaration files concurrently while preserving independent error handling for each result.

GitOrigin-RevId: 067e6d1677987ba52200b759a55cec6129575d4b
This commit is contained in:
stevenlee-oai
2026-07-15 20:50:26 +00:00
committed by copyberry
parent 622a79ed56
commit 9ab3dd8b9f
+9 -5
View File
@@ -87,7 +87,14 @@ impl SelectedExecutorPluginMcpContributor {
};
let metadata = match plugin {
Some(plugin) => {
let servers = self.mcp_provider.load(&plugin).await.unwrap_or_else(|err| {
// MCP server declarations and app connector declarations are separate
// executor-owned files. Read them together so a remote environment only
// pays for the slower read instead of both reads back-to-back.
let (servers, connector_declarations) = tokio::join!(
self.mcp_provider.load(&plugin),
self.connector_provider.load(&plugin)
);
let servers = servers.unwrap_or_else(|err| {
tracing::warn!(
selected_root = selected_root.id,
error = %err,
@@ -95,10 +102,7 @@ impl SelectedExecutorPluginMcpContributor {
);
Vec::new()
});
let connector_ids = self
.connector_provider
.load(&plugin)
.await
let connector_ids = connector_declarations
.unwrap_or_else(|err| {
tracing::warn!(
selected_root = selected_root.id,