Skip to content

fleet: root built-ins (version / capabilities / --version) silently ignore trailing arguments #5572

Closed

Description

@dezren39

Problem

The fleet binary's root built-in commands silently discard trailing arguments: fleet version <anything>, fleet capabilities <anything>, and fleet --version <anything> all print their normal output and exit 0, whatever follows. The root dispatcher itself is strict everywhere else — an unknown subcommand is a usage error (exit 2) — so a typo'd invocation like fleet version --bogus-flag (or a wrapper passing a stale flag) succeeds silently instead of failing as a usage error.

Same fail-open class as #5560 (fleet-dispatch status, fixed) and #5568 (serve broker roles) — but a different code path: those live in the domain dispatchers; this one is run_root in the top-level binary, whose version / capabilities / --version arms never check args.len().

Evidence (verified this run, laptop primary at e844ed1)

Code — pkgs/fleet/crates/fleet/src/main.rs, run_root:

  • Some("--version") | Some("-V") arm prints and returns EXIT_OK unconditionally (the --help arm right above it does guard with args.len() == 1; these do not).
  • Some("version") → print_version(...) → EXIT_OK, no arity check.
  • Some("capabilities") → print_capabilities(...) → EXIT_OK, no arity check.

Probe (fleet binary rebuilt on the laptop from e844ed1, Source rev: e844ed152dd1):

invocation result
fleet version version block, exit 0 (control)
fleet version --bogus identical version block, exit 0
fleet capabilities --bogus identical JSON, exit 0
fleet --version --bogus fleet 0.1.0, exit 0
fleet versio (control) error: unrecognized subcommand 'versio', exit 2

Why it matters

These are the exact surfaces scripts and agents parse (fleet version for the census/source rev, fleet capabilities for the capability JSON). A caller passing a misspelled or retired flag gets valid-looking output and a success exit, so version/capability gating in automation silently runs on the wrong assumptions — the fleet has been removing this shape wherever it appears (#5560, #5460, #3287 series) because silent success on a typo is how stale invocations survive migrations.

Acceptance criteria

  • fleet version <extra>, fleet capabilities <extra>, and fleet --version <extra> / fleet -V <extra> exit 2 with a usage error naming the unexpected argument.
  • Bare fleet version, fleet capabilities, fleet --version, fleet -V are unchanged (same output, exit 0).
  • The existing --help-arm arity behavior is unchanged.
  • A pinning unit test covers the rejection; cargo test -p fleet passes on the laptop or in CI.

Activity

  1. developing-today commented on Nov 4, 2026

    @developing-today
    Contributor
  2. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    source/creatorFiled by the new-issue-creator job
    queue/queuedHas a queued task in the Supabase agent queue
    priority/lowNice to have; do when convenient
    app/fleetpkgs/fleet multicall binary + platform crates
    on Nov 4, 2026
  3. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  4. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 4, 2026
  5. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  6. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/fleetpkgs/fleet multicall binary + platform crateskind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions