Skip to content

fix: pin fastapi>=0.116.0 to prevent starlette 0.46+ incompatibility - #810

Merged
burtenshaw merged 4 commits into
mainfrom
fix/sync-env-doc-stubs
Jun 16, 2026
Merged

fix: pin fastapi>=0.116.0 to prevent starlette 0.46+ incompatibility#810
burtenshaw merged 4 commits into
mainfrom
fix/sync-env-doc-stubs

Conversation

@sergiopaniego

Copy link
Copy Markdown
Member

Summary

Pins fastapi>=0.116.0 in pyproject.toml and in the openapp_env Dockerfile to prevent a starlette 0.46+ incompatibility. The build-envs (openapp-env) GitHub Actions job was
failing because the Dockerfile's two-step pip install pattern could land on fastapi 0.115.x in the first step, then upgrade starlette to 0.46+ via fastmcp/mcp in a second step
without re-evaluating fastapi. fastapi <0.116 passes on_startup to starlette's Router.__init__, which was removed in starlette 0.46, causing a TypeError at import time.

Type of Change

  • Bug fix

Alignment Checklist

Before submitting, verify:

  • I have read .claude/docs/PRINCIPLES.md and this PR aligns with our principles
  • I have checked .claude/docs/INVARIANTS.md and no invariants are violated
  • I have run /pre-submit-pr (or bash .claude/hooks/lint.sh and tests) and addressed all issues

RFC Status

  • Not required (bug fix, docs, minor refactoring)

Test Plan

The Build and Push Docker Images / build-envs (openapp-env) job in CI will pass after this change. The fix can be verified by running the openapp_env Docker build locally:

cd envs/openapp_env && docker build -f server/Dockerfile .

Claude Code Review

N/A

@sergiopaniego

Copy link
Copy Markdown
Member Author

@bot-ci-comment

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copilot AI 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.

Pull request overview

This PR addresses a CI/runtime import failure caused by an incompatible FastAPI/Starlette combination when the openapp_env Docker image installs dependencies in multiple pip install steps. The fix enforces fastapi>=0.116.0 so that installing/upgrading Starlette to 0.46+ does not leave FastAPI on a version that still passes the removed on_startup argument into Starlette internals.

Changes:

  • Bump OpenEnv’s minimum FastAPI version to >=0.116.0 in pyproject.toml (both dependencies and [project.optional-dependencies].core).
  • Ensure the openapp_env Dockerfile’s post-install upgrade step also upgrades FastAPI to >=0.116.0.

Alignment Review Report

Automated Checks

  • Lint: NOT RUN - repository hooks exist (.claude/hooks/lint.sh) but were not executable from the review tooling surface.
  • Debug code: NOT RUN - repository hook exists (.claude/hooks/check-debug.sh) but was not executable from the review tooling surface.

Open RFCs Context

  • RFCs 000, 001, 002, 003, and 005 are marked In Review; none appear directly impacted by a dependency floor bump for FastAPI.

Tier 1: Fixes Required

  • None identified in the changed diff hunks.

Tier 2: Alignment Discussion

Principle Conflicts

None identified.

RFC Conflicts

None identified.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
pyproject.toml Raises the minimum FastAPI version to avoid Starlette 0.46+ incompatibility.
envs/openapp_env/server/Dockerfile Forces FastAPI upgrade in the final dependency reconciliation step to prevent mixed-version installs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


# Ensure fastmcp runtime deps are on compatible versions after all installs.
RUN pip install --no-cache-dir --upgrade "beartype>=0.22.6" "fastmcp>=2.14.5"
RUN pip install --no-cache-dir --upgrade "beartype>=0.22.6" "fastmcp>=2.14.5" "fastapi>=0.116.0"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Leaving the initial install unpinned here: the final --upgrade ... "fastapi>=0.116.0" step is the actual correctness fix, and pinning the earlier step is only a redundant-download optimization. Not worth the extra churn in this bugfix PR.


# Ensure fastmcp runtime deps are on compatible versions after all installs.
RUN pip install --no-cache-dir --upgrade "beartype>=0.22.6" "fastmcp>=2.14.5"
RUN pip install --no-cache-dir --upgrade "beartype>=0.22.6" "fastmcp>=2.14.5" "fastapi>=0.116.0"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done — bumped envs/openapp_env/pyproject.toml to fastapi>=0.116.0 in a6c0e26 so non-Docker installs of the env are covered too.

Comment thread pyproject.toml
# Heavy dependencies (torch, numpy, smolagents, etc.) should be in
# individual environment pyproject.toml files
"fastapi>=0.104.0",
"fastapi>=0.116.0",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated the two scaffolding templates (src/openenv/cli/templates/openenv_env/server/requirements.txt and the generate-openenv-env skill asset) to fastapi>=0.116.0 in a6c0e26. The broader sweep of the remaining envs/*/pyproject.toml files (most don't pull in fastmcp/mcp, so they aren't affected by the starlette 0.46 incompatibility) I'll handle in a separate follow-up PR to keep this one focused on the openapp-env CI fix.

sergiopaniego and others added 3 commits June 16, 2026 12:23
Address Copilot review on #810: align openapp_env package dep and the
CLI/skill scaffolding templates with the new core minimum so non-Docker
and freshly-generated envs can't land on the incompatible fastapi 0.115.x.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants