Repository navigation
MIT-618: add the pydantic-settings validate_by_name GitHub task (batch 6) - #170
Merged
Merged
Conversation
…IT-618) Pydantic 2.14 leaves model_config as declared (pydantic#13825), so pydantic-settings ignored env vars and secrets named after an aliased field under validate_by_alias=False. Verified in containers: fails at the base on 2.14.0, passes with the fix, passes at the base on 2.13.5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qc1CQTb8r67J32HpkhS43y
Bare verbs such as "written back" and "no longer writes" match a fix that only treats the symptom, and "write back" matches "write backend". The phrases now name model_config or validate_by_name. Re-checked with no hits against both base outputs, the laid-over tests, the base source, the symptom words, the edited function names and symptom-only sentences. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qc1CQTb8r67J32HpkhS43y
…T-618-batch6 # Conflicts: # tools/eval/github_tasks.py
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.
What changed
tools/eval/github_tasks.pygets 1 more verified GitHub task, for 7 in all. Zach wants 20, so this is well short. The rest of the batch's leads failed the bar (see the rejected candidates).upstream_changegh-pydantic-settings-validate-by-namepydantic-2.14-model-config-not-resolved(new)gh-pydantic-settings-signature, but under a different key: that one is pydantic#13730, the private signature helper.model_configattribute pydantic/pydantic#13825, "Do not mutatemodel_configattribute". It merged 2026-09-25, and commit 5da36b5 was authored and committed that same day, after the June 2026 cutoff.v2.14.0, which was released 2026-10-08.3b405d4.f0dd382._validate_by_name_enabledinsources/utils.pyresolves the config itself:validate_by_name, then thepopulate_by_namefallback, then thevalidate_by_alias=Falseimplication.main.py, the env and secrets sources, the Azure source and the CLI source use it.tests/test_settings.py.tests/test_utils.pyis left out, because it imports the fix's new helper by name.tests/test_source_azure_key_vault.pyis left out as well.test_validate_by_alias_false_when_using_nameandtest_validate_by_alias_false_with_secrets_when_using_name. The PR's third new test (init kwarg priority) passes at the base on 2.14.0, so it is left out.uv pip install --exclude-newer=... -e . pytest==9.1.1, thenpydantic==2.14.0.Base failing output (containerized)
The key line, from both tests:
The runs went through a
.scratch/helper that callsrepos.materialize,repos.prepareandrepos.run_testswithcontainer.run, the same stepsagent_eval.py checkruns. Containers ran one at a time, none were left behind, and--on-hostwas never used.Cause-word checks
back into model_config,back to model_configno longer mutates,no longer mutates model_config,mutate model_config,mutates model_config,mutating model_configmodel_config as declared,model_config no longer,model_config unchanged,leaves model_configno longer writes validate_by_name,no longer sets validate_by_name,stopped writing validate_by_name,stopped setting validate_by_name2.14model_configorvalidate_by_name. The first version had bare verbs (written back,no longer writes,write back), which a symptom-only fix matches ("never written back to the field"), andwrite backalso matches "write backend". Those were dropped, along withresolved validate_by_name.no longer mutatesis still bare, as the review's list has it.model_configas declared, and no longer writes the resolvedvalidate_by_nameback into it.2.14is a non-version word.impliesandvalidate_by_namealone, because a fix that only treats the symptom says them ("validate_by_alias=False implies validate by name"). I also dropped13825, sinceis_version_wordwould read it as a version.mentionsagainst:tests/test_settings.pyat the fix sha (5,388 lines);pydantic_settings/source (every file, fromgit archiveoff0dd382);validate_by_alias,alias,environment variable,default), in both directions;_settings_restore_init_kwarg_names,_extract_field_info,_get_resolved_field_value,_nested_field_targets,_add_parser_args,__init__) and of the new helper;test_no_example_names_a_scenarios_causeinserver/tests/test_variants.pypasses.model_config, resolving, writing, mutating orvalidate_by_name.test_populate_by_name_*andtest_model_config_*tests, which are already in the base file, plus unrelated comments ("all resolve to the field", forward-reference docstrings).2.14is already in the expected set oftest_the_cause_words_grader_v2_skips_are_exactly_the_versions.Rejected candidates (this batch)
base_urlwith pytest 9.2.0 and pytest-playwright 0.10.0 without pytest-base-url microsoft/playwright-pytest#341/#345 (pytest 9.2 fixture deprecation): the tests need a Chromium install.eval_type_backport): the test docstring states the cause.mcp>=1.17.0admits versions that cannot import with current pydantic Oaklight/toolregistry-server#95, mcp version floor is wrong; CI does not test the floor or run on pull requests AkashChatterjee/glin#49, CI: mcp-majors floor leg (mcp==1.17.0) broken by pydantic 2.14 — floor must move to 1.21.1 DustinTrap/kvm-pilot#271, [shared-ci] test failing across Danathar/goodreads-mcp Danathar/goodreads-mcp#326: mcp floor pins only.ModelFactorywith__by_name__ = Trueignores field names whenField(alias=...)is used litestar-org/polyfactory#918, Fix cleaning a Quantity in QuantityFormFieldMixin CarliJoy/django-pint#142, Lone annotation like {rbc} is not converted to unity dalito/ucumvert#85: not caused by a release.normalize_microstates the cause; 144 MB repo.Why
MIT-618(sixth batch), the GitHub-task eval: real post-cutoff tasks for the arms run.How it was tested
server/tests/test_eval_grader.pyandserver/tests/test_eval_repos.pypass (105 tests).make checkpasses aftergit fetch originand mergingorigin/feature/eval-setup(already up to date).Learned
tests/test_utils.pyhere) can't be laid over, because the import names the fix. Lay over only the files that test the behaviour.is_version_wordtreats a bare issue number such as13825as a version, so an upstream PR number as a cause word would add a version word. Leave it out.🤖 Generated with Claude Code
https://claude.ai/code/session_01Qc1CQTb8r67J32HpkhS43y