Backtestspydanticrun-20260923-170312#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 address the root cause identified in the issue — that the arguments schema embeds `validate_by_name` from the raw config key, bypassing the `populate_by_name`→`validate_by_name` back-compat mapping and the `validate_by_alias=False` implicit-name patch that only run in `core_config()`. Patch A extracts that patching logic into an idempotent `_apply_validate_by_alias_and_name_patches()` helper and invokes it at all three call sites before reading the (now-patched) config attributes; it also embeds `validate_by_alias` symmetrically so the config value is honored consistently. Patch B instead calls `core_config(title=None)` inside each schema method purely to fish `validate_by_name` back out of the generated dict. Both are functionally correct (the arguments validator honors config-level `validate_by_alias`, so B's reliance on config for the alias flag also disables the alias in the worse variant), but A is preferable on the weighted criteria. Tests: A adds tests for BOTH scenarios the issue calls out — `populate_by_name=True` and the emphasized 'worse variant' `validate_by_alias=False` (asserting name works and alias raises) — whereas B tests only the `populate_by_name` path (plus a nice low-level arguments-v3 test) and omits the worse variant entirely. Scope: B includes drive-by churn reformatting unrelated tests from `dict(...)` to `{...}` (test_validate_by_name, test_validate_return, test_validate_all), incidental to the fix. Craft: A's factored, documented, idempotent helper is a cleaner root-cause fix and keeps reads going through the config wrapper's properties; B's pattern of building an entire core config to read a single flag is indirect and can re-trigger the deprecation warning at schema-generation time. A's only real risk is that it passes a new `validate_by_alias` kwarg to `core_schema.arguments_schema`/`arguments_v3_schema`; given pydantic-core 2.48's symmetric alias support this is expected to be valid, and the explicit embedding is arguably more robust than leaving the flag implicit. On balance A resolves the issue more completely, tests the harder case, and stays better scoped.
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
16m 38s12 turns
Wall-clock time in the container
Full test suite
No new failures
6,603 passed · 367 skipped · 6,970 total
Contamination audit
Unknown
See the audit notes for this run
Patch size
67vs 39 merged
Changed lines, ours vs merged