The Fix
pip install pydantic==2.9.2
Based on closed pydantic/pydantic issue #10370 · 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%.
@@ -3,6 +3,7 @@
import functools
+import inspect
from typing import TYPE_CHECKING, Any, Callable, TypeVar, overload
import asyncio
import inspect
from pydantic import validate_call
@validate_call(validate_return=True)
async def delay_number(n: int) -> int:
await asyncio.sleep(1)
return n
if __name__ == "__main__":
print(inspect.iscoroutinefunction(delay_number))
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==2.9.2\nWhen NOT to use: This fix should not be used if the decorator is not intended for async functions.\n\n
Why This Fix Works in Production
- Trigger: When I use `async_to_sync`, I got a error ` UserWarning: async_to_sync was passed a non-async-marked callable`.
- Mechanism: Ensures that the `@validate_call` decorator correctly identifies and works with async functions, allowing `inspect.iscoroutinefunction` to return True for decorated coroutines.
- Why the fix works: Ensures that the `@validate_call` decorator correctly identifies and works with async functions, allowing `inspect.iscoroutinefunction` to return True for decorated coroutines. (first fixed release: 2.9.2).
- 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
- Production symptom (often without a traceback): When I use `async_to_sync`, I got a error ` UserWarning: async_to_sync was passed a non-async-marked callable`.
Proof / Evidence
- GitHub issue: #10370
- Fix PR: https://github.com/pydantic/pydantic/pull/10374
- First fixed release: 2.9.2
- 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.64
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Maybe pydantic._internal._validate_call.ValidateCallWrapper need some changes to adapt async function(coroutine)?”
“Yeah. I don't think it's likely that we'll support async functions in the short term, but we can leave this open as a potential feature.”
“Huh, I forgot that we offered support! That's great, thanks for the ref! I'd say we probably want to have the functions defined within this…”
“> Yeah”
Failure Signature (Search String)
- When I use `async_to_sync`, I got a error ` UserWarning: async_to_sync was passed a non-async-marked callable`.
- Maybe `pydantic._internal._validate_call.ValidateCallWrapper` need some changes to adapt async function(coroutine)?
Copy-friendly signature
Failure Signature
-----------------
When I use `async_to_sync`, I got a error ` UserWarning: async_to_sync was passed a non-async-marked callable`.
Maybe `pydantic._internal._validate_call.ValidateCallWrapper` need some changes to adapt async function(coroutine)?
Error Message
Signature-only (no traceback captured)
Error Message
-------------
When I use `async_to_sync`, I got a error ` UserWarning: async_to_sync was passed a non-async-marked callable`.
Maybe `pydantic._internal._validate_call.ValidateCallWrapper` need some changes to adapt async function(coroutine)?
Minimal Reproduction
import asyncio
import inspect
from pydantic import validate_call
@validate_call(validate_return=True)
async def delay_number(n: int) -> int:
await asyncio.sleep(1)
return n
if __name__ == "__main__":
print(inspect.iscoroutinefunction(delay_number))
Environment
- Pydantic: 2
What Broke
Using async_to_sync with decorated async functions results in a UserWarning and incorrect behavior.
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==2.9.2
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/10374
First fixed release: 2.9.2
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be used if the decorator is not intended for async functions.
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 |
|---|---|
| 2.9.2 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.