fix: inline_eval exec() exception escaping crash; update schema description

This commit is contained in:
Jiaqing Liang
2026-04-17 16:06:13 +08:00
parent 47f106c8db
commit 0e3e602121
3 changed files with 5 additions and 4 deletions

5
ga.py
View File

@@ -290,8 +290,9 @@ class GenericAgentHandler(BaseHandler):
old_cwd = os.getcwd()
try:
os.chdir(cwd)
try: result = repr(eval(code, ns))
except SyntaxError: exec(code, ns); result = ns.get('_r', 'OK')
try:
try: result = repr(eval(code, ns))
except SyntaxError: exec(code, ns); result = ns.get('_r', 'OK')
except Exception as e: result = f'Error: {e}'
finally: os.chdir(old_cwd)
else: result = yield from code_run(code, code_type, timeout, cwd, code_cwd=code_cwd, stop_signal=self.code_stop_signal)