mirror of
https://github.com/openai/codex.git
synced 2026-11-23 23:10:47 +00:00
Remove duplicate legacy MCP HTTP response size test (#63404)
The `mcp_2026_message_limits` suite already verifies that legacy MCP over HTTP accepts a JSON `tools/list` response larger than 8 MiB. Drop the duplicate test from `mcp_2026_discovery`. GitOrigin-RevId: 9d6b0684558dd2749a32c5052388ff15758a9755
This commit is contained in:
@@ -32,7 +32,6 @@ use wiremock::matchers::path;
|
||||
|
||||
const MODERN_VERSION: &str = "2026-07-28";
|
||||
const LEGACY_VERSION: &str = "2025-06-18";
|
||||
const MAX_MCP_MESSAGE_BYTES: usize = 8 * 1024 * 1024;
|
||||
|
||||
#[path = "mcp_2026_discovery/tool_call_session_meta_tests.rs"]
|
||||
mod tool_call_session_meta_tests;
|
||||
@@ -517,47 +516,6 @@ async fn modern_discovery_accepts_metadata_namespaced_server_identity_over_sse()
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn legacy_http_keeps_existing_large_json_response_behavior() -> anyhow::Result<()> {
|
||||
let server = MockServer::start().await;
|
||||
let padding = Arc::new("x".repeat(MAX_MCP_MESSAGE_BYTES + 1));
|
||||
Mock::given(method("POST"))
|
||||
.and(path("/mcp"))
|
||||
.respond_with(move |request: &Request| {
|
||||
let body: Value = request.body_json().expect("valid JSON-RPC request");
|
||||
match body["method"].as_str() {
|
||||
Some("initialize") => legacy_initialize_response(&body),
|
||||
Some("notifications/initialized") => ResponseTemplate::new(202),
|
||||
Some("tools/list") => ResponseTemplate::new(200).set_body_json(json!({
|
||||
"jsonrpc": "2.0",
|
||||
"id": body["id"],
|
||||
"result": {
|
||||
"tools": [{
|
||||
"name": "legacy_large_tool",
|
||||
"description": padding.as_str(),
|
||||
"inputSchema": {"type": "object"},
|
||||
}],
|
||||
},
|
||||
})),
|
||||
other => panic!("unexpected legacy MCP method {other:?}"),
|
||||
}
|
||||
})
|
||||
.mount(&server)
|
||||
.await;
|
||||
|
||||
let client = create_client(&server, McpProtocolMode::Legacy).await?;
|
||||
initialize_client(&client).await?;
|
||||
let tools = client
|
||||
.list_tools(/*params*/ None, Some(Duration::from_secs(15)))
|
||||
.await?;
|
||||
assert_eq!(
|
||||
tools.tools[0].description.as_deref().map(str::len),
|
||||
Some(MAX_MCP_MESSAGE_BYTES + 1)
|
||||
);
|
||||
client.shutdown().await;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn modern_discovery_retries_transient_service_unavailable() -> anyhow::Result<()> {
|
||||
let server = MockServer::start().await;
|
||||
|
||||
Reference in New Issue
Block a user