Reuse EnvironmentManager for app-server connectors

Add a connector loading helper that accepts the existing EnvironmentManager and switch app-server paths to use it. Keep the config-only helper as a temporary fallback for callers such as TUI that do not yet pass the manager through.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
starr-openai
2026-04-21 13:00:40 -07:00
co-authored by Codex
parent 2c0a752893
commit a2e02d93fe
5 changed files with 55 additions and 21 deletions
+6 -3
View File
@@ -1046,11 +1046,14 @@ impl MessageProcessor {
}
let outgoing = Arc::clone(&self.outgoing);
let environment_manager = self.thread_manager.environment_manager();
tokio::spawn(async move {
let (all_connectors_result, accessible_connectors_result) = tokio::join!(
connectors::list_all_connectors_with_options(&config, /*force_refetch*/ true),
connectors::list_accessible_connectors_from_mcp_tools_with_options(
&config, /*force_refetch*/ true,
connectors::list_accessible_connectors_from_mcp_tools_with_environment_manager(
&config,
/*force_refetch*/ true,
&environment_manager,
),
);
let all_connectors = match all_connectors_result {
@@ -1063,7 +1066,7 @@ impl MessageProcessor {
}
};
let accessible_connectors = match accessible_connectors_result {
Ok(connectors) => connectors,
Ok(status) => status.connectors,
Err(err) => {
tracing::warn!(
"failed to force-refresh accessible apps after experimental feature enablement: {err:#}"