You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
engage: add -r flag to reload config of a running squadron (#103)
* engage: add -r flag to reload config of a running squadron
A second `squadron engage` against a config dir that already has a
running instance now errors out with a hint, instead of attempting a
fork that would have failed later in daemon.Fork's IsRunning check.
Passing `-r` / `--reload` to a second `engage` signals the running
daemon over SIGHUP to re-read and validate its config. The reload runs
through the same wsbridge.Client.ReloadConfig path the command center
uses, so it inherits the validate-then-atomic-swap semantics: a broken
config is rejected and the running daemon keeps its previous config.
If `-r` is passed when nothing is running, the flag is noted and ignored
and engage starts squadron normally.
Includes tests for daemon.Reload covering: missing PID file, malformed
PID file, stale PID, and actual SIGHUP delivery to a live process.
* engage -r: notify command center on reload, harden PID checks, ginkgo tests
- Forked daemon now removes its own PID file on graceful shutdown so the
next `engage` doesn't see a stale PID after a non-`disengage` exit.
- IsRunning gained a ps-based liveness check: the PID file is rejected
(and cleaned up) unless the live process's command line contains
`squadron` or `squadtest`. Prevents PID reuse from masking a dead
daemon as alive.
- Early IsRunning check in runEngage is now gated on !engageForeground so
the forked child (which runs --foreground and would otherwise see the
parent-written PID file pointing at itself) doesn't bail out as
"already running".
- wsbridge.Client.NotifyConfigReloaded(err) pushes an unsolicited
TypeReloadConfigResult envelope to the command center after every
SIGHUP-driven reload, reusing the existing wire message shape. Empty
RequestID signals it's a one-way event, not a response. CC needs to
handle this push (CC-side change is the user's call).
- Tests converted to ginkgo/gomega:
* internal/daemon/daemon_ginkgo_test.go covers ClearPid + Reload
* wsbridge/notify_reload_test.go covers NotifyConfigReloaded (added to
the existing internal-package suite so we don't add a second
RunSpecs).
* Docs: document `squadron engage -r` for config reload
- cli/engage.mdx: add -r/--reload to the flags table, a Reloading
configuration section showing success/failure output, the four-case
behavior matrix, and what a successful reload actually does (re-reads
HCL, swaps plugin set, pushes scheduler config, notifies command
center, leaves in-flight missions untouched).
- cli/disengage.mdx: cross-link to the reload flow so readers who reach
for `disengage` to apply a config edit see the cheaper alternative.
- compare/langgraph.mdx: replace "restart Squadron" with
"squadron engage -r" in the plugin auto-build pitch.
* Docs: trim engage -r section
Copy file name to clipboardExpand all lines: docs/content/cli/engage.mdx
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,7 @@ Multiple projects can run simultaneously on the same host — each gets its own
39
39
| Flag | Description |
40
40
|------|-------------|
41
41
|`-c, --config`| Path to config directory (default: `.`) |
42
+
|`-r, --reload`| Reload the config of an already-running Squadron (see [Reloading configuration](#reloading-configuration)) |
42
43
|`--headless`| Skip launching the local command center UI |
43
44
|`--cc-port`| Port for the local command center (default: `8080`) |
44
45
|`--foreground`| Run in the terminal instead of forking to background |
@@ -89,6 +90,16 @@ Keeps the process attached to the terminal. Useful for debugging or when running
89
90
squadron engage --cc-port 9090
90
91
```
91
92
93
+
## Reloading configuration
94
+
95
+
After editing your HCL files, reload the running daemon in place:
96
+
97
+
```bash
98
+
squadron engage -r
99
+
```
100
+
101
+
The new config is validated first; if it's bad, the running daemon keeps its previous config and the command prints the error. In-flight missions and chat sessions keep running on the config they started with.
Copy file name to clipboardExpand all lines: docs/content/compare/langgraph.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,7 +122,7 @@ Why plugins matter relative to LangGraph's "tools are Python functions in the sa
122
122
123
123
-**Two languages, picked per problem.** Go for performance-critical or systems-level tools (a browser controller, a network scanner, anything CPU-heavy or needing static binary distribution). Python for things that lean on the existing PyPI ecosystem (a pandas pipeline, a model adapter, a domain SDK).
124
124
-**Process isolation.** A misbehaving plugin can't crash the runtime — gRPC failure mode is a clean error returned to the agent, not a Python exception unwinding through your orchestrator.
125
-
-**Auto-build from source.** Edit `./plugin_scraper/main.go`, restart Squadron, and the plugin rebuilds. Content-hash caching skips the rebuild when nothing changed. No `pip install -e .` cycle, no Docker layer to rebuild.
125
+
-**Auto-build from source.** Edit `./plugin_scraper/main.go`, reload Squadron with `squadron engage -r`, and the plugin rebuilds. Content-hash caching skips the rebuild when nothing changed. No `pip install -e .` cycle, no Docker layer to rebuild.
126
126
-**Stateful across tasks.** Plugins are cached globally for the lifetime of the process. A Playwright plugin can open a browser in task 1 and reuse it in task 5 — the runtime tracks the plugin connection, not the per-task call.
127
127
-**Typed schemas.** Each plugin declares tool input/output schemas; Squadron uses those for native LLM function-calling and for output validation.
128
128
-**Distributable.** Plugins compile to a single binary (Go) or a venv (Python) and are publishable as GitHub releases. Other Squadron configs reference them via `source = "github.com/owner/repo"` and Squadron auto-installs.
0 commit comments