Backtestspydanticrun-20261013-104308#13687
populate_by_name (and implicit validate_by_name when validate_by_alias=False) is ignored by @validate_call
Better
Our patch was judged better than the merged fix.
In this judgment, Patch A = our agent, Patch B = the merged fix.
Both patches fix the root cause. The bug is that the arguments schemas embed the raw `validate_by_name` value, which overrides the core config.
Patch A adds `ConfigWrapper.resolved_validate_by_name()`. It resolves an explicit `validate_by_name` first, then falls back to `populate_by_name`, and finally treats `validate_by_alias is False` as enabling name validation. It uses this in both `_arguments_schema` and `_arguments_v3_schema`. That handles both scenarios in the issue: `populate_by_name=True` and the 'worse variant' with `validate_by_alias=False`. A also applies the resolved value to the generated `__init__` signatures for models and dataclasses. That is adjacent and low-risk, and it keeps signatures consistent with validation behavior. The main weakness is that the logic duplicates what `core_config()` already does, so the two could drift apart; the docstring at least says so.
Patch B calls `core_config(title=None)` and embeds `core_config.get('validate_by_name')`. This reuses the existing patching logic as a single source of truth, which is clean. If that patching also covers the `validate_by_alias=False` case, B fixes both scenarios too, and an unset value passes through as None so pydantic-core falls back to its config. It does build a whole core config just to read one key, which is a little wasteful.
The deciding factor is the tests. A tests both issue scenarios for `@validate_call` and for both experimental schema types. It checks that the alias still works under `populate_by_name`, and that under `validate_by_alias=False` the name works and the alias is rejected with specific error types. B only tests the `populate_by_name` name path, only for `arguments-v3` plus one `validate_call` case. It never exercises the `validate_by_alias=False` variant the issue calls worse. B also adds unrelated test churn (rewriting `dict(...)` as `{...}` in existing tests) and leaves placeholder `"""<link>"""` docstrings.
Correctness is roughly equal, so A wins on test coverage of the reported scenarios and on cleaner scope in its tests.
The judge saw only the two patches, labelled A and B in random order, with issue links and version numbers removed. The reasoning above is shown verbatim.
Solve
6m 11s
Wall-clock time in the container
Full test suite
No new failures
1,079 passed · 36 skipped · 1,115 total
Contamination audit
Clean
No sign the agent saw the real fix
Patch size
76vs 39 merged
Changed lines, ours vs merged