Route Codex Apps MCP through plugin service (#34389)

## What changed

- Point the default Codex Apps MCP server at `ps/mcp` instead of the legacy Apps endpoint for both `backend-api` and `api/codex` base URLs.
- Use the same server configuration for Codex Apps and the hosted plugin runtime.
- Update MCP integration tests and test-server routing to expect the plugin-service path.

GitOrigin-RevId: 939f20dcff67ba6f79c11b328bfc624b25e3aac2
This commit is contained in:
Alex Daley authored and copyberry committed 2026-07-20 17:55:58 +00:00
1 parent 5a4f5ee64c
commit 6bf4845b60
6 files changed
+24 -37

No files matched your search

+8 -8
View File
@@ -239,27 +239,27 @@ fn selected_mcp_attribution_does_not_join_an_unrelated_local_summary() {
}
#[test]
fn codex_apps_mcp_url_for_base_url_keeps_existing_paths() {
fn codex_apps_mcp_url_for_base_url_uses_plugin_service_paths() {
assert_eq!(
codex_apps_mcp_url_for_base_url("https://chatgpt.com/backend-api"),
"https://chatgpt.com/backend-api/wham/apps"
"https://chatgpt.com/backend-api/ps/mcp"
);
assert_eq!(
codex_apps_mcp_url_for_base_url("https://chat.openai.com"),
"https://chat.openai.com/backend-api/wham/apps"
"https://chat.openai.com/backend-api/ps/mcp"
);
assert_eq!(
codex_apps_mcp_url_for_base_url("http://localhost:8080/api/codex"),
"http://localhost:8080/api/codex/apps"
"http://localhost:8080/api/codex/ps/mcp"
);
assert_eq!(
codex_apps_mcp_url_for_base_url("http://localhost:8080"),
"http://localhost:8080/api/codex/apps"
"http://localhost:8080/api/codex/ps/mcp"
);
}
#[test]
fn codex_apps_server_config_uses_legacy_codex_apps_path() {
fn codex_apps_server_config_uses_plugin_service_path() {
let config = codex_apps_mcp_server_config(
"https://chatgpt.com",
/*apps_mcp_product_sku*/ None,
@@ -270,7 +270,7 @@ fn codex_apps_server_config_uses_legacy_codex_apps_path() {
_ => panic!("expected streamable http transport for codex apps"),
};
assert_eq!(url, "https://chatgpt.com/backend-api/wham/apps");
assert_eq!(url, "https://chatgpt.com/backend-api/ps/mcp");
}
#[test]
@@ -460,7 +460,7 @@ async fn effective_mcp_servers_preserve_runtime_servers() {
}
match &codex_apps.transport {
McpServerTransportConfig::StreamableHttp { url, .. } => {
assert_eq!(url, "https://chatgpt.com/backend-api/wham/apps");
assert_eq!(url, "https://chatgpt.com/backend-api/ps/mcp");
}
other => panic!("expected streamable http transport, got {other:?}"),
}