test(anthropic): make the mid-conversation tool attachment assertion real

This commit is contained in:
Mrunmayee Daware 2026-10-11 10:31:02 +05:30 • committed by GitHub
parent 8be8af99b1
commit 9e952605ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -110,8 +110,8 @@ class TestMidConversationSystemPlacement:
)
roles: Final = [message["role"] for message in result["messages"]]
assert "system" not in roles
first_tool_index: Final = roles.index("tool") if "tool" in roles else -1
first_tool_index: Final = roles.index("tool")
# tool content must remain attached to its own message before any converted text
assert first_tool_index != -1 or True
assert roles[first_tool_index + 1] == "user"
wire_text: Final = str(result["messages"])
assert "tool_result" in wire_text and "be terse" in wire_text