Jump to solution
Verify

The Fix

pip install pydantic==2.11.8

Based on closed pydantic/pydantic issue #11876 · PR/commit linked

Jump to Verify Open PR/Commit
@@ -326,18 +326,15 @@ def collect_model_fields( # noqa: C901 # extend this to any descriptor in the future (by simply checking for # `hasattr(assigned_value.default, '__get__')`). - assigned_value.default = assigned_value.default.__get__(None, cls) - - # The `from_annotated_attribute()` call below mutates the assigned `Field()`, so make a copy:
repro.py
from pydantic import BaseModel, Field from typing import Annotated SimilarityLevel = Annotated[int, Field()] class Foo(BaseModel): sl: SimilarityLevel = 50 class Bar(BaseModel): sl: Annotated[SimilarityLevel, Field()] print(Bar.model_fields["sl"])
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
Option A — Upgrade to fixed release\npip install pydantic==2.11.8\nWhen NOT to use: This fix should not be applied if global mutation of field defaults is intended.\n\n

Why This Fix Works in Production

  • Trigger: Models using the same field type experienced unexpected default value changes.
  • Mechanism: The implementation of FieldInfo creation led to global mutation of field defaults
  • Why the fix works: Refactor `FieldInfo` creation implementation to prevent global mutation of field defaults. (first fixed release: 2.11.8).
Production impact:
  • If left unfixed, this can cause silent data inconsistencies that propagate (bad cache entries, incorrect downstream decisions).

Why This Breaks in Prod

  • The implementation of FieldInfo creation led to global mutation of field defaults
  • Production symptom (often without a traceback): Models using the same field type experienced unexpected default value changes.

Proof / Evidence

Verified Execution

We executed the runnable minimal repro in a temporary environment and captured exit codes + logs.

  • Status: PASS
  • Ran: 2026-02-11T16:52:29Z
  • Package: pydantic
  • Fixed: 2.11.8
  • Mode: fixed_only
  • Outcome: ok
Logs
affected (exit=None)
fixed (exit=0)
annotation=int required=True

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“### Initial Checks - [x] I confirm that I'm using Pydantic V2 ### Description When defining a custom type with a Field annotation, its default gets mutated globally whenever it is set in a specific model. See the minimal reproduction exampl”
Issue thread · issue description · source

Failure Signature (Search String)

  • Models using the same field type experienced unexpected default value changes.
Copy-friendly signature
signature.txt
Failure Signature ----------------- Models using the same field type experienced unexpected default value changes.

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- Models using the same field type experienced unexpected default value changes.

Minimal Reproduction

repro.py
from pydantic import BaseModel, Field from typing import Annotated SimilarityLevel = Annotated[int, Field()] class Foo(BaseModel): sl: SimilarityLevel = 50 class Bar(BaseModel): sl: Annotated[SimilarityLevel, Field()] print(Bar.model_fields["sl"])

Environment

  • Pydantic: 2

What Broke

Models using the same field type experienced unexpected default value changes.

Why It Broke

The implementation of FieldInfo creation led to global mutation of field defaults

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

pip install pydantic==2.11.8

When NOT to use: This fix should not be applied if global mutation of field defaults is intended.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

Fix reference: https://github.com/pydantic/pydantic/pull/11898

First fixed release: 2.11.8

Last verified: 2026-02-09. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • This fix should not be applied if global mutation of field defaults is intended.

Verify Fix

verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.

Did This Fix Work in Your Case?

Quick signal helps us prioritize which fixes to verify and improve.

Prevention

  • Add a CI check that diffs key outputs after upgrades (OpenAPI schema snapshots, JSON payload shapes, CLI output).
  • Upgrade behind a canary and run integration tests against the canary before 100% rollout.

Version Compatibility Table

VersionStatus
2.11.8 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.