mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-15 09:12:18 +00:00
test(e2e): assert codex called the long-named mcp tool, not just any tool
This commit is contained in:
parent
6b24d1f429
commit
8394895e97
1 changed files with 7 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue