fix(#980 Bug 5): isConfigured false for empty cloud-provider keys#988
Merged
Conversation
SecretManager.has(key) returns true when the key NAME is present in config.env even if its VALUE is empty. Fresh ~/.continuum/config.env ships ANTHROPIC_API_KEY=, OPENAI_API_KEY=, DEEPSEEK_API_KEY= as empty placeholders, so every fresh install reported isConfigured=true for all three cloud providers — Carl tries chat → opaque 401. Check the actual value length: a missing-or-empty key counts as not configured, matching the user's mental model. The existing 'local' short-circuit (Candle) is preserved unchanged; that's a separate (mis-)categorization issue tracked as Bug 6. Pulling rawKey unconditionally for non-local providers also lets the maskedKey path keep using the same value rather than calling get() twice. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0c46869 to
bf30a91
Compare
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
`SecretManager.has(key)` returns true when the key NAME is present in config.env even if its VALUE is empty. Fresh `~/.continuum/config.env` ships `ANTHROPIC_API_KEY=`, `OPENAI_API_KEY=`, `DEEPSEEK_API_KEY=` as empty placeholders → every fresh install reports `isConfigured: true` for all three cloud providers → Carl tries chat → opaque 401.
Check actual value length instead. Empty/missing key = not configured. Matches the user's mental model.
The existing `local` short-circuit (Candle) is preserved unchanged — that's a separate categorization issue tracked as #980 Bug 6.
Why not change SecretManager.has
`has` legitimately means "is this key NAME present in the namespace" — there are config keys where empty-string is a valid disable signal. Changing the call-site contract preserves that for other callers.
Test plan
Closes #980 Bug 5.
🤖 Generated with Claude Code