Skip to content

fleet(search): --version/-V silently ignores trailing arguments — a real verb after it is swallowed with exit 0 #5607

Closed

Description

@dezren39

Bug

fleet search --version (and -V) silently ignores all trailing arguments — including a real verb. The version shortcut in fleet_search::run matches only the first argument and returns success, discarding the rest.

This is the exact bug class fixed today for the queue domain in #5603 / PR #5605 (and earlier for the root built-ins in #5572). The search domain was missed because it does not use fleet main's shortcut: run_domain delegates the whole arg vector to fleet_search::run (pkgs/fleet/crates/fleet/src/main.rs, search branch), whose own shortcut never checks arity.

Evidence

pkgs/fleet/crates/fleet-search/src/lib.rs:528 pub fn run(...); :544:

Some("--version") | Some("-V") => {
    println!("fleet search {}", env!("CARGO_PKG_VERSION"));
    EXIT_OK
}

No args.get(1) check — compare the queue-domain fix at pkgs/fleet/crates/fleet/src/main.rs (commit 7912457), which rejects a trailing argument with a usage error naming it.

Verified this run with a probe crate on the laptop against current main (7912457), calling fleet_search::run(&Config::default(), args) directly (probe: ~/git/fleet/probe-search-version on the laptop):

fleet search 0.1.0
PROBE ["--version"] -> exit 0
fleet search 0.1.0
PROBE ["--version", "--bogus-junk"] -> exit 0
fleet search 0.1.0
PROBE ["-V", "extra"] -> exit 0
fleet search 0.1.0
PROBE ["--version", "get-chunk"] -> exit 0

The last case is the sharp one: fleet search --version get-chunk … prints the version and exits 0 instead of running (or rejecting) the chunk request — a typo'd or scripted invocation silently does nothing while reporting success. The same path serves the atlas-search argv0 route (see the run doc comment), so the flaw is reachable there too.

Why it matters

Silent success on malformed input is the fleet CLI's recurring correctness trap (#5488, #5560, #5575, #5592, #5603): scripts and agents that compose flags cannot trust exit 0. The queue domain was hardened today; the search domain should match the house contract — a version flag takes no trailing arguments.

Acceptance criteria

  • fleet search --version <anything> and -V <anything> exit with the usage code (2), print a usage error naming the first unexpected argument, and print no version line.
  • Bare fleet search --version / -V still print fleet search <version> and exit 0.
  • A pinning test in fleet-search covers both flags with a trailing argument plus the bare controls (mirroring queue_domain_version_rejects_trailing_arguments from fix(fleet): queue-domain --version rejects trailing arguments (#5603) #5605).
  • cargo test -p fleet-search passes.

Activity

  1. 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
    on Nov 4, 2026
  2. developing-today commented on Nov 4, 2026

    @developing-today
    Contributor
  3. added
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    work/self-assignedAn agent grabbed this item directly, outside the queue
    app/fleetpkgs/fleet multicall binary + platform crates
    on Nov 4, 2026
  4. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: filed
    Found via: filed this run (creator lane B) — probe crate on the laptop against current main 7912457 calling fleet_search::run directly: ["--version","--bogus-junk"], ["-V","extra"], and ["--version","get-chunk"] all exit 0 with the version printed and the trailing argument silently discarded. Same bug class as #5603 (queue domain, fixed in #5605 today); the search domain was missed because run_domain delegates to fleet_search::run, whose shortcut at pkgs/fleet/crates/fleet-search/src/lib.rs:544 never checks arity.
    Plan: guarded self-solve this run — reject trailing arguments on the --version/-V shortcut with a usage error naming the first extra argument, add a pinning test mirroring #5605's, verify with cargo test -p fleet-search on the laptop, PR and merge when green.

  5. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: done
    Self-solved this run (guarded): PR #5609 squash-merged (aebeb02) — the --version/-V shortcut in fleet_search::run now rejects any trailing argument with a usage error naming it (exit 2, no version line); pinning test version_shortcut_rejects_trailing_arguments added. cargo test -p fleet-search 18 passed on the laptop; probe crate re-run against the fixed tree: bare --version exit 0, --version --bogus-junk / -V extra / --version get-chunk all exit 2. Issue closed by the merge; work labels stripped.

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/normalOrdinary priority (the default)source/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