Script Editing
Update script task code without recreating the task.
Where to edit
On a script task details page you can edit via:
Modify scriptin the header- The redacted script value in the config card
Both open the editor dialog.
Validation before apply
When you save, the new script is compiled and validated before apply.
Empty or invalid scripts are rejected.
Runtime apply behavior
If the task is active and loaded in memory:
- Old in-memory task instance is torn down
- Replacement task instance is created with the updated script
- Subscriptions are re-attached
- Previous persisted lifecycle status is preserved where applicable (
pausedstays paused,drainingstays draining,stoppedstays stopped)
If the task is not currently in memory (not running/recently running), live apply is not available.
Open position safety gate
If the task has open positions:
- Positions are closed at market before edit completion
- If any position fails to close, edit is aborted
- A 5-second grace timeout is used to reduce race conditions
Failure behavior
If restart fails after save:
- Route returns an error
- Task status is persisted as
error
User-facing outcomes
You can see two success modes:
- Applied immediately: updated script is live
- Saved only: script stored, but not live-reloaded