Commit ec28335
fix(deps): cap fastapi <0.137.0 to stop OPTIONS preflight 500s
FastAPI 0.137.0 made app.routes a tree containing _IncludedRouter
wrapper objects that do not expose a .path attribute, instead of a flat
list of routes that each have .path. The OTel FastAPI auto-instrumentation
(injected at runtime by the observability operator, so not a dependency we
can bump here) reads route.path on a Match.PARTIAL while building the
request span. A browser CORS preflight (OPTIONS) has no declared endpoint,
so it only PARTIAL-matches the _IncludedRouter, raising AttributeError in
the ASGI layer (outside FastAPI's exception handlers) and returning HTTP
500. This blocks the Agents UI from loading.
The version actually resolved by the workspace is controlled by the root
pyproject's override-dependencies, which floored fastapi>=0.135.0 with no
ceiling and so picked up 0.137+. Cap it (and the agentex package dep) at
<0.137.0. Pinning up does not help: 0.137.1/0.137.2/0.138.0 keep
_IncludedRouter and only add a new iter_route_contexts() helper the pinned
injected instrumentation does not use. The starlette>=1.3.1 override keeps
the existing CVE fixes regardless of the cap; resolution lands on 0.136.3.
Add a regression test asserting every app.routes entry exposes .path and
that OPTIONS-preflight route matching cannot crash, so a future fastapi
bump that reintroduces the regression fails CI.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 8c060f1 commit ec28335
4 files changed
Lines changed: 66 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
30 | 34 | | |
31 | | - | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments