Action: Agent Update
A script that can safely replace itself mid-run.
The dashboard shows a "vX.Y available" badge when a server's live agent version is behind. Clicking Update Agent queues the update through the same mechanism above. On the agent side, the download and verification step is kept strictly separate from the actual file swap — and the file swap itself is deliberately the very last statement the script executes, after everything else for that run has already completed and reported back.
That ordering is what makes it safe for a running bash script to overwrite its own file: nothing after the swap depends on the old file contents still being there, because there is nothing after it. A backup of the previous version is kept in case a rollback is ever needed.