Jump to solution
Verify

The Fix

pip install fastapi==0.128.4

Based on closed fastapi/fastapi issue #14465 · 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%.

Jump to Verify Open PR/Commit
@@ -110,6 +110,8 @@ def is_gen_callable(self) -> bool: ) or inspect.isgeneratorfunction(_unwrapped_call(self.call)): return True + if inspect.isclass(_unwrapped_call(self.call)): + return False dunder_call = getattr(_impartial(self.call), "__call__", None) # noqa: B004
repro.py
from typing import Annotated from fastapi import Depends, FastAPI from fastapi.dependencies.models import Dependant from uvicorn import run class Dependency: def __init__(self): print("init") async def __call__(self): print("call") print(Dependant(Dependency).is_coroutine_callable) # `True` with fastapi>=0.123.6 # `False` with fastapi<0.123.6 app = FastAPI() @app.get("/") async def route(*, dependency: Annotated[Dependency, Depends()]): await dependency() run(app) # then `curl localhost:8000`
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 fastapi==0.128.4\nWhen NOT to use: This fix should not be applied if using non-class callable dependencies.\n\n

Why This Fix Works in Production

  • Trigger: solved = await call(**solved_result.values)
  • Mechanism: FastAPI incorrectly identifies class dependencies with a __call__ method as coroutine callables
  • Why the fix works: Fixes a regression in FastAPI 0.123.6 where class dependencies with a __call__ method were incorrectly identified as coroutine callables. (first fixed release: 0.128.4).
Production impact:
  • 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.14 in real deployments (not just unit tests).
  • FastAPI incorrectly identifies class dependencies with a __call__ method as coroutine callables
  • Surfaces as: File ".venv/lib/python3.14/site-packages/fastapi/dependencies/utils.py", line 647, in solve_dependencies

Proof / Evidence

Discussion

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

“Fixed by https://github.com/fastapi/fastapi/pull/14458”
@tiangolo · 2025-12-05 · source

Failure Signature (Search String)

  • solved = await call(**solved_result.values)

Error Message

Stack trace
error.txt
Error Message ------------- File ".venv/lib/python3.14/site-packages/fastapi/dependencies/utils.py", line 647, in solve_dependencies solved = await call(**solved_result.values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'Dependency' object can't be awaited

Minimal Reproduction

repro.py
from typing import Annotated from fastapi import Depends, FastAPI from fastapi.dependencies.models import Dependant from uvicorn import run class Dependency: def __init__(self): print("init") async def __call__(self): print("call") print(Dependant(Dependency).is_coroutine_callable) # `True` with fastapi>=0.123.6 # `False` with fastapi<0.123.6 app = FastAPI() @app.get("/") async def route(*, dependency: Annotated[Dependency, Depends()]): await dependency() run(app) # then `curl localhost:8000`

Environment

  • Python: 3.14

What Broke

The application raises a TypeError when trying to await a class instance instead of a coroutine.

Why It Broke

FastAPI incorrectly identifies class dependencies with a __call__ method as coroutine callables

Fix Options (Details)

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

pip install fastapi==0.128.4

When NOT to use: This fix should not be applied if using non-class callable dependencies.

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

Fix reference: https://github.com/fastapi/fastapi/pull/14458

First fixed release: 0.128.4

Last verified: 2026-02-08. 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 using non-class callable dependencies.

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

  • Capture the exact failing error string in logs and tests so you can reproduce via a minimal script.
  • Pin production dependencies and upgrade only with a reproducible test that hits the failing path.

Version Compatibility Table

VersionStatus
0.128.4 Fixed

Related Issues

No related fixes found.

Sources

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