Skip to main content

HOT RELOAD

Overview

When swamp serve starts with --hot-reload, it writes a PID file to .swamp/serve.pid and listens for SIGHUP. On receiving the signal, the server reloads all pulled extension bundles without restarting.

The swamp serve reload subcommand reads the PID file and sends SIGHUP to the running process.

Flag

--hot-reload

Default: off. When enabled, the server writes .swamp/serve.pid at startup and removes it on shutdown.

Subcommand

swamp serve reload

Reads .swamp/serve.pid and sends SIGHUP to the serve process. Requires the serve process to be running with --hot-reload.

Exits non-zero if the PID file does not exist or the process is not running.

PID file

Location: .swamp/serve.pid (relative to the repository root).

Written at startup when --hot-reload is active. Contains the process ID of the running swamp serve instance. Removed on clean shutdown.

Reload behavior

On SIGHUP, the server:

  1. Re-reads all pulled extension bundles from .swamp/pulled-extensions/ and .swamp/bundles/
  2. Invalidates cached bundle modules
  3. Serves subsequent requests using the updated bundles

All extension types (models, reports, workflows, vaults) are reloaded. There is no per-extension targeting — a reload refreshes everything.

Platform availability

SIGHUP is a POSIX signal. Hot-reload is available on macOS and Linux. --hot-reload is not available on Windows.