perf(workflow): add tests, adapt some LLM node output formats, optimize sandbox return format

This commit is contained in:
Eternity
2026-02-06 15:17:58 +08:00
parent 7b72bf0cd0
commit 87d53fb9b7
25 changed files with 6576 additions and 15 deletions

View File

@@ -27,11 +27,11 @@ async def run_nodejs_code(code: str, preload: str, options: RunnerOptions):
try:
runner = NodejsRunner()
result = await runner.run(code, options, preload)
if result.exit_code == signal.SIGSYS + 0x80:
if result.exit_code in [signal.SIGSYS + 0x80, -signal.SIGSYS]:
return error_response(31, "sandbox security policy violation")
if result.exit_code != 0:
return error_response(500, result.stderr)
return error_response(result.exit_code, result.stderr)
return success_response(RunCodeResponse(
stdout=result.stdout,
@@ -39,5 +39,5 @@ async def run_nodejs_code(code: str, preload: str, options: RunnerOptions):
))
except Exception as e:
logger.error(f"Python execution failed: {e}", exc_info=True)
return error_response(-500, str(e))
logger.error(f"JavaScript execution failed: {e}", exc_info=True)
return error_response(500, str(e))