PYX

Script Editing

Update script task code without recreating the task.

Where to edit

On a script task details page you can edit via:

  • Modify script in 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:

  1. Old in-memory task instance is torn down
  2. Replacement task instance is created with the updated script
  3. Subscriptions are re-attached
  4. Previous persisted lifecycle status is preserved where applicable (paused stays paused, draining stays draining, stopped stays 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

On this page