mirror of
https://github.com/openai/codex.git
synced 2026-11-05 20:10:33 +00:00
## What changed - Add `codex.skills.catalog.entries` and `codex.plugins.catalog.entries` histograms with `cloud` or `executor` stages and `complete`, `warning`, or `partial` status. Partial results take precedence over warnings. - Exclude cached reads and repeated observations of unchanged failed skill discovery from metric samples. - Mark executor skill catalogs partial when discovery fails, and clear unpublished executor plugin catalogs instead of publishing an empty result. ## Testing Extend skill integration tests to check catalog counts and statuses, fresh discovery snapshots, partial discovery, and repeated reads without duplicate samples. Update plugin state tests to distinguish unpublished catalogs from empty discovery results. GitOrigin-RevId: e25978ba9fce54e9660853b1d9673ddab6db5061
67 lines
2.2 KiB
Rust
67 lines
2.2 KiB
Rust
use codex_core::config::Config;
|
|
use codex_extension_api::ExtensionFuture;
|
|
use codex_extension_api::ExtensionRegistryBuilder;
|
|
use codex_extension_api::McpServerContribution;
|
|
use codex_extension_api::McpServerContributionContext;
|
|
use codex_extension_api::McpServerContributor;
|
|
use codex_mcp::CODEX_APPS_MCP_SERVER_NAME;
|
|
use codex_mcp::hosted_plugin_runtime_mcp_server_config;
|
|
|
|
mod catalog_observability;
|
|
mod cloud_plugin;
|
|
mod plugin;
|
|
mod plugin_contributor;
|
|
mod plugin_contributor_state;
|
|
mod plugin_providers;
|
|
mod stream_manager;
|
|
|
|
pub use codex_core_plugins::PluginListQuery;
|
|
pub use codex_core_plugins::PluginProvider;
|
|
pub use codex_core_plugins::PluginProviderError;
|
|
pub use codex_core_plugins::PluginProviderFuture;
|
|
pub use codex_core_plugins::PluginProviderResult;
|
|
pub use plugin_contributor::install_plugin_providers;
|
|
pub use plugin_contributor::install_plugins;
|
|
pub use plugin_contributor_state::PluginsThreadState;
|
|
pub use plugin_providers::PluginProviders;
|
|
pub use stream_manager::McpEventStreamManager;
|
|
pub use stream_manager::McpEventStreamUpdate;
|
|
|
|
struct HostedPluginRuntimeExtension;
|
|
|
|
impl McpServerContributor<Config> for HostedPluginRuntimeExtension {
|
|
fn id(&self) -> &'static str {
|
|
"hosted_plugin_runtime"
|
|
}
|
|
|
|
fn contribute<'a>(
|
|
&'a self,
|
|
context: McpServerContributionContext<'a, Config>,
|
|
) -> ExtensionFuture<'a, Vec<McpServerContribution>> {
|
|
Box::pin(async move {
|
|
let config = context.config();
|
|
let name = CODEX_APPS_MCP_SERVER_NAME.to_string();
|
|
if !config.features.enabled(codex_features::Feature::Apps) {
|
|
return vec![McpServerContribution::Remove { name }];
|
|
}
|
|
|
|
vec![McpServerContribution::HostedApps {
|
|
config: Box::new(hosted_plugin_runtime_mcp_server_config(
|
|
&config.chatgpt_base_url,
|
|
config.apps_mcp_product_sku.as_deref(),
|
|
context.originator(),
|
|
)),
|
|
protocol_mode: None,
|
|
}]
|
|
})
|
|
}
|
|
}
|
|
|
|
pub fn install(builder: &mut ExtensionRegistryBuilder<Config>) {
|
|
builder.mcp_server_contributor(std::sync::Arc::new(HostedPluginRuntimeExtension));
|
|
}
|
|
|
|
#[cfg(test)]
|
|
#[path = "lib_tests.rs"]
|
|
mod tests;
|