mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Allow hosted Apps MCP contributions to override the protocol mode (#46019)
## What changed Add an optional `protocol_mode` to `McpServerContribution::HostedApps` and apply it when registering the server. Preserve the hosted Apps default when no override is provided. ## Testing Add an integration test that selects MCP `2026-07-28` with the global feature disabled and completes a native user verification flow, including resuming the tool call with the verification response. Extend capability tests to confirm that the override preserves hosted Apps user verification without granting it to ordinary extension registrations. GitOrigin-RevId: e8662c45f964c00b0bb4503bbcfd8432d7e2fa70
This commit is contained in:
1 parent
fc2ea82e7e
commit
6d75b525ea
10 files changed
+224
-29
No files matched your search
@@ -144,7 +144,11 @@ pub enum McpServerContribution {
|
||||
protocol_mode: crate::McpProtocolMode,
|
||||
},
|
||||
/// Registers the controller-owned Apps server under its reserved name.
|
||||
HostedApps { config: Box<McpServerConfig> },
|
||||
HostedApps {
|
||||
config: Box<McpServerConfig>,
|
||||
/// Overrides the HTTP protocol mode, or uses the hosted Apps default when absent.
|
||||
protocol_mode: Option<crate::McpProtocolMode>,
|
||||
},
|
||||
/// Registers a server declared by a plugin selected for this thread.
|
||||
SelectedPlugin {
|
||||
name: String,
|
||||
|
||||
@@ -44,6 +44,7 @@ impl McpServerContributor<Config> for HostedPluginRuntimeExtension {
|
||||
config.apps_mcp_product_sku.as_deref(),
|
||||
context.originator(),
|
||||
)),
|
||||
protocol_mode: None,
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
@@ -31,7 +31,13 @@ async fn hosted_plugin_runtime_forwards_thread_originator() -> Result<(), Box<dy
|
||||
/*executor_capability_discovery*/ None,
|
||||
))
|
||||
.await;
|
||||
let [McpServerContribution::HostedApps { config: server }] = contributions.as_slice() else {
|
||||
let [
|
||||
McpServerContribution::HostedApps {
|
||||
config: server,
|
||||
protocol_mode: None,
|
||||
},
|
||||
] = contributions.as_slice()
|
||||
else {
|
||||
panic!("hosted plugin runtime should contribute one server");
|
||||
};
|
||||
let McpServerTransportConfig::StreamableHttp { http_headers, .. } = &server.transport else {
|
||||
|
||||
Reference in new issue
Block a user