Fix validation for model config override#3649
Merged
copybara-service[bot] merged 1 commit intomainfrom Apr 14, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
c02406d to
9662a79
Compare
NuojCheng
approved these changes
Apr 13, 2026
Collaborator
NuojCheng
left a comment
There was a problem hiding this comment.
Thank you for the fix Shuning!
gobbleturk
reviewed
Apr 13, 2026
Collaborator
There was a problem hiding this comment.
Are there tests that both
- When override_model_config=False and user tries to override, we throw some error?
- When override_model_config=True, we can run a simple model (it looks like there are a bunch of tests which rely on this so its sort of indirectly tested)
I realize I should have added these tests when I created the feature override_model_config - but I also only tested case 2) - I am not sure is case 1) tested somewhere 2ed45b6
9662a79 to
ce92bcc
Compare
ce92bcc to
e23d7e3
Compare
Collaborator
Author
|
Thanks for the suggestion. I updated
|
gobbleturk
reviewed
Apr 13, 2026
gobbleturk
approved these changes
Apr 13, 2026
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.
Description
Fix validation for flag
override_model_config, b/502052235Issue
Flag: override_model_config
Previous behavior:
override_model_config=Falseoverride_model_config=TrueCurrent behavior:
override_model_config=Falseoverride_model_config=TrueCause: We previously had validation to check model config vs. CLI/kwargs/env, in
pyconfig_deprecated.py. It is now bypassed withpyconfig.pyandtypes.py.Change
pyconfig.py: Add validation to check model config vs. CLI/kwargs/env, whenoverride_model_config=Truetests/unit: addoverride_model_config=Trueto fix validation error in unit testtests/unit/pyconfig_testtest_overriding_model: check successful update whenoverride_model_config=Truetest_overriding_model_raises_error: check ValueError whenoverride_model_config=FalseTests
Before
CLI, override_model_config=false -> can override, which is wrong
https://paste.googleplex.com/5135739043053568
environment variable, override_model_config=false -> can override, which is wrong
https://paste.googleplex.com/5933592896208896
After
1. CLI, override_model_config=false -> prevent ok
https://paste.googleplex.com/5025033308209152
https://paste.googleplex.com/5895284967211008
3. environment variable, override_model_config=false -> prevent ok
https://paste.googleplex.com/6540298005118976
https://paste.googleplex.com/5443039960104960
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.