fix(dashboard/providers): keep Save actionable after a passing Test (#6144)#6146
Merged
Conversation
…6144) Adding a provider (e.g. "claude") and clicking Test left the Save button greyed out, so the provider looked like it could not be added even though the test passed. The configure drawer's `testKey` already persists the entered key via `set_provider_key` and then clears `keyInput` so the password field falls back to its "existing key" placeholder. That clearing made `isUnchanged` true (empty key, unchanged base/proxy URL), which fed straight into `saveDisabled`. The credential was in fact already saved by the Test, but the disabled Save button read as "this provider can't be added". Keep Save enabled when the form is otherwise unchanged but a Test has just passed (`testResult.ok`), giving the user a clear confirm-and-close affordance. Clicking it runs the no-op save path and dismisses the drawer with the usual success toast. Verification: - Added a regression test in ProvidersPage.test.tsx that adds an unconfigured provider, enters a key, clicks Test, and asserts Save stays enabled. Confirmed it fails on the pre-fix condition and passes after. - pnpm test --run (786 passed), pnpm typecheck (clean), pnpm lint (0 errors), pnpm build (ok).
houko
enabled auto-merge (squash)
June 17, 2026 06:07
…mid-sentence prose wraps
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
Fixes #6144. Adding an LLM provider (the reporter used "claude") and clicking Test left the Save button greyed out, so the provider appeared impossible to add even though the connection test passed.
Root cause
The configure drawer's
testKey(inuseProviderConfig) does two things on a Test click:set_provider_key(the backend test endpoint validates the stored credential, so it has to be saved first), then setskeyInput: ""so the password field shows its "existing key" placeholder.testResult.Step 1's clearing of
keyInputmakesisUnchangedevaluate to true (empty key input, unchanged base/proxy URL), andisUnchangedfed directly intosaveDisabled. So after a passing Test the Save button greyed out — even though the credential was already persisted by the Test itself. To the user that reads as "this provider can't be added".Fix
Keep Save enabled when the form is otherwise unchanged but a Test has just passed (
testResult.ok). The credential is already saved at that point, so clicking Save runs the no-op save path and dismisses the drawer with the usual success toast — a clear confirm-and-close affordance instead of a dead-looking button.Verification
ProvidersPage.test.tsx: open the Add picker, pick an unconfigured provider, enter a key, click Test, and assert Save stays enabled. Confirmed it fails on the pre-fixsaveDisabledcondition and passes after the fix.pnpm test --run— 786 passed (80 files)pnpm typecheck— cleanpnpm lint— 0 errors (pre-existing baseline warnings only, none in the touched files)pnpm build— ok