fix(router): persist and apply retry_policy via update_settings (#31308)#9
Open
shivshekhar12 wants to merge 1 commit into
Open
fix(router): persist and apply retry_policy via update_settings (#31308)#9shivshekhar12 wants to merge 1 commit into
shivshekhar12 wants to merge 1 commit into
Conversation
…iAI#31308) Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
retry_policyset in the Admin UI / config was silently dropped:UpdateRouterConfig, so Pydantic dropped it at parse time before the DB write.Router.update_settings()allowlist, so a value loaded from the DB was never applied to the live router.This PR:
retry_policy: Optional[RetryPolicy]toUpdateRouterConfig(movedRetryPolicyabove it so it can be referenced).retry_policyto theupdate_settings()allowlist.RetryPolicyinstance before applying it to the live router.Test plan
test_update_settings_retry_policy—Router.update_settings()accepts a retry_policy dict and coerces it intoRetryPolicy.retry_policyto the live Router on startup.POST /config/updatepersistsretry_policyinto the DB merged with existing values.UpdateRouterConfigparses and serializesretry_policycorrectly.Fixes BerriAI#31308
Made with Cursor