Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test(integration): expect signed empty thinking blocks to survive /v1/messages replay after #41362 (#46686)

Mateo Wang8fb6fee8c503
diff --git a/tests/integration/messages_endpoint/providers/anthropic/reasoning/test_anthropic_reasoning_request_translation_wire.py b/tests/integration/messages_endpoint/providers/anthropic/reasoning/test_anthropic_reasoning_request_translation_wire.py
index 4fc99e2dd67..99b03b0d820 100644
--- a/tests/integration/messages_endpoint/providers/anthropic/reasoning/test_anthropic_reasoning_request_translation_wire.py
+++ b/tests/integration/messages_endpoint/providers/anthropic/reasoning/test_anthropic_reasoning_request_translation_wire.py
@@ -442,11 +442,24 @@ def _tool_loop(assistant_content: list[JsonValue]) -> dict[str, JsonValue]:
{"type": "redacted_thinking", "data": "EmwKAhgBEgy3va3pzix"},
{"type": "tool_use", "id": "toolu_01", "name": "Read", "input": {"file_path": "/repo/config.yaml"}},
],
+ [
+ {"type": "thinking", "thinking": "", "signature": "EqQBCkgIBRABGAIiQM"},
+ {"type": "redacted_thinking", "data": "EmwKAhgBEgy3va3pzix"},
+ {"type": "tool_use", "id": "toolu_01", "name": "Read", "input": {"file_path": "/repo/config.yaml"}},
+ ],
+ id="signed-empty-thinking-and-redacted-thinking-kept",
+ ),
+ pytest.param(
+ [
+ {"type": "thinking", "thinking": ""},
+ {"type": "redacted_thinking", "data": "EmwKAhgBEgy3va3pzix"},
+ {"type": "tool_use", "id": "toolu_01", "name": "Read", "input": {"file_path": "/repo/config.yaml"}},
+ ],
[
{"type": "redacted_thinking", "data": "EmwKAhgBEgy3va3pzix"},
{"type": "tool_use", "id": "toolu_01", "name": "Read", "input": {"file_path": "/repo/config.yaml"}},
],
- id="empty-thinking-stripped-redacted-thinking-kept",
+ id="unsigned-empty-thinking-stripped-redacted-thinking-kept",
),
),
)