Repository navigation
fix: malformed -ks/-kb/-kf/-kg arguments caused tracebacks - #16
Merged
Merged
Conversation
- split `KEY=VALUE` on the first "=" only, so values (e.g. model file paths) may contain "=" - raise `click.BadParameter` for arguments without "=" or key, unknown keys, and values that cannot be converted to the annotated type - accept "None" for keyword arguments that allow `None` (e.g. the default `size_thresh_mask=None` listed in the help) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16 +/- ##
==========================================
+ Coverage 74.73% 76.00% +1.26%
==========================================
Files 19 19
Lines 1330 1350 +20
==========================================
+ Hits 994 1026 +32
+ Misses 336 324 -12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
paulmueller
approved these changes
Nov 23, 2026
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.
Bug
The
-ks/-kb/-kf/-kgKEY=VALUEarguments were split witha.split("=")and converted without error handling, so mistakes ended in raw tracebacks:=(e.g. a model file path for-ks model_file=...) could not be passed.size_thresh_mask=Noneis listed as the default in--help, butNonewas not accepted.Fix
In
chipstream/cli/cli_valid.py:split_kwargssplits on the first=only and raisesclick.BadParameterfor arguments without=or without a key.convert_kwarg_valueconvertsNone/nonetoNoneif the annotation allowsNone, and turns conversion errors intoclick.BadParameter.click.BadParameterinstead ofValueError.str(as the existing comment says) instead of raisingKeyError.The CLI now prints a usage error and exits with 2:
-kg size_thresh_mask=Nonenow gives the same gate ID and pipeline hash as omitting it.Tests
test_cli_kwargs_invalid(11 cases across-ks/-kb/-kf/-kg): exit code 2 and the message.test_cli_kwargs_none:None,noneand10forsize_thresh_mask.test_cli_kwargs_split_first_equal_signandtest_cli_kwargs_value_with_equal_sign(torch only): values containing=.All new tests fail on
mainand pass with the fix.test_cli_torchmpoandtest_cli_torchmpo_wrong_modelstill pass. flake8 is clean; ruff shows no new errors.🤖 Generated with Claude Code