Skip to content

fleet: proxy serve --help (and any trailing argument) silently starts the session-proxy daemon #5575

Closed

Description

@dezren39

fleet: proxy serve --help (and any trailing argument) silently starts the session-proxy daemon

Evidence (verified this run, laptop primary @ 6d7845e, real fleet binary)

pkgs/fleet/crates/fleet/src/main.rs, run_proxy: the serve branch dispatches straight to the daemon without ever inspecting the trailing arguments:

Some("serve") => {
    #[cfg(feature = "proxy-serve")]
    {
        fleet_proxy::serve::run(config)
    }
    ...
}

fleet_proxy::serve::run (pkgs/fleet/crates/fleet-proxy/src/serve.rs:346) takes only &Config — it has no argument list at all — so everything after serve is dropped on the floor before the socket is bound. The domain-help shortcut in run_domain (wants_domain_help) only special-cases the serve domain's role position (the #5488 fix); the proxy domain's serve subcommand sits one level deeper and is not covered. The argv0 alias lands in the same place: laptop-agent-broker implies serve, so laptop-agent-broker --help becomes args ["serve", "--help"] and also starts the daemon.

Behavioral probe (real binary built on the laptop, fake HOME, FLEET_BROKER_SOCKET pointed at a temp path, 3s timeout):

$ fleet proxy serve --help
fleet proxy serve on /tmp/probe-proxy-home/broker.sock   # killed by timeout, exit 124
$ fleet proxy serve --bogus-junk
fleet proxy serve on /tmp/probe-proxy-home/broker.sock   # killed by timeout, exit 124
$ laptop-agent-broker --help                             # argv0 symlink
fleet proxy serve on /tmp/probe-proxy-home/broker.sock   # killed by timeout, exit 124
$ fleet proxy --help                                     # control
fleet proxy — The session proxy: …                       # domain help, exit 0
$ fleet proxy connect --help                             # control
fleet: usage: fleet proxy connect …                      # usage error, exit 2, no daemon

Why it matters

--help is the safe, reflexive first command for any operator or agent meeting a daemon binary; here it silently performs the most consequential action the binary has — binding the session-broker socket and serving — instead of printing help, and a typo'd flag is swallowed the same way. This is exactly the bug class already fixed twice in this binary (#5488 for fleet serve <role> --help, #5560 for fleet dispatch status swallowing its arguments); the proxy domain's serve leaf is the remaining surface with the same shape: a no-argument daemon entry point reached through an argument-discarding dispatch. The §3 dispatch contract in main.rs says domain help is "always available, even where the domain itself is not" — the serve leaf defeats it.

Acceptance criteria

  • fleet proxy serve --help / -h prints usage for the serve leaf (or the proxy domain help) and exits 0, without binding the socket.
  • fleet proxy serve <any other argument> fails with a usage error (exit 2) before binding anything.
  • The argv0 form laptop-agent-broker --help behaves the same.
  • Bare fleet proxy serve still starts the broker exactly as today; fleet proxy connect, fleet proxy init, and fleet proxy --help behavior are unchanged.
  • A test pins the serve-leaf argument handling at the dispatch level so the implied-arg alias route cannot regress it.

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

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

    • Agent: new-issue-creator-code-a (creator lane A)
    • Session / ID: new-issue-creator-code-a run 2026-11-04 10:05 CST
    • Found via: filed this run
    • Task: Fix fleet proxy serve discarding all trailing arguments — --help/-h prints serve usage and exits 0 without binding; any other argument is a usage error (exit 2) before binding; bare proxy serve and the laptop-agent-broker argv0 route unchanged in behavior apart from the same arg handling. Verified pre-filing with the real fleet binary on the laptop (main @ 6d7845e, fake HOME, temp broker socket): proxy serve --help, proxy serve --bogus-junk, and laptop-agent-broker --help all bound the socket and served until timeout-killed (124); controls proxy --help (exit 0) and proxy connect --help (exit 2, no daemon) behaved correctly.
    • Expectation: effort xs; done = fix merged, cargo test -p fleet green on the laptop, fixed binary re-probed (help/reject bind nothing, bare serve still serves). Guarded self-solve this run (trivial, small, low-risk — same bug class as fleet: serve <role> --help (and the queue-broker/secrets-broker argv0 aliases) starts the daemon instead of printing help #5488/fleet dispatch status silently ignores all arguments — --help performs a live GET /health and typos are swallowed #5560).
    • Links: body evidence in the issue; probe ran against the laptop primary binary with a temp FLEET_BROKER_SOCKET.
  5. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    • Agent: new-issue-creator-code-a (creator lane A)
    • Session / ID: new-issue-creator-code-a run 2026-11-04 10:05 CST
    • Found via: filed this run
    • Task: DONE — PR fix(fleet): proxy serve honors --help and rejects stray arguments (#5575) #5577 squash-merged (2a19d13): run_proxy's serve branch now gates on classify_proxy_serve_args — a help flag anywhere in the tail prints PROXY_SERVE_USAGE (exit 0), any other trailing argument is a usage error (exit 2), both before the broker socket is bound; bare proxy serve unchanged. New pinning test proxy_serve_args_classify_help_and_reject_strays; cargo test -p fleet green on the laptop (3 passed), fmt applied. Fixed binary re-probed (fake HOME, temp socket): help/reject create no socket file and exit 0/2, argv0 laptop-agent-broker --help prints usage, bare serve still binds and serves.
    • Expectation: closed — issue auto-closed by the merge; work labels stripped.
    • Links: PR fix(fleet): proxy serve honors --help and rejects stray arguments (#5575) #5577; pre-fix probe evidence in the issue body.
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