fix: stale config state + admin role check + inline imports#2
Merged
Conversation
Address review feedback from BerriAI#25413: - P1: Call proxy_config.update_config_state() after save_config() in all three config-only helpers. Without this, sequential model operations in the same session silently drop earlier changes because get_config_state() returns the stale startup config. - P2: Move ModelInfo import to the module-level import block. Remove two inline `from litellm.types.router import ModelInfo` statements in patch_model and _update_team_model_in_db. - P3: Add PROXY_ADMIN role check in all four config-only code paths (add_new_model, delete_model, update_model, patch_model). The user_api_key_auth dependency validates the key but not the role — a non-admin virtual key holder could manage models without this guard.
bussyjd
added a commit
to ObolNetwork/obol-stack
that referenced
this pull request
Apr 9, 2026
Includes fixes from ObolNetwork/litellm#2: - P1: stale in-memory config after save_config (sequential write data loss) - P2: inline ModelInfo imports moved to module-level - P3: PROXY_ADMIN role check in config-only code paths
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.
Addresses review feedback from BerriAI#25413 (Greptile bot):
proxy_config.update_config_state()aftersave_config()in all three config-only helpers. Without this, sequential model operations silently drop earlier changes becauseget_config_state()returns stale startup config.ModelInfoto module-level imports, remove two inline imports.PROXY_ADMINrole check in all four config-only code paths.user_api_key_authvalidates the key but not the role.All 41 tests pass.