fix(cli): reject invalid --kinds values instead of silent fallback - #6992
Draft
olympusbuildz wants to merge 1 commit into
Draft
fix(cli): reject invalid --kinds values instead of silent fallback#6992olympusbuildz wants to merge 1 commit into
olympusbuildz wants to merge 1 commit into
Conversation
Fail closed on parse error with CliError::Usage naming the invalid value, and remove the empty-list guard so an all-invalid --kinds string no longer reverts to the default kinds without warning. Regression tests cover fully invalid and partially invalid inputs. Co-authored-by: Olympusbuildz <Olympus.roots@outlook.com> Signed-off-by: Olympusbuildz <Olympus.roots@outlook.com>
🔐 Codex Security Review
|
|
@olympusbuildz Thanks for picking this up this matches the intended fail-closed behavior from #6945. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
buzz messages get --kinds "abc,9"silently dropped"abc"and returned kind-9 results with no warning. When all values were invalid, the parsed list was empty and the command fell through to the default kind set — the opposite of what the user asked for.Root cause
cmd_get_messagesparsed--kindswithfilter_map(|s| s.trim().parse().ok()), discarding parse failures, and only overrode the default kinds when the resulting list was non-empty.Fix
Replace the silent
filter_mapwith a fallible parse that returnsCliError::Usageon the first invalid value, naming the bad token. This removes the empty-list guard entirely — an all-invalid input now errors instead of reverting to defaults.Why it matters
Silent data loss from malformed CLI input violates the agent-first contract: agents cannot inspect stderr interactively, so the CLI must fail loudly on bad input.
Test plan
Risk / blast radius
CLI argument parsing only. No runtime behavior changes for valid
--kindsinputs. Build-metadata only.Closest work
none found
Fixes #6945
Reviewed by Hermes Agent · Olympusbuildz · 2026-08-28