8000 `min session destroy -f` prints a usage line that can never parse · Issue #1038 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

min session destroy -f prints a usage line that can never parse #1038

Closed

Description

@norrietaylor

Fixed with: #1043

Surface: min session destroy · Severity: Medium · Class: clap group definition

Reproduce

min session destroy -f
  error: the following required arguments were not provided:
    --all
    <SESSION>
  Usage: min session destroy --all --force <SESSION>

The suggested invocation is impossible — the two are mutually exclusive:

min session destroy --all debug
  -> error: the argument '--all' cannot be used with '[SESSION]'

Also wrong in the same error path

Bare min session destroy reports Usage: min session destroy <SESSION> — --all is
invisible in the error path despite satisfying the requirement, and [SESSION] is rendered as
required here while --help correctly shows it optional.

Fix

Model the choice as an ArgGroup with required = true, multiple = false so the usage line
renders <SESSION>|--all instead of demanding both.


QA sweep of the published min help tree against a live local-minvmd daemon (min 0.5.0-rc3.dev.31.gc1375225, HEAD c137522); every finding re-executed against main at df22d71 and read back to source. Ledger finding F6 (confirmed).

Activity

  1. github-actions commented on Jul 29, 2026

    @github-actions
    Contributor

    [inbox-route] The routing run for this issue failed before completing.

    Run: https://github.com/gominimal/inbox/actions/runs/30430272087

    A human needs to look at the run log. After fixing the cause, clear needs-human and retry with:

    gh workflow run inbox-route.yml -R gominimal/inbox -f issue_number=384
    
  2. added
    needs-humanAn agent handed off; a human must act, then clear this label. Set by defer and handoffs.
    on Jul 29, 2026
  3. added
    priority:should-haveShould be done. Applied by the inbox-route classifier or a human.
    and removed
    needs-humanAn agent handed off; a human must act, then clear this label. Set by defer and handoffs.
    on Jul 29, 2026
  4. gominimal-aw-bot commented on Jul 29, 2026

    @gominimal-aw-bot
    Contributor

    Routing triage — #1038

    Kind: bug · Route: patch · Target: gominimal/minimal · Confidence: 0.92

    min session destroy is a subcommand of the min CLI (Rust/clap). The bug is a clap argument-group definition gap: --force/-f requires --all individually, but --all and [SESSION] are mutually exclusive, so the error-path usage line demands an impossible combination.

    Evidence

    • Repo peek — gominimal/minimal: Code search returned a direct match in crates/minimal/src/lib.rs — DestroyArgs::force carries #[arg(long, short, requires = "all")] with no ArgGroup that expresses [SESSION] and --all as alternatives. This is exactly the structure that produces the bad usage line.
    • Similar issues: No prior tracking of this exact ArgGroup gap found in gominimal/minimal. Four sibling issues from the same QA sweep (same author, same commit anchor df22d711) are already open and routed to gominimal/minimal:
      • gominimal/minimal#1025 (min session policy silent false negative) — related
      • gominimal/minimal#1027 (min completions install silent no-op) — related
      • gominimal/minimal#1031 (bare min --no-input orphan session) — related
      • gominimal/minimal#1032 (min init config overwrite) — related
        None duplicate this issue; all confirm the routing target.
    • Distillery enrichment: Confirms PR feat(minimald): implement session destroy + RPC #462 (feat(minimald): implement session destroy + RPC, project minimal) as the origin of the destroy subcommand. Clap is the arg-parsing crate in scope (confirmed via dependency PR in the minimal project).
    • Precedent pass: Multiple routing-outcome entries authored by inbox-route-retro in project inbox confirm that CLI bugs in the min session surface are routed to gominimal/minimal as patch at confidence 0.82–0.92 (informed by routing-outcome inbox-route/I_kwDOSUhdos8AAAABIsUoEg, inbox-route/I_kwDOSUhdos8AAAABI_ODew, inbox-route/I_kwDOSUhdos8AAAABJGQymQ).
    • Manifest: gominimal/minimal is route: allow; default ref is main. Estimated fix touches 1 file (crates/minimal/src/lib.rs), within max_patch_files = 5.

    [inbox-route:decision]

    {"schema":"inbox-route/v1","issue":384,"issue_node_id":"I_kwDOSUhdos8AAAABKmghtQ","dry_run":false,"kind":"bug","route":"patch","confidence":0.92,"targets":[{"repo":"gominimal/minimal","reason":"session destroy ArgGroup definition lives in crates/minimal/src/lib.rs"}],"labels":["kind:bug","priority:should-have"],"patch":{"target_ref":"main","brief":"In crates/minimal/src/lib.rs, DestroyArgs::force uses requires = \"all\", which makes clap demand both --all and <SESSION> on the error path — an impossible combination since they are mutually exclusive. Evidence suggests the fix is to introduce an ArgGroup covering [SESSION] and --all as alternatives (required = true, multiple = false), and wire force to require that group rather than --all directly.","files":["crates/minimal/src/lib.rs"]},"work_issue":{"title":"bug: session destroy -f produces impossible usage line (clap ArgGroup missing)","body":"## Summary\n\n`min session destroy --force` / `-f` generates a usage suggestion that cannot be executed: the error path demands both `--all` and `<SESSION>`, but these two arguments are mutually exclusive.\n\n## Details\n\nIn `crates/minimal/src/lib.rs`, `DestroyArgs::force` is declared with `requires = \"all\"`, which causes clap to list `--all` as a required argument on the error path. However, `--all` and `[SESSION]` are already mutually exclusive, so the suggested invocation `min session destroy --all --force <SESSION>` is impossible to execute.\n\nA secondary symptom: bare `min session destroy` reports `Usage: min session destroy <SESSION>` — `--all` is absent from the error-path usage despite being a valid way to satisfy the requirement, and `[SESSION]` is shown as required even though `--help` correctly marks it optional.\n\nEvidence in source: `crates/minimal/src/lib.rs` — `DestroyArgs::force`, `#[arg(long, short, requires = \"all\")]`, with no ArgGroup making `session` and `--all` alternatives.\n\n## Suggested next step\n\nIntroduce a clap `ArgGroup` on `DestroyArgs` with `required = true, multiple = false` covering `session` and `all`, and update `force` to require the group rather than `--all` individually."},"related":[{"repo":"gominimal/minimal","number":1025,"relation":"related"},{"repo":"gominimal/minimal","number":1027,"relation":"related"},{"repo":"gominimal/minimal","number":1031,"relation":"related"},{"repo":"gominimal/minimal","number":1032,"relation":"related"}],"rationale":"Issue gominimal/minimal#1038 reports that `min session destroy -f` emits an impossible usage line requiring both --all and <SESSION>, which are mutually exclusive. Code search in gominimal/minimal confirmed the root: crates/minimal/src/lib.rs defines DestroyArgs::force with #[arg(long, short, requires = \"all\")] but no ArgGroup — so clap demands --all alongside <SESSION> on the error path. The QA sweep that filed this also filed four sibling issues already routed to gominimal/minimal (#1025, #1027, #1031, #1032), confirming the target. Precedent routing-outcome entries for similar CLI bugs in the min session surface all route to gominimal/minimal as patch. Fix is a one-file change to introduce an ArgGroup in DestroyArgs, within the max_patch_files limit."}

    Generated by inbox-route · ◷

  5. added
    kind:bugSomething is not working. Applied by the inbox-route classifier.
    on Jul 29, 2026
  6. gominimal-aw-bot commented on Jul 29, 2026

    @gominimal-aw-bot
    Contributor

    [inbox-route:ledger]
    Routed from gominimal/inbox#384 by inbox-route (https://github.com/gominimal/inbox/actions/runs/30466306483)
    Routing-Key: inbox-route/I_kwDOSUhdos8AAAABKmghtQ
    Route: patch
    Patch-Dispatched: https://github.com/gominimal/inbox/actions/runs/30466306483

  7. transferred this issue fromon Jul 29, 2026
  8. added a commit that references this issue on Jul 29, 2026
    f2daff3
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

    kind:bugSomething is not working. Applied by the inbox-route classifier.priority:should-haveShould be done. Applied by the inbox-route classifier or a human.routed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0