From 2cab010c73a6befe3e403a6eeb3d33df1ac6f897 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Thu, 27 Aug 2026 13:34:09 -0700 Subject: [PATCH] test(e2e): check the tool input on the messages path too The /v1/messages validator checked a tool_use block's name and id but not its input, so a block whose location came back empty or wrong still passed, while the chat side rejected the same damage. That gap predates this branch; it is worth closing here because the point of the change is that every parallel call is checked rather than counted. AnthropicContentBlock now declares input as a typed field. It already survived on extra="allow", but reaching it from a test needs a real field to keep the e2e basedpyright gate at zero. Serialization is unchanged: bodies are dumped with exclude_none, so a block without an input still replays exactly as before. --- tests/e2e/llm_translation/test_together_ai_e2e.py | 3 +++ tests/e2e/models.py | 1 + 2 files changed, 4 insertions(+) diff --git a/tests/e2e/llm_translation/test_together_ai_e2e.py b/tests/e2e/llm_translation/test_together_ai_e2e.py index a3ca7f0fc3b..90581aadd43 100644 --- a/tests/e2e/llm_translation/test_together_ai_e2e.py +++ b/tests/e2e/llm_translation/test_together_ai_e2e.py @@ -483,6 +483,9 @@ def _tool_use_blocks(content: list[AnthropicContentBlock] | None) -> list[Anthro def _validated_tool_use_id(block: AnthropicContentBlock) -> str: assert block.name == "get_weather", f"wrong tool called: {block}" assert block.id, f"tool_use block carries no id, so a tool_result cannot answer it: {block}" + assert block.input is not None, f"tool_use block carries no input: {block}" + args = _WeatherArgs.model_validate(block.input) + assert "paris" in args.location.lower(), f"tool input lost the location: {args}" return block.id diff --git a/tests/e2e/models.py b/tests/e2e/models.py index 8d1b17ca256..e8a392599fd 100644 --- a/tests/e2e/models.py +++ b/tests/e2e/models.py @@ -421,6 +421,7 @@ class AnthropicContentBlock(BaseModel): text: str | None = None id: str | None = None name: str | None = None + input: dict[str, object] | None = None class AnthropicToolResultBlock(BaseModel):