[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2026-07-07 09:24:59 +00:00
commit 5e87eb714d
2 changed files with 6 additions and 5 deletions

View file

@ -1768,7 +1768,6 @@ def _enables_code_execution_tool(tools: list[dict]) -> bool:
(python/terminal). ``confirm_code_execution`` only gates those, so the
streaming requirement is scoped to requests that actually expose one."""
from core.inference.tools import CODE_EXECUTION_TOOL_NAMES
return any(
(t.get("function") or {}).get("name") in CODE_EXECUTION_TOOL_NAMES for t in (tools or [])
)

View file

@ -206,7 +206,11 @@ def test_payload_may_enable_code_execution_predicate(monkeypatch):
monkeypatch.setattr("state.tool_policy.get_tool_policy", lambda: None)
class _P:
def __init__(self, enable_tools = None, enabled_tools = None):
def __init__(
self,
enable_tools = None,
enabled_tools = None,
):
self.enable_tools = enable_tools
self.enabled_tools = enabled_tools
@ -218,9 +222,7 @@ def test_payload_may_enable_code_execution_predicate(monkeypatch):
)
# Built-ins on, explicit filter without a code tool -> not code execution (the fix).
assert (
inf._payload_may_enable_code_execution(
_P(enable_tools = True, enabled_tools = ["web_search"])
)
inf._payload_may_enable_code_execution(_P(enable_tools = True, enabled_tools = ["web_search"]))
is False
)
# Built-ins on, code tool in the filter -> code execution.