fix: prevent _ensure_hf_token from swallowing click.Abort#937
Open
alfredoclarifai wants to merge 1 commit intomasterfrom
Open
fix: prevent _ensure_hf_token from swallowing click.Abort#937alfredoclarifai wants to merge 1 commit intomasterfrom
alfredoclarifai wants to merge 1 commit intomasterfrom
Conversation
The broad `except Exception` handler was catching `click.Abort`, turning an intentional abort into a misleading warning with an empty message and allowing execution to continue. Closes #936 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Minimum allowed line rate is |
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.
Quick Fix Summary
_ensure_hf_tokenswallowingclick.Abortdue to a broadexcept Exceptionhandler, which was producing a misleading empty warning (Unexpected error ensuring HF_TOKEN:) and allowing execution to continue past an intentional abortRoot Cause
When
config.yamlis missing,_ensure_hf_tokencorrectly raisesclick.Abort(). But the outerexcept Exceptioncatches it, downgrades it to a cryptic warning, and lets execution fall through toModelBuilder._validate_folderwhich then crashes with a noisyAssertionErrortraceback.Fix
Add
except click.Abort: raisebefore the generalexcept Exceptionso the abort propagates as intended.Closes #936
Test plan
tests/cli/test_local_runner_cli.py— all 7 tests pass🤖 Generated with Claude Code