Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

CLI: --kinds silently drops invalid values and falls through to defaults

Open Beginner friendly
#6,945 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@olympusbuildz is already working on this.

Since Aug 28, 2026.

  • #6992 by @olympusbuildz — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
cli

Research direction

Start in crates/buzz-cli/src/commands/messages.rs at cmd_get_messages, around lines 372-377, and run the --kinds reproduction commands from the issue. Done means malformed values produce a usage error naming the invalid value, including when every value is invalid, while valid comma-separated kinds are passed through without falling back to defaults.

Written by the indexing model from the issue text.

Description

bug

markdown
buzz messages get --kinds "abc,9" silently drops invalid kind values and returns results only for the valid ones. A user who types --kinds "9,abc" (typo, or unfamiliar kind string) gets kind-9 results with no warning that "abc" was ignored. The same applies when ALL values are invalid — the empty parsed list falls through and the default kinds are used instead, which is the opposite of what the user asked for.

Steps to reproduce

1. Run buzz messages get --channel <uuid> --kinds "abc,9" --format json
2. Observe: results are returned (only kind 9), no error or warning about "abc"
3. Run buzz messages get --channel <uuid> --kinds "abc" --format json
4. Observe: returns ALL default kinds (9, 40002, 40008, 45001, 45003) because the parsed list is empty and the if !kind_list.is_empty() guard falls through, leaving the original default kinds in place

Expected behavior

- If any value in --kinds fails to parse as a number, the command should return an error (exit code 1) naming the invalid value: invalid kind value in --kinds: "abc".
- Alternatively, a warning on stderr for each dropped value, though an error is safer — silent data loss from malformed input violates the CLI's agent-first contract where agents cannot inspect stderr interactively.

Actual behavior

Invalid kind values are silently dropped by filter_map(|s| s.trim().parse().ok()). If ALL values are invalid, the empty list falls through and the default kinds are used instead — the user asked for specific kinds and got the default instead, with no indication.

Version and platform

- Buzz CLI: current main as of 2026-08-27
- OS: any

Logs / additional context

The relevant code is in crates/buzz-cli/src/commands/messages.rs, cmd_get_messages, lines 372-377:

rust
if let Some(k) = kinds {
    let kind_list: Vec<u64> = k.split(',').filter_map(|s| s.trim().parse().ok()).collect();
    if !kind_list.is_empty() {
        filter["kinds"] = serde_json::json!(kind_list);
    }
}


The filter_map(... .ok()) silently discards parse failures. The if !kind_list.is_empty() guard means an entirely-invalid --kinds value reverts to the default kind set — the user asked for specific kinds and got the default instead, with no indication.

Suggested fix

Replace filter_map with a fallible parse that returns CliError::Usage on the first invalid value:

rust
if let Some(k) = kinds {
    let kind_list: Vec<u64> = k.split(',')
        .map(|s| s.trim().parse::<u64>()
            .map_err(|_| CliError::Usage(format!("invalid kind value in --kinds: {:?}", s.trim()))))
        .collect::<Result<, >>()?;
    filter["kinds"] = serde_json::json!(kind_list);
}
Dominant language
Rust
Stars
35.3k
Forks
4.7k
Avg merge
2d 23h
Merged PRs (30d)
176

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from block/buzz

All issues in block/buzz

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.