fix: empty token overrides provider default + hardcoded error message#19
Closed
fix: empty token overrides provider default + hardcoded error message#19
Conversation
Three fixes: - setup.ts: don't save token when empty (omit field so provider default kicks in via the ?? chain) - cli.ts: treat empty-string config values as undefined so they don't block fallthrough to provider defaults - cli.ts: error messages now show actual provider name instead of hardcoding 'custom', and suggest `claudely setup` as a fix Also improves setup wizard UX: shows provider defaults in prompts when the saved value differs from the default.
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
Three bugs fixed:
Empty token in config blocks provider default —
claudely setupsavedtoken: ""which??treated as defined, preventing fallthrough to the provider's default token (e.g."lmstudio"). Now empty strings are skipped when saving, and cli.ts treats empty config values as undefined.Error message hardcodes 'custom' —
"provider 'custom' requires --token"fired for ALL providers when token was empty. Now shows the actual provider name and suggestsclaudely setup.Setup wizard doesn't show provider defaults — When the saved value differs from the provider default, the prompt now shows both (e.g.
Auth token (provider default: lmstudio)).Test plan
npm test— 87 passclaudely setupwith lmstudio, clear token → saves without token fieldclaudely --newafter saving empty token → uses provider default, no errorclaudely setupre-run shows provider defaults in prompts