Skip to content

fix(settings): clear default_model when provider_deny_list blocks it#930

Merged
chrarnoldus merged 1 commit intomainfrom
fix/provider-deny-list-clears-default-model
Mar 9, 2026
Merged

fix(settings): clear default_model when provider_deny_list blocks it#930
chrarnoldus merged 1 commit intomainfrom
fix/provider-deny-list-clears-default-model

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot Bot commented Mar 9, 2026

Summary

  • Fixes a bug where updating only provider_deny_list could leave a now-blocked default_model persisted in org settings.
  • Previously, the revalidation guard only fired when model_deny_list was included in the update and non-empty, so a provider-only deny-list update that blocked every provider for the current default model would silently leave the stale value in the DB.
  • The fix checks both deny lists: the guard now triggers when either model_deny_list or provider_deny_list is part of the update, and uses the effective (post-update) values of both lists to evaluate whether default_model is still allowed.

Addresses: #799 (comment)

Verification

  • Reviewed the diff and logic manually; the effectiveModelDenyList/effectiveProviderDenyList fallback to [] ensures createAllowPredicateFromDenyList receives the correct post-update state regardless of which list was updated.
  • Could not run automated tests (node_modules unavailable in this environment).

Visual Changes

N/A

Reviewer Notes

The inner if (effectiveModelDenyList.length > 0 || effectiveProviderDenyList.length > 0) guard preserves the original behaviour of skipping the async predicate check when both lists are empty (i.e. deny lists are being fully cleared — in that case all models become allowed, so no need to clear default_model).

@kilo-code-bot
Copy link
Copy Markdown
Contributor Author

kilo-code-bot Bot commented Mar 9, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 files)
  • src/routers/organizations/organization-settings-router.ts

@chrarnoldus chrarnoldus merged commit d8a803e into main Mar 9, 2026
17 checks passed
@chrarnoldus chrarnoldus deleted the fix/provider-deny-list-clears-default-model branch March 9, 2026 10:31
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.

2 participants