Repository navigation
Description
fleet: serve <role> --help (and queue-broker --help / secrets-broker --help) starts the daemon instead of printing help
Evidence (verified this run, laptop primary @ eb3e71c)
pkgs/fleet/crates/fleet/src/main.rs, run_domain: the domain-help shortcut only inspects args.first():
if matches!(args.first().map(|s| s.as_str()), Some("--help") | Some("-h") | Some("help")) {
print_domain_help(surface, d);
return EXIT_OK;
}For the serve domain the first argument is the role, so a help flag in position 2 is never seen. The call falls through to the broker entry points — fleet_queue::queue_broker::run() and fleet_queue::secrets_broker::run() (pkgs/fleet/crates/fleet-queue/src/queue_broker.rs:589, secrets_broker.rs:170) — which take no arguments at all and ignore argv entirely, proceeding to bind and serve.
The argv0 aliases hit the same path: main() prepends the implied arg (queue-broker → serve queue-broker), so queue-broker --help becomes args ["queue-broker", "--help"] and also starts the daemon.
Behavioral probe (real fleet binary built on the laptop, fake HOME with probe token files, QUEUE_BROKER_BIND=127.0.0.1:0, 3s timeout):
$ fleet serve queue-broker --help
queue-broker: listening on 127.0.0.1:0 # stderr; killed by timeout, exit 124
$ queue-broker --help # argv0 symlink
queue-broker: listening on 127.0.0.1:0 # stderr; killed by timeout, exit 124
$ fleet serve --help # control
fleet serve — Run a fleet daemon role … # domain help, exit 0
Why it matters
--help is the safe, reflexive first command for any operator or agent meeting a new daemon binary. Here it silently performs the most consequential action the binary has — binding a port and serving the repo-queue / secrets brokers with whatever token files the host carries — instead of printing help. The §3 dispatch contract in the same file says domain help is "always available, even where the domain itself is not"; the role-shaped invocation defeats that contract. It is also an operational footgun for the fleet's own automation, which routinely probes <tool> --help to learn a surface.
Acceptance criteria
fleet serve queue-broker --help,fleet serve secrets-broker --help(and-h/helpin the same position) print the serve domain help and exit 0, without binding anything.- The argv0 forms
queue-broker --helpandsecrets-broker --helpbehave the same. fleet serve <role>with no help flag still starts the role exactly as today;fleet serve --helpand all other domains' help behavior are unchanged.- A test pins the help-after-role routing (e.g. at the dispatch level) so the implied-arg alias route cannot regress it.
Activity
developing-today commentedon Nov 4, 2026
CODE-1336
dezren39 commentedon Nov 4, 2026
agent: new-issue-creator-code-a
state: filed
issue: #5488
Found via: filed this run — code read of
run_domainin pkgs/fleet/crates/fleet/src/main.rs (help shortcut inspects only args.first(); serve's first arg is the role) plus a behavioral probe of the real binary on the laptop:fleet serve queue-broker --helpand argv0queue-broker --helpboth logged "listening on 127.0.0.1:0" and had to be timeout-killed (exit 124), while the controlfleet serve --helpprinted help with exit 0. Both broker entry points (queue_broker::run,secrets_broker::run) take no arguments, so the flag is silently ignored.Disposition: guarded self-solve this run (small, clearly scoped, low-risk): teach the serve-domain dispatch to honor a help flag in the role+1 position, covering both the direct and argv0-alias routes, with a pinning test.
fleet: serve <role> --help prints domain help instead of starting the…
dezren39 commentedon Nov 4, 2026
agent: new-issue-creator-code-a
state: done
issue: #5488
Solved this run via PR #5492, squash-merged at 31a00fb.
run_domainnow routes throughwants_domain_help(domain, args): help flag in position 0 for all domains (unchanged), plus position 1 forserve, coveringfleet serve <role> --helpand the argv0 aliases (queue-broker --help) whose implied arg lands in the same shape.fleet serve queue-brokerstill binds and serves.