fix(providers): model list empty in settings panel (#581)#591
Merged
su8su merged 4 commits intoValueCell-ai:mainfrom Mar 21, 2026
Merged
fix(providers): model list empty in settings panel (#581)#591su8su merged 4 commits intoValueCell-ai:mainfrom
su8su merged 4 commits intoValueCell-ai:mainfrom
Conversation
…els.providers (ValueCell-ai#581) The stale-account cleanup in listAccounts() deleted ALL provider accounts (including builtin ones like Anthropic) whenever openclaw.json had an empty models.providers section. This happened because: 1. Builtin providers (e.g. anthropic) don't register in models.providers — the OpenClaw runtime recognises them natively 2. getActiveOpenClawProviders() only reads models.providers keys, so it returned an empty set for users with only builtin providers 3. The configMissing flag (activeProviders.size === 0) caused ALL accounts to be deleted, bypassing the isBuiltin safety check The fix removes the configMissing override so builtin provider accounts are always retained regardless of whether models.providers is populated. Only non-builtin, non-active accounts are cleaned up. Closes ValueCell-ai#581
…s when config is empty When getActiveOpenClawProviders() returns an empty Set (e.g. during gateway restart, file lock, or before initial config sync), the stale-account cleanup in listAccounts() would mark every non-builtin account for deletion — causing configured models to disappear from the settings panel. Fix: skip cleanup entirely when activeProviders is empty and log a warning, preserving all existing accounts during transient states. Also skip builtin providers earlier in the loop for clarity. Closes ValueCell-ai#581
…ty (ValueCell-ai#581) When users configure providers externally (via CLI or editing openclaw.json directly), the ClawX settings panel shows an empty provider list because it reads from its own store which was never populated. Add a one-time seed operation in ProviderService.listAccounts(): when the ClawX store is empty but getActiveOpenClawProviders() returns active providers, read models.providers from openclaw.json and create corresponding ProviderAccount entries. Subsequent calls use the store directly. Also add getOpenClawProvidersConfig() helper to openclaw-auth.ts to read models.providers and agents.defaults.model without exposing the private readOpenClawJson function. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When no ProviderAccounts exist, listAccounts() now calls getActiveOpenClawProviders() to decide whether to seed from openclaw.json. Updated test assertion accordingly.
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.
Problem
Settings panel model dropdown shows empty list even though providers are properly configured in openclaw.json and the gateway works fine for chat. Closes #581.
Root Cause
Two issues in
ProviderService.listAccounts():Destructive cleanup on empty config: When
getActiveOpenClawProviders()returned an empty Set (transient condition during gateway restart, config file lock, first launch before config sync), the code deleted all provider accounts from the electron-store, including builtin ones. Next time the settings panel loaded — empty list.No seeding from OpenClaw config: Users who configured providers via CLI or
openclaw.jsondirectly (not through ClawX UI) had no correspondingProviderAccountentries in the electron-store. The settings panel only reads from the store, so it showed nothing.Fix
Defensive cleanup (commits 1-2)
activeProviders.size === 0, skip cleanup entirely and return existing accounts as-is (withlogger.warn()for diagnostics)if (isBuiltin) continue) earlier in the loop — builtin accounts should never be candidates for deletionConfig seeding (commit 3)
openclaw.jsonhas configured providers, seedProviderAccountentries from the configgetOpenClawProvidersConfig()reads the raw provider configseedAccountsFromOpenClawConfig()creates account entries with correct vendor IDs, base URLs, and inferred model namesTests
5 unit tests covering:
All 254 existing tests pass.