Open-source AI penetration testing tool to find and fix your app’s vulnerabilities.
Python agentsai-hackingai-penetration-testingai-pentestingai-securityartificial-intelligencebug-bountycode-qualityctf-toolscybersecuritycybersecurity-toolsethical-hackinghackingllm-securityoffensive-securitypenetration-testingpentesting-toolsred-teamingsecuritysecurity-automation
Support routed OpenAI required tool choice (#732)
alex sc13960ae01a3
diff --git a/strix/core/inputs.py b/strix/core/inputs.pyindex f723c52b..e53ae321 100644--- a/strix/core/inputs.py+++ b/strix/core/inputs.py@@ -24,6 +24,10 @@ DEFAULT_MAX_TURNS = 500def _accepts_required_tool_choice(model_name: str | None) -> bool:name = (model_name or "").strip().lower()+ for prefix in ("litellm/", "any-llm/"):+ if name.startswith(prefix):+ name = name[len(prefix) :]+ breakreturn name.startswith("openai/") or is_known_openai_bare_model(name)diff --git a/tests/test_inputs.py b/tests/test_inputs.pyindex ca1ba0d9..486c7e54 100644--- a/tests/test_inputs.py+++ b/tests/test_inputs.py@@ -135,3 +135,23 @@ def test_make_model_settings_skips_required_tool_choice_for_non_openai_models())assert settings.tool_choice is None+++def test_make_model_settings_forces_required_for_routed_openai_model() -> None:+ settings = make_model_settings(+ None,+ model_name="litellm/openai/gpt-4o",+ force_required_tool_choice=True,+ )++ assert settings.tool_choice == "required"+++def test_make_model_settings_forces_required_for_anyllm_routed_openai_model() -> None:+ settings = make_model_settings(+ None,+ model_name="any-llm/openai/gpt-4o",+ force_required_tool_choice=True,+ )++ assert settings.tool_choice == "required"