Repository navigation
fix(accounts): flag malformed API keys before connect - #25978
Conversation
|
Bead |
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
red: cmux-next checks (god files, concurrency, crash safety, l10n); base red: the same failure on the base 400cb08; does not block |
|
Found 6 test failures on Blacksmith runners: Failures
|
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
Review (codex gpt-6-astra xhigh, next-review): BLOCK at db82aef
|
|
Orphaned: no activity for 12 h, and no lane holds a lease on it. Adopted by the orphan sweep: merged |
|
Review (codex gpt-6-astra high, review-router): BLOCK at ecace50 VERDICT: BLOCK
Agent session: agent session |
… rule Detection now checks only the environment key Connect would read (the first set in apiKeyEnvironmentKeys order), so a malformed GOOGLE_API_KEY no longer marks Gemini unknown beside a valid GEMINI_API_KEY. Detection and the resolver share one format rule, so an Anthropic key without the sk-ant- prefix (or an OAuth token in ANTHROPIC_API_KEY) reads unknown instead of signed in and then failing Connect with invalidFormat. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-ab1f035a409b977caceb
|
Owned by an agent session · took over from an earlier session · session |
Swift Testing decomposes tuple arguments only for pairs, so the four-field tuple cases could not compile. Each case is now a KeyCase value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-ab1f035a409b977caceb
Detection trusts a key saved in cmux's Keychain by its presence (it never reads the secret), so a malformed saved key read signed in and then failed Connect with invalidFormat. Save now checks the key with Connect's own rule (CredentialResolver.isWellFormedKey) and shows the invalid-format error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-ab1f035a409b977caceb
|
Review (codex gpt-6-astra high, review-router): SHIP at ba02d0a No findings. Earlier blockers fixed: only the key Connect sends is judged (a malformed GOOGLE_API_KEY no longer hides a valid GEMINI_API_KEY); detection and Connect share one format rule (an Anthropic key without sk-ant- reads unknown); Save refuses a malformed key. ProviderDetectionSourcesTests and AccountsActionOutcomeTests pass on a fleet Mac at this head. VERDICT: SHIP Agent session: agent session |
|
Shipped in:
|
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Problem
API-key detection treated any non-empty environment value as ready. A truncated, whitespace, or control-character value survived onboarding until the first Connect or prompt failed.
Change
Validate environment key shape during provider detection and report malformed values as
unknown, so Accounts can direct the person to replace the key before starting a chat. The resolver remains authoritative and still rejects invalid secrets.Validation
Added provider detection regression coverage for empty, short, and newline-containing values. Swift tests/build run through the project’s macOS CI path.
Before/after: Accounts now shows
Unknownfor malformed environment credentials instead ofSigned in/Key found.No capture: this changes credential checks only (Settings > Accounts status and Save validation), with no layout or style change.
No capture: the change only picks which existing Accounts status label shows for a malformed environment API key (
Unknowninstead ofSigned in/Key found); it draws no new UI, and the capture scenes run with no provider keys in the environment, so that state cannot be shown there.ProviderDetectionSourcesTestsandAccountsActionOutcomeTestscover it.