Skip to content

fix(core): upgrade FastAPI and preserve read-cache identities - #1854

Merged
phernandez merged 1 commit into
docs/skills-1.0-toolsfrom
chore/fastapi-python315
Oct 24, 2026
Merged

phernandez merged 1 commit into
docs/skills-1.0-toolsfrom
chore/fastapi-python315

Conversation

@phernandez

Copy link
Copy Markdown
Member

Why

Upgrade FastAPI from 0.139.0 to 0.162.0 while preserving local MCP startup and read-cache identity. The new FastAPI removes get_flat_dependant, which previously prevented Basic Memory from importing after the upgrade.

Stacked on #1849; land that migration first, then retarget this PR to main.

What Changed

  • Pin FastAPI 0.162.0 and refresh the compatible OpenTelemetry/Logfire dependencies in uv.lock.
  • Walk route dependencies directly for cache query parameters and validated QUERY bodies.
  • Add regressions for nested dependency parameters, aliases, body defaults and ignored fields.
  • Document the Python 3.15 installation blocker and re-enablement checklist in docs/1.0.md.

Implementation Details

Cache keys retain all declared nested query inputs and normalize request bodies through their Pydantic model. FastMCP stays at 4.1.3, already the latest stable release checked. Python support and CI remain 3.12–3.14: even latest ONNX Runtime 1.31.0 lacks Python 3.15 wheels. Local embeddings remain in the default installation.

Testing

  • BASIC_MEMORY_ENV=test uv run pytest tests --no-cov -q -n 4 — 8,780 passed, 81 skipped.
  • BASIC_MEMORY_ENV=test uv run pytest test-int/mcp test-int/read_cache -m 'not benchmark' --no-cov -q — 400 passed, 1 deselected.
  • BASIC_MEMORY_ENV=test BASIC_MEMORY_TEST_POSTGRES=1 uv run pytest tests/test_read_cache_request_identity.py tests/api/v2/test_project_router.py test-int/mcp/test_adapter_project_routing.py test-int/read_cache/test_cache_rules.py --no-cov -q — 60 passed.
  • UV_PROJECT_ENVIRONMENT=/tmp/bm-fastapi-py312 UV_PYTHON=3.12 uv run pytest tests/test_read_cache_request_identity.py tests/api/v2/test_project_router.py test-int/mcp/test_adapter_project_routing.py --no-cov -q — 41 passed on Python 3.12.
  • just typecheck, just package-check, just doctor, targeted Ruff lint/format checks, uv lock --check and git diff --check — passed.
  • Python 3.15.1 dependency installation — blocked by missing ONNX Runtime wheels, documented rather than bypassed.

Risks / Follow-ups

The lockfile updates Logfire to 5.3.0 with OpenTelemetry 1.45.1 to satisfy FastAPI's newer dependency requirements; telemetry and package tests passed. Full PostgreSQL coverage remains a CI gate. FastEmbed/ONNX Runtime upgrades are separate work and would not unblock Python 3.15 today; track microsoft/onnxruntime#33271.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T17:08:18.453200Z 2e59e90 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@phernandez
phernandez force-pushed the chore/fastapi-python315 branch 2 times, most recently from 5dba8dd to 28867fd Compare October 24, 2026 16:49
@phernandez
phernandez added this pull request to stack #1855 October 24, 2026 16:53
@phernandez
phernandez force-pushed the chore/fastapi-python315 branch from 28867fd to c09b2c1 Compare October 24, 2026 16:54
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez
phernandez force-pushed the chore/fastapi-python315 branch from c09b2c1 to 2e59e90 Compare October 24, 2026 17:06
@phernandez
phernandez merged commit 2f66021 into main Oct 24, 2026
30 of 31 checks passed
@phernandez
phernandez deleted the chore/fastapi-python315 branch October 24, 2026 17:18
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.

1 participant