From 7c9883a7ee0f67e79e622ed65e36d75be3f7cead Mon Sep 17 00:00:00 2001 From: Teknium Date: Sat, 4 Apr 2026 11:51:11 -0700 Subject: [PATCH] fix: use _get_env_config() instead of raw TERMINAL_ENV env var Read terminal backend type through the canonical config resolution path (terminal_tool._get_env_config) instead of os.getenv directly. --- tools/code_execution_tool.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tools/code_execution_tool.py b/tools/code_execution_tool.py index f94465b144..cdbfaee208 100644 --- a/tools/code_execution_tool.py +++ b/tools/code_execution_tool.py @@ -427,11 +427,6 @@ def _rpc_server_loop( # Remote execution support (file-based RPC via terminal backend) # --------------------------------------------------------------------------- -def _get_env_type() -> str: - """Return the configured terminal environment type.""" - return os.getenv("TERMINAL_ENV", "local") - - def _get_or_create_env(task_id: str): """Get or create the terminal environment for *task_id*. @@ -896,7 +891,8 @@ def execute_code( return json.dumps({"error": "No code provided."}) # Dispatch: remote backends use file-based RPC, local uses UDS - env_type = _get_env_type() + from tools.terminal_tool import _get_env_config + env_type = _get_env_config()["env_type"] if env_type != "local": return _execute_remote(code, task_id, enabled_tools)