Skip to content

fix(ui): surface SSO and SMTP settings supplied as process env vars - #33576

Merged
yassin-berriai merged 1 commit into
litellm_internal_stagingfrom
litellm_lit4165_env_settings_ui
Jul 22, 2026
Merged

yassin-berriai merged 1 commit into
litellm_internal_stagingfrom
litellm_lit4165_env_settings_ui

Conversation

@tin-berri

@tin-berri tin-berri commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Relevant issues

Linear ticket

Resolves LIT-4165

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

A gateway configured the way an IaC shop configures one, every SSO and SMTP setting supplied as a process env var with nothing written through the UI, captured at 4d532cab05

export GENERIC_CLIENT_ID=lit4165-client-id
export GENERIC_CLIENT_SECRET=lit4165-super-secret-value
export GENERIC_AUTHORIZATION_ENDPOINT=https://idp.example.com/oauth2/v1/authorize
export GENERIC_TOKEN_ENDPOINT=https://idp.example.com/oauth2/v1/token
export GENERIC_USERINFO_ENDPOINT=https://idp.example.com/oauth2/v1/userinfo
export GENERIC_SCOPE="openid email profile groups"
export PROXY_BASE_URL=https://gateway.example.com
export SMTP_HOST=smtp.example-mail.com SMTP_PORT=587 SMTP_TLS=True
export SMTP_USERNAME=lit4165-smtp-user SMTP_PASSWORD=lit4165-smtp-password
export SMTP_SENDER_EMAIL=alerts@example.com

python litellm/proxy/proxy_cli.py --config litellm/proxy/dev_config.yaml --port 4166 --detailed_debug --use_v2_migration_resolver

Read-back resolves from env, with per-field provenance and masked secrets

$ curl -s -H "Authorization: Bearer sk-1234" http://localhost:4166/get/sso_settings
  generic_client_id                = lit4165-client-id                             [env]
  generic_client_secret            = lit4******************alue                    [env]
  generic_authorization_endpoint   = https://idp.example.com/oauth2/v1/authorize   [env]
  generic_token_endpoint           = https://idp.example.com/oauth2/v1/token       [env]
  generic_userinfo_endpoint        = https://idp.example.com/oauth2/v1/userinfo    [env]
  generic_scope                    = openid email profile groups                   [env]
  proxy_base_url                   = https://gateway.example.com                   [env]
  google_client_id (unset)         = None                                          [unset]

$ curl -s -H "Authorization: Bearer sk-1234" http://localhost:4166/get/config/callbacks   # email block
  SMTP_HOST              = 'smtp.example-mail.com'
  SMTP_PORT              = '587'
  SMTP_TLS               = 'True'
  SMTP_USERNAME          = 'lit4165-smtp-user'
  SMTP_PASSWORD          = 'lit4*************word'
  SMTP_SENDER_EMAIL      = 'alerts@example.com'

The bracketed tag is the new per-field provenance the resolver returns. Before this change these endpoints read only the stored row, so every value above came back null and the SSO page rendered its empty-state placeholder while SSO logins were succeeding

The features are genuinely live (same proxy, same moment)

$ curl -s -H "Authorization: Bearer sk-1234" http://localhost:4166/sso/readiness
{"status":"healthy","sso_configured":true,"provider":"generic", ...}

$ curl -s -o /dev/null -w "%{http_code} %{redirect_url}\n" http://localhost:4166/sso/key/generate
303 https://idp.example.com/oauth2/v1/authorize?response_type=code&client_id=lit4165-client-id&...&scope=openid+email+profile+groups&...

A stored value overrides env (provenance flips to db), other fields still resolve from env

$ curl -s -X POST -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" \
    -d '{"environment_variables": {"SMTP_HOST": "smtp.db-wins.example.com"}}' http://localhost:4166/config/update

$ curl -s -H "Authorization: Bearer sk-1234" http://localhost:4166/get/config/callbacks   # email block
  SMTP_HOST            = 'smtp.db-wins.example.com'
  SMTP_PORT            = '587'
  SMTP_USERNAME        = 'lit4165-smtp-user'
  SMTP_SENDER_EMAIL    = 'alerts@example.com'

$ curl -s -X PATCH -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" \
    -d '{"generic_client_id":"DB-GENERIC-ID", ...}' http://localhost:4166/update/sso_settings
