Repository navigation
feat: configure model providers from the Control UI settings page - #106490
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d962c42d9f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const provider = resolveProvider(choice.providerId); | ||
| capabilities.set( | ||
| provider, | ||
| capabilities.get(provider) === true || choice.methodId === "api-key", |
There was a problem hiding this comment.
Recognize non-literal API-key auth methods
For configured providers whose API-key auth choice uses a provider-specific method id, this reports apiKeySupported: false even though the plugin registers an API-key auth method. For example, extensions/stepfun/index.ts creates API-key methods with ids like standard-api-key-intl / plan-api-key-intl; after a user configures StepFun through onboarding, the Control UI receives apiKeySupported: false and hides the Replace API key action for that card, leaving only Remove. The capability check should use the provider auth contract/secret choice semantics rather than only the exact string "api-key".
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76a14cd37a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const hasRefreshableProfile = prov.profiles.some( | ||
| (profile) => profile.type === "oauth" || profile.type === "token", | ||
| ); |
There was a problem hiding this comment.
Ignore excluded profiles when showing API-key status
When a provider has a configured API key but also has a saved OAuth/token profile that is explicitly excluded with auth.order[provider] = [], buildAuthHealthSummary sets effectiveProfiles to an empty list and the rollup becomes missing; this check still looks at all saved prov.profiles, so the new static-API-key override is skipped and the Control UI reports a working API-key provider as missing. The refreshable-profile test should use the effective profiles that actually participate in the rollup, not excluded saved credentials.
Useful? React with 👍 / 👎.
7cf20b0 to
e6395ea
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c8ed55c18
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| prompt: PROBE_PROMPT, | ||
| provider: target.model.provider, | ||
| model: target.model.model, | ||
| authProfileId: target.profileId, | ||
| authProfileIdSource: target.profileId ? "user" : undefined, | ||
| authProfileId: isolatedProfileId ?? target.profileId, |
There was a problem hiding this comment.
Keep probes from mutating saved auth profiles
When Test connection probes a saved OAuth/token profile, isolatedProfileId is undefined, so this passes the real target.profileId and real agentDir into runEmbeddedAgent. The embedded runner records auth success/failure into the auth profile store by default, so a diagnostic probe that times out or hits a rate limit can change last-good/cooldown state and affect subsequent normal model routing. Run probes with read-only or isolated auth state instead.
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. Reviewed July 13, 2026, 2:02 PM ET / 18:02 UTC. Summary Reproducibility: not applicable. This PR implements a new Control UI capability rather than repairing a reproducible failure of an established behavior contract. Review metrics: 3 noteworthy metrics.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land a rebased, conflict-free version only after redacted real-setup proof demonstrates API-key set/replace/remove, credential provenance, alias-specific connection probing, targeted logout without unrelated auth-state changes, and persisted default-model selection. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR implements a new Control UI capability rather than repairing a reproducible failure of an established behavior contract. Is this the best way to solve the issue? Yes architecturally: reusing config.patch, existing provider auth contracts, and the CLI probe engine is preferable to introducing parallel persistence or provider policy in the UI; merge readiness still requires live proof and conflict resolution. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 301a4bf62738. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (2 earlier review cycles)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4224603914
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| class="btn btn--sm" | ||
| ?disabled=${probeBusy || !props.canMutate || !props.probeAvailable} | ||
| title=${!props.probeAvailable ? t("modelProviders.probe.unavailable") : blocked} | ||
| @click=${() => props.onProbe(card.id, credentialProviders)} |
There was a problem hiding this comment.
Probe canonical model providers, not credential aliases
When a card is merged from a credential/runtime alias such as claude-cli into the Anthropic card, credentialProviderIds contains claude-cli even though the model catalog hides CLI-runtime providers. This click sends models.probe with provider: "claude-cli"; the probe planner only selects candidates/catalog models under that provider, so a normal Anthropic default/catalog setup returns no_model and the UI reports a failed connection test for a working Claude CLI/Anthropic credential. Send the card's canonical model provider (or translate aliases in models.probe) while keeping credential IDs for logout.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1db1a21c56
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Probe under the canonical auth provider so credentials stored/aliased | ||
| // there resolve, matching models.list/models.authStatus. The response | ||
| // echoes the requested id; the UI correlates by that. | ||
| const authProvider = resolveProviderIdForAuth(provider, { config: cfg }); |
There was a problem hiding this comment.
Keep probe target provider separate from auth alias
When the requested provider is a model-provider alias with its own endpoint but shared credentials, this rewrites the entire probe to the auth provider. For example, extensions/byteplus/openclaw.plugin.json:17 maps byteplus-plan auth to byteplus, while byteplus-plan has a separate catalog/base URL at extensions/byteplus/openclaw.plugin.json:68; models.probe for byteplus-plan now runs runAuthProbes against byteplus, so the Control UI can report a successful connection to the standard BytePlus endpoint while the coding-plan endpoint/config is broken. Keep the model provider for target/model selection and only canonicalize the credential lookup.
Useful? React with 👍 / 👎.
…alog refresh races; scanner-safe probe fixtures
…l for config-only providers [AI]
…bound profiles past auth.order [AI]
…eral probe DB [AI]
…I-key provenance [AI]
5878330 to
88330d4
Compare
…enclaw#106490) * feat(gateway): add models.probe RPC, credential provenance, targeted auth logout * feat(ui): configure model providers from settings — keys, probes, logout, defaults * docs: Control UI provider configuration section * fix(ui): confirm fallback shrinkage via replacePaths; guard model catalog refresh races; scanner-safe probe fixtures * test(models): scanner-safe probe fixture identifier * chore(i18n): resync model-providers strings after rebase * fix(gateway-protocol): drop duplicate probe type imports after rebase * chore(protocol): regenerate Swift client for probe field order * chore(i18n): resync model-providers strings after main rebase * test(ui): scope model-providers E2E to settings-section headings * fix(models): isolate marker probes from stored profiles; emit no_model for config-only providers [AI] * fix(models): honor configured auth mode for env probes; probe config-bound profiles past auth.order [AI] * fix(gateway): resolve provider auth aliases in models.probe [AI] * fix(gateway): scope targeted auth logout to skip provider-wide run abort [AI] * fix(models): probe requested provider for overrides; unregister ephemeral probe DB [AI] * fix(gateway): exclude local no-auth markers from models.authStatus API-key provenance [AI] * chore(i18n): resync model-providers strings for landing
What Problem This Solves
Model providers could not be configured from the Control UI. The Settings → Model Providers page was a read-only dashboard: no way to store an API key, no way to see whether a credential comes from config or an environment variable, no way to test whether a provider actually works, and no way to change default models without editing
openclaw.jsonor rerunning CLI onboarding. This is the Dashboard half of #81961.Why This Change Was Made
Managing several providers (primary + fallback + cheap/utility models across cloud and local providers) is a normal setup, and the gateway already had all the underlying machinery:
config.patchmerge-patches formodels.providers.<id>.apiKey, the CLI live-probe engine (openclaw models status --probe), andmodels.authLogout. This PR surfaces that machinery in the settings page instead of inventing new persistence:models.probegateway RPC (operator.admin, additive protocol change, no version bump) reusing the CLI auth-probe engine. Direct config/env keys are probed through a synthetic profile in an isolated temp agent dir that is disposed afterwards, so plaintext never touches the real auth-profile store and errors are redacted + mapped to fixed status buckets.models.authStatusnow reports API-key provenance per provider (apiKey: { source: "config" | "env", envVar? }, never the value) and per-profilelogoutSupported;models.authLogoutaccepts optionalprofileIdsfor targeted logout that preserves API keys and unrelated profiles.models.listgains an opt-inincludeProviderCapabilitiesflag exposingapiKeySupportedper entry (from provider plugin auth contracts) so the UI only offers key entry where a key can work.nulldelete, secret never rendered back), Test connection with per-credential status + latency, and confirm-gated logout. New Add-provider flow for known-but-unconfigured catalog providers. New Default models card managingagents.defaults.model(primary + ordered fallbacks) andagents.defaults.utilityModel(Automatic vs explicit vs Disabled — empty string is the existing disable contract). Everything gated on operator.admin and degraded gracefully on older gateways (method-not-found hides probing).No new config keys or env vars; the only persisted surfaces are the existing
models.providers.<id>.apiKey,agents.defaults.model, andagents.defaults.utilityModel.User Impact
From Settings → Model Providers you can now: store/replace/remove provider API keys, see exactly which credential each provider uses (OAuth/token profiles, config key, or env var by name), live-test a provider connection and get a categorized result (auth / rate-limit / billing / timeout / format) with latency, log out OAuth/token profiles without nuking API keys, add a new provider by picking it from the catalog and pasting a key, and set the default/fallback/utility models. Docs:
docs/concepts/model-providers.mdgains a Control UI section.Evidence
models.list,models.authStatus, newmodels.probe, model-providers data/mutations/view — 351 tests passed; Control UI Playwright E2E (ui/src/e2e/model-providers.e2e.test.ts) 2 passed;tsgocore/ui/test lanes green;pnpm protocol:checkgreen after regenerating Swift/Kotlin clients.en.tskeys synced across all 20 locales withfallbacks=0.Closes #81961