Skip to content

Hot reload

While a stack runs, saving devhost.toml or any included manifest applies the change without restarting devhost. Only the services the edit affects restart, and an invalid edit leaves the stack running as it was.

noyesnoyesfailsfailsfailsSave devhost.toml or aninclude,or add or delete anincluded fileWait 200 ms for moresavesDoes the wholemanifest validate?Print configurationreload rejected; theaccepted manifestkeeps runningFind affected services:changed ones, theirdependents and theirrepository groupsNew hostnames andfixed ports free?Stop them,dependents firstStart replacements,wait for health checksPublish every routein one Caddy reloadRoll backservicesand routesAccept the manifest:apply its settings,update open pages,print configurationreloaded

A successful reload prints configuration reloaded: followed by the root manifest and every included manifest it read, relative to the root manifest’s directory. Saves from editors that replace the file work the same way, and so do files that start or stop matching an includes pattern.

devhost checks the whole manifest before it changes anything. A rejected edit prints configuration reload rejected with the reason, and every open page with the toolbar shows that reason under the toolbar until a later save is accepted.

  • A syntax error names the file, line, and column.
  • Every other problem starts with the setting it concerns, such as services.api.port.
  • A hostname or fixed port that another stack holds rejects the edit too.

If a service fails to start or a route fails to apply partway through, devhost restores the previous services and routes and reports any error from that restore. Fix the manifest and save again.

You changeWhat happens
A service’s command, environment, cwd, health check, dependsOn, hostname, path, or watchThat service and the services that depend on it restart: dependents stop first, and everything starts again in dependency order.
A service in a repository with a selected checkoutEvery service of that repository restarts together.
A port that other services receive as DEVHOST_PORT_<NAME>Those services restart too, even if nothing else about them changed.
Add a serviceIt starts. A new service that is not selected by a group, a dependency, or alwaysStart stays not started when you started only part of the stack.
Remove a serviceIt stops and its routes go away.
name, killZombies, or any [devtools] settingApplies without restarting any service.
[worktrees].enabledTurning it on keeps the running checkout. Turning it off while another checkout runs switches the stack back to the root checkout, which restarts it.

Everything else keeps running throughout, including chat sessions and connected pages. Automatic ports stay the same when the service still uses port = "auto". Edits to a service that is not started take effect when it starts.

  • name renames the running stack. The stack is still identified by the path of its root manifest.
  • Devtools settings reach open pages without a reload. A page that loaded while every devtools feature was off shows the toolbar after its next reload. Turning chat off hides it; running conversations keep running and reappear when you turn it back on.
  • idleTimeout starts, stops, or restarts the idle countdown, unless --idle-timeout or DEVHOST_IDLE_TIMEOUT sets it.
  • [worktrees].enabled = true keeps the running checkout and forgets a selection saved by an earlier run.
  • Source files. A service’s watch paths mark it changed in the toolbar when files change; restart it with Restart Changed or the shortcut. See Devtools.
  • config.toml. The machine-wide Caddy settings reload on their own; see Proxy ports and listeners.
  • The config editor saves through this same reload and reports when it finishes; see Config editor.
  • The services you started with. Hot reload keeps the command-line selection; stop and start the stack to change it.