Repository navigation
fix(app): clear a provider's disabled mark when configure reconnects it - #325
Merged
Merged
Conversation
"Disconnect provider" in Settings writes the provider id into the global config's disabled_providers, and that flag outranks everything the configure flows write: the provider registry skips a disabled provider entirely, so after a disconnect every SSO sign-in "succeeded" (auth entry written, provider block rewritten, success toast shown) while no provider ever connected — and the setup gate reopened its dialog right over the toast, forever, surviving restarts. codevhub config appeared to fix it only because the hub rewrites codev.json wholesale, dropping the flag. The app's custom-provider dialog already filtered its id back out of disabled_providers on save; the desktop SSO dialog, the TUI gateway flow, and the TUI custom-provider flow now do the same — each clears only its own provider id, so other deliberately disconnected providers stay disconnected. Reproduced against a live server: disconnect then the exact configure sequence (auth.set, config update, dispose) leaves connected empty until disabled_providers is cleared. The new TUI view test drives the custom-provider flow against a config with disabled_providers seeded and fails without the fix. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Issue for this PR
Closes #
Type of change
What does this PR do?
Fixes the reported loop where a user signs in, sees the "CoDev configured — Using …" toast, and the Set up CoDev dialog immediately comes back — every time, surviving restarts, until
codevhub config"fixes" it.Root cause. "Disconnect provider" in Settings → Providers writes the provider id into the global config's
disabled_providers(settings-v2/providers.tsx). A disabled provider is skipped everywhere in the server's provider registry build, so it can never appear inconnected— and the configure gate opens exactly when nothing is connected. The SSO configure flow rewrote the auth entry and the provider block on every sign-in but never cleared the flag, so each attempt genuinely succeeded (hence the toast) while changing nothing the gate could see. The dialog reopened over its own success toast, forever.Why the hinted PRs (#285 here, codev-hub#257) are adjacent but not the cause: they moved the key out of
codev.json, which is what put users in front of dead keys and the Disconnect button in the first place — but the loop itself is the staledisabled_providersentry. And whycodevhub configfixed it: the hub rewritescodev.jsoncwholesale (preserving onlymcp), which dropsdisabled_providersas a side effect.Reproduced against a live server (fork server, scratch HOME, the exact three calls the renderer makes):
Fix. The app's custom-provider dialog already filtered its id back out of
disabled_providerson save (dialog-custom-provider.tsx) — the three flows that missed the same guard now do it too:packages/app/src/components/gateway/dialog-configure.tsx— desktop SSO / manual-key flowpackages/tui/src/component/dialog-configure.tsx— TUI gateway flow (alsocodev configure)packages/tui/src/component/dialog-custom-provider.tsx— TUI custom-provider flowEach clears only its own provider id, so other providers the user disconnected on purpose stay disconnected. Both config-file branches (
.jsonmergeDeep,.jsoncpatch) replace arrays, verified live.enabled_providers(admin allowlist) is deliberately left alone. All three touched source files are fork-only, so noDIVERGENCES.mdrows change;CHANGELOG.mdgets an entry.How did you verify your code works?
disabled_providers: ["mockgw", "othergw"]and asserts the PATCH carries["othergw"]— verified it fails without the fix (5 pass / 1 fail) and passes with it.bun typecheckclean inpackages/appandpackages/tui; app suite 708 pass, TUI configure-gate + custom-provider suites green. One unrelated flake in the full TUI run (configure-gate.view.test.tsxframe-wait timeout under parallel load) passes in isolation both with and without this change.Screenshots / recordings
N/A — behavior fix; the visible change is the setup dialog staying closed after sign-in.
Checklist
🤖 Generated with Claude Code