From 00b7152a601218aeb8424d9cefef621a127242a8 Mon Sep 17 00:00:00 2001 From: andrewgu-oai Date: Wed, 26 Aug 2026 00:57:06 +0000 Subject: [PATCH] Fix MCP denial assertion for structured output (#40748) ## What changed Update the attachment-owned permissions test to read the denial message from the text content item in the restricted MCP tool's structured output. GitOrigin-RevId: a4b219b6f14f1b40e8c586147f535748b1770b13 --- codex-rs/core/tests/suite/rmcp_client.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/codex-rs/core/tests/suite/rmcp_client.rs b/codex-rs/core/tests/suite/rmcp_client.rs index 1fc7a19c18..9e4cd7b02a 100644 --- a/codex-rs/core/tests/suite/rmcp_client.rs +++ b/codex-rs/core/tests/suite/rmcp_client.rs @@ -1831,8 +1831,9 @@ async fn stdio_mcp_tool_call_includes_sandbox_state_meta( let final_request = final_mock.single_request(); if attachment_owned_permissions { - let restricted_output = final_request - .function_call_output_text(restricted_call_id) + let restricted_output_item = final_request.function_call_output(restricted_call_id); + let restricted_output = restricted_output_item["output"][1]["text"] + .as_str() .expect("restricted MCP tool should produce a denied call output"); assert!( restricted_output