The Fix
pip install pydantic==1.10.18
Based on closed pydantic/pydantic issue #9861 · PR/commit linked
Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.
@@ -345,6 +345,7 @@ def to_argument(
api: SemanticAnalyzerPluginInterface,
force_typevars_invariant: bool,
+ is_root_model_root: bool,
) -> Argument:
"""Based on mypy.plugins.dataclasses.DataclassAttribute.to_argument."""
from pydantic import BaseModel, RootModel
class Foo(BaseModel):
pass
class Bar(Foo, RootModel):
pass
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\npip install pydantic==1.10.18\nWhen NOT to use: This fix should not be applied if the inheritance structure is not intended to be compatible.\n\n
Why This Fix Works in Production
- Trigger: Mypy error: incompatible definition of `model_construct()` in multiple inheritance from `BaseModel` and `RootModel`
- Mechanism: The mypy plugin fails to handle multiple inheritance from BaseModel and RootModel correctly
- Why the fix works: Prevents a type error for exotic BaseModel/RootModel inheritance, resolving the mypy error related to incompatible definitions. (first fixed release: 1.10.18).
- If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.
Why This Breaks in Prod
- Shows up under Python 3.8 in real deployments (not just unit tests).
- The mypy plugin fails to handle multiple inheritance from BaseModel and RootModel correctly
- Production symptom (often without a traceback): Mypy error: incompatible definition of `model_construct()` in multiple inheritance from `BaseModel` and `RootModel`
Proof / Evidence
- GitHub issue: #9861
- Fix PR: https://github.com/pydantic/pydantic/pull/9913
- First fixed release: 1.10.18
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.85
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.67
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“@brianmedigate it would be great if you could confirm whether #9913 resolves the issue for you”
“I opened #9913 which I think may fix this but I'm concerned that the relevant code was necessary to resolve some other bug.. if there's…”
“Okay I realized that there was a reason the code did what it did, but I'm semi-optimistic I found a "real" fix.. see #9913 for…”
Failure Signature (Search String)
- Mypy error: incompatible definition of `model_construct()` in multiple inheritance from `BaseModel` and `RootModel`
- `test.py:7: error: Definition of "model_construct" in base class "Foo" is incompatible with definition in base class "RootModel" [misc]`
Copy-friendly signature
Failure Signature
-----------------
Mypy error: incompatible definition of `model_construct()` in multiple inheritance from `BaseModel` and `RootModel`
`test.py:7: error: Definition of "model_construct" in base class "Foo" is incompatible with definition in base class "RootModel" [misc]`
Error Message
Signature-only (no traceback captured)
Error Message
-------------
Mypy error: incompatible definition of `model_construct()` in multiple inheritance from `BaseModel` and `RootModel`
`test.py:7: error: Definition of "model_construct" in base class "Foo" is incompatible with definition in base class "RootModel" [misc]`
Minimal Reproduction
from pydantic import BaseModel, RootModel
class Foo(BaseModel):
pass
class Bar(Foo, RootModel):
pass
Environment
- Python: 3.8
- Pydantic: 2
What Broke
Developers encounter mypy errors when using multiple inheritance with Pydantic models.
Why It Broke
The mypy plugin fails to handle multiple inheritance from BaseModel and RootModel correctly
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==1.10.18
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/9913
First fixed release: 1.10.18
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be applied if the inheritance structure is not intended to be compatible.
Verify Fix
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
| Version | Status |
|---|---|
| 1.10.18 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.