mirror of
https://github.com/openai/codex.git
synced 2026-10-19 17:28:46 +00:00
## What changed - Support an optional cloud provider alongside executor plugins, refreshing its thread-scoped catalog at each regular turn when plugins are enabled. - Use cloud connector metadata for app attribution without starting cloud-declared MCP servers. - Scope cached catalogs to authentication and Apps availability. Retain the previous catalog on discovery failure within the same scope, clear stale catalogs on auth changes, and reject results completed under outdated credentials. - Add a cancellable regular-task startup phase that reconciles MCP before discovery and reapplies contributor state afterward without invalidating resource caches. ## Testing Add regression coverage for per-turn refresh, empty catalogs, discovery failures, plugin disabling, auth changes during discovery, MCP reconciliation and cancellation, and cloud app attribution alongside executor MCP tools. GitOrigin-RevId: 8469eb109ea316e21cbc4122c52ad8000caeef03
41 lines
1.5 KiB
Rust
41 lines
1.5 KiB
Rust
//! Coordinates cloud turn refreshes and executor MCP contributions with thread-owned catalogs.
|
|
//!
|
|
//! One contributor is registered for both lifecycles. Provider instances are shared, while
|
|
//! catalogs and executor metadata live together in thread extension data.
|
|
|
|
use crate::PluginProviders;
|
|
use codex_core::config::Config;
|
|
use codex_core_plugins::ExecutorPluginProvider;
|
|
use codex_exec_server::EnvironmentManager;
|
|
use codex_extension_api::ExtensionRegistryBuilder;
|
|
use std::sync::Arc;
|
|
|
|
pub(crate) struct PluginContributor {
|
|
pub(crate) providers: PluginProviders,
|
|
}
|
|
|
|
/// Installs one coordinator for cloud turn-start and executor MCP callbacks.
|
|
/// The optional cloud provider never disables executor plugins, and Core's plugin policy applies
|
|
/// to both paths.
|
|
pub fn install_plugin_providers(
|
|
builder: &mut ExtensionRegistryBuilder<Config>,
|
|
providers: PluginProviders,
|
|
) {
|
|
let contributor = Arc::new(PluginContributor { providers });
|
|
builder.thread_lifecycle_contributor(contributor.clone());
|
|
builder.config_contributor(contributor.clone());
|
|
builder.turn_lifecycle_contributor(contributor.clone());
|
|
builder.mcp_server_contributor(contributor);
|
|
}
|
|
|
|
/// Installs plugin support backed by selected environment roots.
|
|
pub fn install_plugins(
|
|
builder: &mut ExtensionRegistryBuilder<Config>,
|
|
environment_manager: Arc<EnvironmentManager>,
|
|
) {
|
|
install_plugin_providers(
|
|
builder,
|
|
PluginProviders::new(Arc::new(ExecutorPluginProvider::new(environment_manager))),
|
|
);
|
|
}
|