$ curl -s -H "Authorization: Bearer sk-1234" http://localhost:4166/get/sso_settings   # generic_client_id
  generic_client_id = 'DB-GENERIC-ID' [db]

UI verification for a reviewer

Start the proxy with the environment above, run npm run dev in ui/litellm-dashboard, then

  1. Open http://localhost:3000/ui/?page=admin-panel and confirm SSO Configuration renders the provider table (not the "no SSO configured" placeholder), Client Secret dot-masked, Scopes showing openid email profile groups
  2. Open the Email Alerts tab under Settings and confirm the SMTP fields are populated with SMTP_PASSWORD masked, and click Test Email Alerts to confirm it still triggers
  3. Edit only TEST_EMAIL_ADDRESS, Save, and confirm via /get/config/callbacks that SMTP_PASSWORD was not overwritten with its mask

Type

🐛 Bug Fix

Changes

The SSO and Email Server settings pages read only stored config, while the features resolve from os.environ, so a gateway configured entirely through env vars showed blank settings pages despite SSO logins succeeding and mail sending. Rather than add per-endpoint env fallback, this resolves each setting through one typed config object

litellm/proxy/config_resolvers/ holds the resolver: a FieldDescriptor names, for one setting, where it lives in the stored row (db_key), which env var carries it (env_var), whether it is a secret, and its effective default; a pure resolve_fields reconciles a descriptor table against the stored row and the process environment with a fixed precedence (a set stored value wins, else a non-blank env var, else the default, else unset) and returns per-field provenance. The SSO descriptor table single-sources the field-to-env mapping the read and write paths previously duplicated, so they can no longer drift. Precedence is db then env because for these two domains yaml is not a separate typed source; a yaml environment_variables: block only populates env

get_sso_settings and the /get/config/callbacks alerting block read through the resolver instead of their own inline fallbacks. get_sso_settings no longer decrypts stored values into os.environ; decryption happens once inside the resolver via the pure helper, so a GET stops mutating the process environment, which previously masked any consumer that stopped reading it. The SSO response carries provenance so the UI can tell an env-sourced value from a stored one, and secrets are masked at the endpoint while the resolver returns them unmasked so the login path could consume them. os.environ stays the runtime carrier and the SSO login and mail-send paths are unchanged; retiring the carrier is tracked separately in LIT-4498

