Model/provider allow list to deny list#799
Merged
chrarnoldus merged 22 commits intomainfrom Mar 6, 2026
Merged
Conversation
Contributor
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Fix these issues in Kilo Cloud Other Observations (not in diff)N/A Files Reviewed (32 files)
|
…d stale allow-list references
| // Check if default_model needs to be cleared | ||
| if ( | ||
| model_allow_list !== undefined && | ||
| settingsUpdate.model_deny_list !== undefined && |
Contributor
There was a problem hiding this comment.
WARNING: Provider-only deny-list updates can leave a blocked default model persisted
This guard only revalidates default_model when model_deny_list is defined and non-empty. If an org has no model deny list and the update only adds provider_deny_list entries that disable every provider for the current default, the stale default_model survives the mutation even though createAllowPredicateFromDenyList() would now reject it. That leaves the saved settings inconsistent until a later read path happens to fall back.
imanolmzd-svg
approved these changes
Mar 6, 2026
chrarnoldus
added a commit
that referenced
this pull request
Mar 9, 2026
…930) ## 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`).
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.
Data is already migrated in prod
Did some testing