mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
Accept explicit contribution context for MCP runtime configuration (#61283)
## What changed - Make `McpManager::runtime_config` accept `McpServerContributionContext` and honor its originator, selected environments, and disabled plugin IDs. - Add `McpServerContributionContext::for_host` to carry thread initialization data, originator, and session source without live extension state or discovery. - Pass explicit global contexts from threadless discovery and control paths. ## Testing Extend the thread manager test to cover host-only contribution identity, originator headers, and server restrictions for disabled plugins and pending environments. GitOrigin-RevId: 04ea2c8951187d9014867f0020223b6a7dd94d8d
This commit is contained in:
@@ -66,6 +66,21 @@ impl<'a, C> McpServerContributionContext<'a, C> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates host-only context with thread identity but no live extension state or discovery.
|
||||
pub fn for_host(
|
||||
config: &'a C,
|
||||
thread_init: Option<&'a ExtensionDataInit>,
|
||||
originator: Option<&'a str>,
|
||||
session_source: Option<&'a SessionSource>,
|
||||
) -> Self {
|
||||
Self {
|
||||
thread_init,
|
||||
originator,
|
||||
session_source,
|
||||
..Self::global(config)
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates context for one model step using only currently available environments.
|
||||
pub fn for_step(
|
||||
config: &'a C,
|
||||
|
||||
Reference in New Issue
Block a user