A present-but-empty stored value is read differently per domain, which two tests pin: for SSO it is treated as absent and falls back to env (SSO's clear path also unsets the env var), and for the alerting blob an explicit empty is an admin clear that wins over a stale env var. generic_scope, SMTP_PORT and SMTP_TLS carry the same effective defaults their features apply, so the settings page shows the config that would actually be used rather than a blank

The settings pages also submit only fields an admin actually edited so a rendered mask or env-sourced value is never written back over a working secret, generic_scope is a real SSO form field, and the duplicate ssoProviderConfigs in the two SSO forms is consolidated. Omitting a field from /update/sso_settings clears it, which provider switching relies on; the deeper write-path concern that behaviour points at is tracked in LIT-4498


Note

Medium Risk
Touches SSO and SMTP configuration read paths and GET semantics (no longer mutating os.environ), but behavior is pinned with extensive tests and login/mail runtime paths are unchanged.

Overview
Fixes LIT-4165: admin read APIs for SSO and email alerting only looked at stored config, so Helm/IaC deployments with live settings in os.environ showed empty UI while login and mail still worked.

Adds litellm/proxy/config_resolvers/ with FieldDescriptor tables and resolve_fields (DB → env → default → unset, plus per-field provenance). SSO and alerting use different rules for empty stored values (empty_db_is_set: alerting treats "" as an explicit clear; SSO treats blanks as absent).

/get/sso_settings now uses resolve_sso_config instead of inline DB assembly and no longer decrypts into os.environ on GET. The response includes provenance; SSO field→env mapping is single-sourced via SSO_FIELD_ENV_VARS / SSO_SECRET_FIELDS for read and write. /get/config/callbacks email and Slack blocks use the alerting descriptors with env fallback and SMTP defaults (587, True).

Dashboard: generic_scope on SSO types/forms/display; email save submits only changed fields so masked/env values are not persisted; duplicate SSO form config consolidated into BaseSSOSettingsForm.

Reviewed by Cursor Bugbot for commit 0c8e7d9. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

Fixes LIT-4165 by introducing litellm/proxy/config_resolvers/ — a descriptor-driven resolver that surfaces SSO and SMTP settings from the process environment when no stored row exists, so IaC deployments (Helm/Terraform env-var-only) no longer see a blank Admin settings page despite SSO logins and mail delivery working correctly.

  • New config_resolvers module: FieldDescriptor + resolve_fields implement a pure, provenance-aware DB → env → default → unset precedence; SSO and alerting each choose whether a present-but-empty stored value is an explicit clear (empty_db_is_set=True for alerting) or falls through to env (default for SSO).
  • /get/sso_settings refactored: Uses resolve_sso_config instead of the legacy proxy_config._decrypt_and_set_db_env_variables, which correctly stopped decrypting DB values into os.environ on GET and now returns per-field provenance; generic_scope is a first-class field with a default of "openid email profile".
  • Email/Slack alerting block (/get/config/callbacks) now resolves through resolve_fields with env fallback, also adding SMTP_TLS which was missing from the old _email_vars list; the frontend email-save path was updated to skip unchanged fields so masked passwords and env-sourced values are never written back.

Confidence Score: 5/5

Safe to merge; the SSO login and mail-send runtime paths are unchanged, and the new resolver is a pure read layer with thorough regression tests covering all precedence branches.

The resolver module is pure and well-tested (env-only, stored-wins, blank-stored-falls-to-env, os.environ non-mutation are all pinned). The GET path no longer mutates os.environ, which is a strict improvement. The write path swap from a local env_var_mapping to SSO_FIELD_ENV_VARS is mechanical and verified by the existing update tests. The only remaining observation is a pre-existing duplication between SSOModals.tsx and BaseSSOSettingsForm.tsx that was not consolidated in this PR despite the description stating it was.

No files require special attention; the ssoProviderConfigs duplication across SSOModals.tsx and BaseSSOSettingsForm.tsx is a minor maintenance point rather than a functional concern.

Important Files Changed

Filename Overview
litellm/proxy/config_resolvers/_descriptors.py New module implementing FieldDescriptor and resolve_fields — clean, pure, well-typed; precedence logic (DB → env → default → unset) and the empty_db_is_set flag are correctly implemented
litellm/proxy/config_resolvers/sso.py SSO-domain resolver; decrypts once via decrypt_value_helper, does not write os.environ, derives SSO_SECRET_FIELDS and SSO_FIELD_ENV_VARS from descriptors so read and write paths share the same source
litellm/proxy/config_resolvers/alerting.py Alerting descriptor tables; SMTP_TLS (missing from the old _email_vars list) is now included; defaults for SMTP_PORT and SMTP_TLS match runtime send-email path behaviour as documented
litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py get_sso_settings refactored to use resolve_sso_config; removes legacy proxy_config._decrypt_and_set_db_env_variables call that mutated os.environ on GET; update_sso_settings switches from a local env_var_mapping to the shared SSO_FIELD_ENV_VARS
litellm/proxy/proxy_server.py Email and Slack alerting blocks now resolve via resolve_fields with empty_db_is_set=True; SMTP_TLS (previously missing from the old _email_vars list) is now returned; masking constant is unchanged
ui/litellm-dashboard/src/components/email_settings.tsx Email save now skips any field whose input value equals the server-returned value, preventing masked passwords and env-sourced values from being persisted on every save
ui/litellm-dashboard/src/components/SSOModals.tsx Adds generic_scope field and makes the required flag optional; still maintains its own ssoProviderConfigs in parallel with BaseSSOSettingsForm.tsx rather than importing the exported copy
ui/litellm-dashboard/src/components/Settings/AdminSettings/SSOSettings/Modals/BaseSSOSettingsForm.tsx Adds generic_scope field to both provider configs and exports ssoProviderConfigs for potential reuse; required flag handling is correct
tests/test_litellm/proxy/config_resolvers/test_config_resolvers.py Comprehensive pure-unit tests for the new resolver; covers DB-wins, blank-DB-falls-to-env, empty_db_is_set semantics, os.environ non-mutation, and structured mapping parsing
tests/test_litellm/proxy/test_proxy_server.py Three new regression tests for /get/config/callbacks email block; covers env-only, stored-wins, and absent-everywhere paths; existing tests are unmodified
tests/test_litellm/proxy/ui_crud_endpoints/test_proxy_setting_endpoints.py Five new /get/sso_settings regression tests covering env-only, os.environ non-mutation, stored-wins, blank-stored-falls-to-env, and unset-everywhere paths; existing test updated to swap legacy mock for the new per-value decrypt_value_helper mock

Reviews (7): Last reviewed commit: "fix(ui): resolve SSO and SMTP settings f..." | Re-trigger Greptile

@codecov

codecov Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tin-berri

Copy link
Copy Markdown
Contributor Author

@greptileai on the P2 about generic_scope being cleared when a PATCH omits it: the behaviour is real and worth documenting, and I'm keeping it, because omit-means-clear is the endpoint's existing full-replace contract and it is load-bearing rather than incidental.

/update/sso_settings takes an SSOConfig whose fields all default to None, so an omitted field has always meant "clear this". That applies to all eleven pre-existing mapped fields, not only to generic_scope. Provider switching depends on it: the SSO form renders only the selected provider's fields, so switching from a generic provider to Google submits google fields alone and relies on the generic ones being cleared. Verified on a live proxy at 7acd858583, starting from generic SSO configured through env vars:

1. before
   generic_client_id = 'ui-client-id' | generic_scope = 'openid email profile groups'

2. PATCH /update/sso_settings with only google_client_id, google_client_secret, proxy_base_url, user_email
   HTTP 200

3. after
   google_client_id             = 'google-id'
   generic_client_id            = None
   generic_token_endpoint       = None
   generic_scope                = None

4. GET /sso/key/generate
   https://accounts.google.com/o/oauth2/v2/auth?response_type=code&client_id=google-id&...

Making an omitted field a no-op would leave GENERIC_CLIENT_ID and friends set after that switch, so the gateway would hold two providers' credentials at once and the next _setup_generic_sso_env_vars read would find stale endpoints. Special-casing generic_scope to be the one field with partial-update semantics would also reintroduce exactly the inconsistency this PR removes; the SSO read and write halves drifting apart is what caused the bug in the first place.

So generic_scope is now consistent with its siblings: a caller sending a full document gets a full document applied. The UI always round-trips the field, which is why it is a form field here and not only a response field, and renders an optional generic_scope field for %s so editing cannot clear it in BaseSSOSettingsForm.test.tsx pins that. I've added a note to the PR description so the behaviour is explicit for anyone driving the endpoint from a script.

Genuine partial-update semantics for this endpoint would be a separate change with its own blast radius (it would break provider switching in the UI unless the form starts sending explicit nulls for the other provider's fields), so it is not something I want to slip into an RC bug fix.

@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

That's a thorough and convincing walkthrough. The omit-means-clear contract being load-bearing for provider switching is the key point — special-casing generic_scope would be the real inconsistency, not the current behavior. The live trace of the Google switch makes the blast radius of partial-update semantics concrete rather than theoretical.

The UI always round-tripping the field and the BaseSSOSettingsForm.test.tsx assertion pinning that is the right safety net. No objection to the current approach.

@tin-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@tin-berri

Copy link
Copy Markdown
Contributor Author

Following up on my own reply above, because the argument I made had a hole worth closing rather than leaving as prose.

I justified keeping the behaviour on the grounds that the UI always round-trips generic_scope. That claim was load-bearing and unpinned: antd submits only mounted fields, so deleting the Scopes field from ssoProviderConfigs would have silently reintroduced exactly the downgrade you describe, with nothing failing. It is now pinned by a test (submits generic_scope untouched, so saving an unrelated edit cannot clear GENERIC_SCOPE, commit 3c42fbff2e) that hydrates the form the way EditSSOSettingsModal does, edits an unrelated field, submits, and asserts generic_scope is still in the payload. Removing the field from the config fails it with generic_scope missing from the submitted object, so the guard cannot rot.

On the underlying behaviour, this is deliberate rather than an oversight, and the reasoning is that omit-means-clear is load-bearing rather than incidental: provider switching submits only the selected provider's fields and depends on the other provider's env vars being cleared to take effect without a restart. Verified live at 7acd858583 in the reply above, where PATCHing google fields alone cleared the generic ones and repointed the login redirect to accounts.google.com. Making omitted fields a no-op would leave both providers' credentials set at once.

Your P2 does point at something real underneath it though, and it is broader than generic_scope: the endpoint mutates the process environment, so it cannot tell a var the UI set from one helm supplied, and a partial PATCH already destroys operator-provided config for any of the eleven pre-existing mapped fields. That predates this PR and a real fix needs the write path and the form changed together (true partial-update semantics plus explicit nulls on provider switch), which is too much blast radius for an RC bug fix. Filed as LIT-4498 with the repro and a sketch, rather than left implicit here.

@codspeed

codspeed Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_lit4165_env_settings_ui (0c8e7d9) with litellm_internal_staging (a780d4e)

Open in CodSpeed

@tin-berri
tin-berri force-pushed the litellm_lit4165_env_settings_ui branch from 3c42fbf to 05fda6b Compare July 16, 2026 20:42
@tin-berri

Copy link
Copy Markdown
Contributor Author

Squashed the three commits into one (05fda6bbd4) per the single-commit convention. The tree is byte-identical to 3c42fbff2e, which is the 5/5-reviewed ec3d367f3e plus the test-only commit, so no logic changed in the squash

@greptileai

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Runtime-tested head 05fda6bbd4 with env-only Generic SSO and SMTP values against an isolated PostgreSQL database

Caveat: actual SMTP delivery was not attempted because the runtime used a dummy host; the Test Email Alerts control was present

  • Passed: env-only Generic SSO fields rendered, including generic_scope=openid email profile groups, while the client secret stayed masked
  • Passed: Scopes was optional in the edit form and survived save/reopen
  • Passed: env-only SMTP host, port, TLS, username, and sender rendered while the SMTP password stayed masked
  • Passed: saving only TEST_EMAIL_ADDRESS stored no SMTP_PASSWORD database key

PR #33576 env-only settings UI

Recording and runtime notes

Annotated after video

The initial SSO view was captured before any UI save; a disposable Proxy Admin Email was then supplied because the existing edit form requires it for the save/reopen scope check

CI at test time was 108 passed, 1 failed, 0 pending, 1 skipped; the failing job was osv-scan

Test session: https://app.devin.ai/sessions/f03da2725ec94d28b3facf766871b102

@yassin-berriai

Copy link
Copy Markdown
Contributor

bugbot run

@tin-berri

Copy link
Copy Markdown
Contributor Author

Upgraded this PR from the per-endpoint env fallback to a proper typed config object (litellm/proxy/config_resolvers/): a descriptor table single-sources the field-to-env mapping, one pure resolve_fields reconciles stored row then env with per-field provenance, and the read-back endpoints go through it. get_sso_settings also stops decrypting into os.environ (a GET no longer mutates the environment). os.environ stays the runtime carrier; login and mail-send paths are unchanged, and retiring the carrier is tracked in LIT-4498. Squashed to a single commit (4d532cab05); PR body has the refreshed live proof

@greptileai

@tin-berri
tin-berri force-pushed the litellm_lit4165_env_settings_ui branch from 4d532ca to 6966d93 Compare July 21, 2026 22:01
@tin-berri
tin-berri requested a review from a team July 21, 2026 22:01
@tin-berri

Copy link
Copy Markdown
Contributor Author

Follow-up on 6966d9352a: the new tests/test_litellm/proxy/config_resolvers directory was not in any CI shard's test path, so the resolver unit tests were not running in CI (and codecov flagged the module accordingly). Added the path to the proxy-endpoints shard, and removed two dead defensive branches in the mapping parsers (the stored row is JSON, so mappings only ever arrive as dicts). Every changed line under litellm/ is now covered by the mapped tests; codecov's earlier number was partial shard uploads plus the missing path

@greptileai

@tin-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@tin-berri
tin-berri force-pushed the litellm_lit4165_env_settings_ui branch from 6966d93 to c397f9f Compare July 21, 2026 23:07
@tin-berri

Copy link
Copy Markdown
Contributor Author

Rebased onto latest litellm_internal_staging (was 342 commits behind) and resolved the one conflict in SSOModals.tsx — staging had independently restructured that file (moved the logo map to a constants module), so I took staging's version and re-applied just the generic_scope form field + the clear-settings null. All other files auto-merged; resolver wiring, the config_resolvers module, and the CI test-path all verified intact. Now c397f9fe31, mergeable

@tin-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@tin-berri
tin-berri force-pushed the litellm_lit4165_env_settings_ui branch from c397f9f to b04f2df Compare July 22, 2026 02:13
@tin-berri

Copy link
Copy Markdown
Contributor Author

Rebased again onto latest staging (another 34 commits had landed). This time the conflict was in proxy_setting_endpoints.py: staging shipped a UI-theme env-var fallback (one of the env-blind-audit items from this ticket) in the same region where this PR removed the local _SSO_SENSITIVE_FIELDS (now sourced from config_resolvers.sso.SSO_SECRET_FIELDS). Kept staging's new ui-theme code and its Mapping import, dropped the now-unused local constant. Resolver wiring, config_resolvers module, CI test-path, and the slack/email blocks all verified intact; Python compiles clean. Now b04f2df332

@greptileai

@tin-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

The SSO and Email Server settings pages read only stored config, so a gateway
configured entirely through environment variables rendered every field blank
even though both features were live. Rather than add per-endpoint env fallback,
resolve each setting through one typed config object.

A FieldDescriptor names, for one setting, where it lives in the stored row
(db_key), which process env var carries it (env_var), whether it is a secret,
and its effective default. A pure resolve_fields reconciles a descriptor table
against the stored row and the process environment with a fixed precedence and
reports per-field provenance (db, env, default, or unset). The SSO descriptor
table single-sources the field-to-env mapping that the read and write paths
previously duplicated, so they can no longer drift.

get_sso_settings and the /get/config/callbacks alerting block read through the
resolver instead of their own inline fallbacks. get_sso_settings no longer
decrypts stored values into os.environ; decryption happens once inside the
resolver via the pure helper, so a GET stops mutating the process environment.
The SSO response carries provenance so the UI can distinguish an env-sourced
value from a stored one, and secrets are masked at the endpoint (the resolver
returns them unmasked so the login path could consume them). os.environ remains
the runtime carrier; the SSO login and mail-send paths are unchanged.

The settings pages also submit only fields an admin actually edited, so a
rendered mask or env-sourced value is never written back over a working
secret, and generic_scope is a real SSO form field. Omitting a field from
/update/sso_settings clears it, which provider switching relies on; the deeper
write-path concern that behaviour points at is tracked in LIT-4498.
@tin-berri

Copy link
Copy Markdown
Contributor Author

Good catch on the duplication. Two parts to it:

The correctness concern (SSOModals could clear GENERIC_SCOPE on save) was not actually reachable on b04f2df since both copies carried generic_scope, but the underlying duplication was real and a genuine drift risk. This PR originally consolidated ssoProviderConfigs; that consolidation got dropped while resolving a rebase conflict against staging's restructure of this file, which reintroduced the second copy.

Fixed properly in 0c8e7d9e61: SSOModals.tsx now imports renderProviderFields from BaseSSOSettingsForm and its local ssoProviderConfigs + SSOProviderConfig + local renderProviderFields (a byte-identical dup) are gone, along with the dead export { ssoProviderConfigs } that nothing consumed. generic_scope is now single-sourced in BaseSSOSettingsForm, so the add-SSO flow and the edit flow render from the same config and cannot drift. eslint clean and the 136 SSO dashboard tests pass

@greptileai

@tin-berri
tin-berri force-pushed the litellm_lit4165_env_settings_ui branch from b04f2df to 0c8e7d9 Compare July 22, 2026 03:09
@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Confirmed — 0c8e7d9e61 resolves this cleanly. SSOModals.tsx now imports renderProviderFields from BaseSSOSettingsForm and carries no local copy of ssoProviderConfigs, SSOProviderConfig, or renderProviderFields. Both the add and edit flows are now single-sourced through BaseSSOSettingsForm, so generic_scope (and any future provider field additions) cannot drift between them. Thanks for the detailed explanation of how the rebase reintroduced the duplication.

@tin-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 0c8e7d9. Configure here.

@tin-berri
tin-berri requested a review from yassin-berriai July 22, 2026 18:51
@yassin-berriai
yassin-berriai enabled auto-merge (squash) July 22, 2026 20:46
@yassin-berriai
yassin-berriai merged commit 9baea68 into litellm_internal_staging Jul 22, 2026
85 of 86 checks passed
@yassin-berriai
yassin-berriai deleted the litellm_lit4165_env_settings_ui branch July 22, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants