reload_script
Reload Python controller code from disk to update running simulations. Recompiles ScriptNode references or re-executes standalone scripts, enabling iterative debugging.
Instructions
Reload a Python controller from a file on disk.
Two modes, chosen automatically:
If any Action-Graph ScriptNode references this file (inputs:scriptPath), those ScriptNodes are force-recompiled so your on-disk edits take effect on the running graph. This is how you iterate on a ScriptNode controller.
Otherwise the file is (re-)executed as a standalone controller, the way you would use execute_script for code longer than ~20 lines.
Workflow:
Write the controller as a .py file (attach via create_action_graph script_file=... for ScriptNode use)
reload_script to load / recompile it
step_simulation to debug (frozen timeline) or play for a ScriptNode demo
Edit the file and reload_script again to iterate
The file's directory is auto-added to sys.path.
Args: file_path: Path to the Python file on disk. module_name: Optional module name to reload (e.g. 'my_controller'). timeout_s: Cooperative Python deadline; capped by extension policy. max_output_bytes: Per-stream capture limit; capped by policy.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| timeout_s | No | ||
| command_id | No | ||
| module_name | No | ||
| idempotency_key | No | ||
| max_output_bytes | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |