fix(anthropic): use PEP 604 union to satisfy ruff strict-rule budget

sanitize_tool_use_ids_in_anthropic_messages's new model param used
Optional[str], which trips ruff's UP045 (prefer str | None) and pushed
the strict-rule budget over its ceiling in CI. Switch to str | None,
matching the style already used elsewhere in this same file.
This commit is contained in:
benny 2026-07-24 21:22:35 +03:00
parent 646ce42ed3
commit ffbbda6021

View file

@ -1063,7 +1063,7 @@ def _sanitize_tool_use_id_content_block(block: Any, *, preserve_kimi_k2_ids: boo
return block
def sanitize_tool_use_ids_in_anthropic_messages(messages: list[Any], model: Optional[str] = None) -> list[Any]:
def sanitize_tool_use_ids_in_anthropic_messages(messages: list[Any], model: str | None = None) -> list[Any]:
"""
Return a new message list with ``tool_use`` / ``server_tool_use`` ``id`` and
``tool_result`` ``tool_use_id`` values rewritten to satisfy Anthropic's