mirror of
https://github.com/usestrix/strix.git
synced 2026-08-22 02:58:39 +02:00
Drop strict tool schemas on Claude routes
This commit is contained in:
committed by
Ahmed Allam
parent
6f88b7d7d5
commit
d6f2218756
@@ -112,3 +112,19 @@ def test_wait_for_agents_is_available_in_both_modes() -> None:
|
||||
for interactive in (True, False):
|
||||
agent = factory.build_strix_agent(is_root=True, interactive=interactive)
|
||||
assert "wait_for_agents" in [t.name for t in agent.tools]
|
||||
|
||||
|
||||
def test_strict_tool_schemas_can_be_disabled_per_route() -> None:
|
||||
"""Claude routes cap strict tools; the toolset must be sendable without strict."""
|
||||
agent = factory.build_strix_agent(is_root=True, strict_tool_schemas=False)
|
||||
|
||||
function_tools = [t for t in agent.tools if isinstance(t, FunctionTool)]
|
||||
assert function_tools
|
||||
assert not any(t.strict_json_schema for t in function_tools)
|
||||
|
||||
|
||||
def test_disabling_strict_leaves_shared_tools_untouched() -> None:
|
||||
factory.build_strix_agent(is_root=True, strict_tool_schemas=False)
|
||||
agent = factory.build_strix_agent(is_root=True)
|
||||
|
||||
assert any(t.strict_json_schema for t in agent.tools if isinstance(t, FunctionTool))
|
||||
|
||||
@@ -9,6 +9,7 @@ from strix.config.models import (
|
||||
RECOMMENDED_MODEL_NAMES,
|
||||
is_recommended_or_frontier_model,
|
||||
request_timeout_extra_args,
|
||||
supports_strict_tool_schemas,
|
||||
)
|
||||
|
||||
|
||||
@@ -90,3 +91,24 @@ def test_frontier_model_families_are_accepted(model_name: str) -> None:
|
||||
)
|
||||
def test_non_frontier_models_are_rejected(model_name: str) -> None:
|
||||
assert not is_recommended_or_frontier_model(model_name)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"model_name",
|
||||
[
|
||||
"anthropic/claude-sonnet-4-6",
|
||||
"bedrock/anthropic.claude-opus-4-8-v1:0",
|
||||
"vertex_ai/claude-sonnet-5",
|
||||
"Sonnet-5",
|
||||
],
|
||||
)
|
||||
def test_claude_routes_reject_strict_tool_schemas(model_name: str) -> None:
|
||||
assert not supports_strict_tool_schemas(model_name)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"model_name",
|
||||
["openai/gpt-5.4", "gpt-5.4", "gemini/gemini-3.1-pro-preview", "deepseek/deepseek-v4"],
|
||||
)
|
||||
def test_other_routes_keep_strict_tool_schemas(model_name: str) -> None:
|
||||
assert supports_strict_tool_schemas(model_name)
|
||||
|
||||
Reference in New Issue
Block a user