Repository navigation
Description
Problem
fleet serve <broker-role> <anything> silently discards every argument after the role and starts the daemon anyway. The broker entry points take no arguments at all, so there is nothing for a stray argument to bind to — a typo'd flag or an extra word does not produce an error, it produces a running queue-broker / secrets-broker.
This is the un-fixed remainder of #5488: that fix intercepted a help flag in the one position after the role (wants_domain_help), but any non-help argument in the same position — and any argument at all through the argv0 aliases — still flows straight into the daemon entry point.
Evidence (verified this run, laptop primary at e844ed1)
Code:
pkgs/fleet/crates/fleet/src/main.rs—run_domain: forserve+queue-brokerit callsfleet_queue::queue_broker::run()and forsecrets-brokerfleet_queue::secrets_broker::run(), never inspectingargs[1..]. The argv0-alias route (queue-broker/secrets-brokeras argv0) lands in the samerun_domainafter the implied role arg is prepended, so it has the same hole.pkgs/fleet/crates/fleet-queue/src/queue_broker.rs:589—pub fn run() -> i32(no args).pkgs/fleet/crates/fleet-queue/src/secrets_broker.rs:189—pub fn run() -> i32(no args).
Probe (fleet binary rebuilt on the laptop from e844ed1, Source rev: e844ed152dd1; HOME pointed at an empty dir so the daemon dies at its first startup step — the token-file read — proving which path was entered):
| invocation | result |
|---|---|
fleet serve queue-broker --help |
domain help, exit 0 (control — #5488 fix works) |
fleet serve queue-broker |
queue-broker: cannot read token file …, exit 3 (daemon startup) |
fleet serve queue-broker --bogus-junk |
identical token-file error, exit 3 |
fleet serve queue-broker frobnicate |
identical token-file error, exit 3 |
fleet serve secrets-broker --bogus-junk |
secrets-broker: cannot read token file …, exit 3 |
queue-broker --bogus-junk (argv0 alias) |
identical token-file error, exit 3 |
With the real token files present the same invocations proceed past the token read to binding the broker port (observed with the pre-fix binary: cannot bind 100.99.113.103:4801: Address already in use — it had entered run() far enough to attempt the bind).
Why it matters
These brokers hold the queue's service-role credentials path and the secrets resolver. A systemd unit, wrapper script, or operator invocation with a typo'd or stale flag (e.g. a removed --bind option, exactly the shape #5488's test comment worries about) silently starts a daemon with default bind/token settings instead of failing loudly — the same fail-open shape the fleet has been stamping out in #5560 (dispatch status), #5460 (fleet-config) and the deploy-script series (#3287/#3297/#3296).
Acceptance criteria
fleet serve queue-broker <any extra arg>andfleet serve secrets-broker <any extra arg>exit 2 with a usage error naming the unexpected argument, before any daemon startup (no token-file read, no bind attempt).- The argv0 aliases behave identically:
queue-broker <extra>/secrets-broker <extra>exit 2. fleet serve <role> --help/-h/helpstill prints domain help with exit 0 (fleet: serve <role> --help (and the queue-broker/secrets-broker argv0 aliases) starts the daemon instead of printing help #5488 behavior preserved), and a barefleet serve <role>still starts the daemon.- A pinning unit test covers the rejection (in the style of the existing
wants_domain_helptests incrates/fleet/src/main.rs). cargo test -p fleetpasses on the laptop or in CI.
Activity
developing-today commentedon Nov 4, 2026
CODE-1376
dezren39 commentedon Nov 4, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 4, 2026
🤖 Agent note · picked up
dezren39 commentedon Nov 4, 2026
🤖 Agent note · handed off
cancel_repo_task: task 9662 is not queued or parked). Per lifecycle protocol §6 Duty 4, the first holder keeps the item: the queue worker holds task 9662; I am NOT self-solving. Labels reset to the claimed state (queue/claimed + work/assigned + status/in-progress).37 remaining items
dezren39 commentedon Nov 5, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 5, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 5, 2026
Cross-link from the creator run that filed #6212: the standalone
queue-broker/secrets-broker[[bin]] artifacts in fleet-queue bypass this issue'srun_domainroute entirely (theirmain()s callrun()directly), so they are filed separately as #6212 with the boundary stated in both bodies. This issue's scope (fleet serve + argv0 aliases) is unchanged.dezren39 commentedon Nov 5, 2026
🤖 Agent note · handed off
opencodeagain (attempts 18/32), so this task is handed off; the laptop claimant launches the bound opencode session which drives it to its terminal state.dezren39 commentedon Nov 5, 2026
Agent note - handed off
ses_e5e5353d6deffeAyOvxCtuJn55