Skip to content

fleet(proxy): proxy connect --help and init --help answer help through the error channel — exit 2 on stderr instead of usage on stdout at exit 0 #5619

Closed

Description

@dezren39

fleet(proxy): proxy connect --help and init --help report help through the error channel — exit 2 on stderr instead of usage on stdout at exit 0

Summary

Two fleet proxy leaves answer a help request as if it were a usage
error. Every other leaf in the binary prints its usage to stdout and
exits 0 when asked (proxy serve --help since #5575, dispatch status/launch/enqueue --help since #5560, search --help, the root
and domain help). These two are the remaining outliers:

  • fleet proxy connect --help / -h — exit 2, usage text on
    stderr prefixed fleet:, nothing on stdout.
  • fleet init --help / -h and fleet proxy init --help — exit
    2, stderr fleet: fleet init takes no arguments (got "--help"):
    the help flag is reported as an illegal argument.

Scripts and agents that probe a leaf with --help (the standard
"how do I call this" check, and the smoke-harness pattern) read a
failure where the binary was simply asked for its own usage.

Evidence (verified this run, real binary built from laptop primary @4733d598f, temp HOME)

$ fleet proxy connect --help   → exit 2, stdout empty, stderr: fleet: usage: fleet proxy connect [--print-path] [--stdio [--host H] [--port N]] [--request METHOD PATH [--service-port N] [--token-file F] [--body JSON]]
$ fleet proxy connect -h       → exit 2 (same)
$ fleet init --help            → exit 2, stderr: fleet: fleet init takes no arguments (got "--help")
$ fleet init -h                → exit 2 (same)
$ fleet proxy init --help      → exit 2 (same)
controls:
$ fleet proxy serve --help     → exit 0, usage on stdout
$ fleet dispatch status --help → exit 0, usage on stdout
$ fleet search --help          → exit 0, usage on stdout
$ fleet --help                 → exit 0

Root cause (file:line at 4733d59)

  • pkgs/fleet/crates/fleet-proxy/src/client.rs:335-343 —
    ConnectArgs::parse handles --help/-h by returning
    Err(ClientError::Usage(<usage text>)); ClientError::Usage
    maps to exit 2 (client.rs exit_code()), and the caller in
    pkgs/fleet/crates/fleet/src/main.rs:589-595 prints it with
    eprintln!("fleet: {e}"). The usage text exists — it is only
    reachable through the error channel.
  • pkgs/fleet/crates/fleet-proxy/src/client.rs:435-446 —
    run_init rejects any non-empty argv with the usage error
    before checking for a help flag, so --help/-h hit the
    "takes no arguments" rejection. Both entry points land here:
    root fleet init (main.rs:692 → cmd_init → run_init_call,
    main.rs:610) and fleet proxy init (main.rs:605).

No pinning test covers either leaf's help behavior (client.rs
has no test module).

Why it matters

Acceptance criteria

  • fleet proxy connect --help and -h print the connect usage to
    stdout and exit 0, with no broker connection or spawn attempted.
  • fleet init --help / -h and fleet proxy init --help / -h
    print the init usage to stdout and exit 0, with no probe, spawn,
    or shim sync attempted.
  • Non-help argument handling is unchanged: fleet init <bogus>
    still exits 2 naming the argument; proxy connect unknown
    arguments still exit 2.
  • New pinning tests cover both leaves' help forms (and the init
    non-help rejection), in the style of the existing
    proxy_serve_args_classify_help_and_reject_strays /
    status_help_and_rejection_need_no_service tests.
  • cargo test -p fleet -p fleet-proxy green on the laptop or CI;
    cargo fmt clean.

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
    source/creatorFiled by the new-issue-creator job
    priority/lowNice to have; do when convenient
    on Nov 4, 2026
  2. developing-today commented on Nov 4, 2026

    @developing-today
    Contributor
  3. added
    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 · filed

  5. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    • Agent: new-issue-creator job (new-issue-creator-code-a)
    • Session / ID: cron job new-issue-creator-code-a, run 2026-11-04 12:05 CST
    • Found via: filed this run
    • Task: Guarded self-solve complete — proxy connect --help/-h and init --help/-h (root + proxy init) now print usage to stdout at exit 0; non-help rejection unchanged.
    • Expectation: done — PR fix(fleet-proxy): proxy connect/init --help prints usage at exit 0 #5620 squash-merged (45be075); cargo test -p fleet -p fleet-proxy green on the laptop (new pins proxy_connect_and_init_help_exit_ok, init_help_succeeds_without_touching_the_broker); fixed binary re-probed (all help forms exit 0 on stdout, --bogus forms still exit 2).
    • Links: PR fix(fleet-proxy): proxy connect/init --help prints usage at exit 0 #5620 (merged)
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