From ee1c503471ff2e3cb18abbdd97902afd3522a77f Mon Sep 17 00:00:00 2001 From: buua436 Date: Tue, 16 Jun 2026 10:34:18 +0800 Subject: [PATCH] fix: sandbox config api method mismatch (#16031) ### What problem does this PR solve? Fixes the sandbox config API method mismatch so the frontend and backend use the same HTTP verb. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- admin/server/services.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/admin/server/services.py b/admin/server/services.py index dc0a41c6c9..341dfafdaf 100644 --- a/admin/server/services.py +++ b/admin/server/services.py @@ -693,17 +693,17 @@ class SandboxMgr: raise AdminException("Failed to create sandbox instance.") try: - # Simple test code that exercises provider wrapping via main(). + # Keep the probe close to the original coverage, but avoid + # `sys` because the sandbox security analyzer blocks it. test_code = """ import json import math -import sys def main() -> dict: - print("Python version:", sys.version) - print("Platform:", sys.platform) - print(f"2 + 2 = {2 + 2}") + left = 2 + right = 2 + print(f"2 + 2 = {left + right}") print(f"JSON dump: {json.dumps({'test': 'data', 'value': 123})}") print(f"Math.sqrt(16) = {math.sqrt(16)}") print("TEST_PASSED")