Skip to content

fix: pin FastAPI below 0.137 for metrics middleware - #5042

Merged
qinxuye merged 1 commit into
xorbitsai:mainfrom
qinxuye:fix/fastapi-metrics-middleware
Jun 16, 2026
Merged

qinxuye merged 1 commit into
xorbitsai:mainfrom
qinxuye:fix/fastapi-metrics-middleware

Conversation

@qinxuye

@qinxuye qinxuye commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • constrain FastAPI to <0.137 in the base dependencies
  • avoid resolving FastAPI 0.137.x until the metrics middleware path is compatible with FastAPI's new router structure

Root cause

FastAPI 0.137 changed router inclusion internals so app.routes can contain an included-router node instead of only normal route objects. aioprometheus.MetricsMiddleware iterates matched routes and expects the matched object to expose .path, which raises on that new node while metrics are enabled.

Validation

  • NO_WEB_UI=1 python setup.py --name
  • parsed the updated fastapi>=0.110.3,<0.137 requirement with packaging.requirements.Requirement
  • pre-commit run --files setup.cfg
  • git diff --check

@XprobeBot XprobeBot added the bug Something isn't working label Jun 16, 2026
@XprobeBot XprobeBot added this to the v2.x milestone Jun 16, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the setup.cfg file to restrict the fastapi dependency to versions below 0.137. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@OliverBryant OliverBryant left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@qinxuye
qinxuye merged commit 2e5cf54 into xorbitsai:main Jun 16, 2026
6 of 13 checks passed
@qinxuye
qinxuye deleted the fix/fastapi-metrics-middleware branch June 16, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants