Skip to content

Commit 1492975

Browse files
ctruedenclaude
andcommitted
Make the script engine more robust
Fixes several bugs: * Outputs of any type convertible from NDArray (including String and double) were packed as images on the Python side, crashing the script. Now only numpy values are packed, and numpy scalars become plain numbers. * ShmImg inputs had their shared memory closed after the script ran, corrupting the caller's image. * NDArray outputs declared as Object were returned already closed. * Non-JSON inputs (File, services, etc.) were serialized reflectively; now Files become paths, enums/chars become strings, and anything else is skipped with a warning. * Output written via print() was silently discarded; stdout and stderr are now forwarded to the script context's writers. * Tracebacks pointed at the generated wrapper script; the user script is now compiled with its real path, so line numbers are correct. * Environments are now actually cached per JVM, named after the env file rather than the script (so scripts can share an environment), and built with progress reported to the status bar. * Errors keep their causes; interrupting a script kills the worker. * Undefined outputs no longer fail the script, and the value of the script's final expression is now returned. The Python-side wrapper now lives in wrapper.py rather than being generated by string concatenation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 79c670d commit 1492975

5 files changed

Lines changed: 818 additions & 170 deletions

File tree

0 commit comments

Comments
 (0)