From 30494cf6deab033ae86ce26876595092ecadec91 Mon Sep 17 00:00:00 2001 From: liqiang-fit2cloud Date: Tue, 18 Nov 2025 17:46:13 +0800 Subject: [PATCH] refactor: avoid using temp files in sandbox. --- apps/common/utils/tool_code.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/common/utils/tool_code.py b/apps/common/utils/tool_code.py index 24009c6a8..e006e2ddf 100644 --- a/apps/common/utils/tool_code.py +++ b/apps/common/utils/tool_code.py @@ -71,11 +71,7 @@ class ToolExecutor: python_paths = CONFIG.get_sandbox_python_package_paths().split(',') _exec_code = f""" try: - import os - import sys - import json - import base64 - import builtins + import sys, json, base64, builtins path_to_exclude = ['/opt/py3/lib/python3.11/site-packages', '/opt/maxkb-app/apps'] sys.path = [p for p in sys.path if p not in path_to_exclude] sys.path += {python_paths}