From 8394895e971d3e2279f01366b02e2f324959b692 Mon Sep 17 00:00:00 2001 From: ryan-crabbe-berri Date: Mon, 2 Nov 2026 23:28:57 -0800 Subject: [PATCH] test(e2e): assert codex called the long-named mcp tool, not just any tool --- tests/e2e/codex/test_long_mcp_tool_name_e2e.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tests/e2e/codex/test_long_mcp_tool_name_e2e.py b/tests/e2e/codex/test_long_mcp_tool_name_e2e.py index fa8567c694d..b6b2fd454ad 100644 --- a/tests/e2e/codex/test_long_mcp_tool_name_e2e.py +++ b/tests/e2e/codex/test_long_mcp_tool_name_e2e.py @@ -6,6 +6,7 @@ from typing import Final import pytest from codex.harness import CodexHarness, McpServer +from codex.run import McpCall from codex.setups import ModelSetup, with_expected_failure from e2e_config import unique_marker @@ -19,8 +20,7 @@ LONG_TOOL_NAME: Final = "read_the_current_secret_value_from_the_vault_that_this_ "deployment", with_expected_failure( "claude_bedrock", - reason="LiteLLM passes Codex's namespaced MCP tool name to Bedrock uncapped and Bedrock rejects tool names over" - " 64 characters, failing every turn (LIT-10289)", + reason="LiteLLM sends Bedrock Converse a tool name over 64 characters, which it rejects (LIT-10289)", ), ) class TestCodexLongMcpToolName: @@ -28,16 +28,14 @@ class TestCodexLongMcpToolName: marker: Final = unique_marker() secret: Final = codex.home / "secret.txt" _ = secret.write_text(marker) - vault: Final = McpServer( - command=sys.executable, - args=(str(MCP_SERVER),), - env={"SECRET_FILE": str(secret), "TOOL_NAME": LONG_TOOL_NAME}, - ) - codex.add_mcp_server("vault", vault) + env: Final = {"SECRET_FILE": str(secret), "TOOL_NAME": LONG_TOOL_NAME} + codex.add_mcp_server("vault", McpServer(command=sys.executable, args=(str(MCP_SERVER),), env=env)) + run: Final = codex.exec( f"Call the {LONG_TOOL_NAME} tool of the vault MCP server, then reply with exactly what it returned.", model=setup.model, cwd=codex.new_workspace(files={}), ) - assert any(marker in call.output for call in run.mcp_calls), run + + assert McpCall(server="vault", tool=LONG_TOOL_NAME, output=marker) in run.mcp_calls, run assert marker in run.answer, run