From 5e87eb714d58dabc04804e4d9d4e6e7b2031030a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 7 Jul 2026 09:24:59 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- studio/backend/routes/inference.py | 1 - studio/backend/tests/test_confirm_code_execution.py | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/studio/backend/routes/inference.py b/studio/backend/routes/inference.py index 1e06e76bee..8eae0f7f3e 100644 --- a/studio/backend/routes/inference.py +++ b/studio/backend/routes/inference.py @@ -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 []) ) diff --git a/studio/backend/tests/test_confirm_code_execution.py b/studio/backend/tests/test_confirm_code_execution.py index 18b23be5a8..f6776e53ab 100644 --- a/studio/backend/tests/test_confirm_code_execution.py +++ b/studio/backend/tests/test_confirm_code_execution.py @@ -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.