Skip to content

Bump FastAPI to 0.131.0 and add explicit API response models#13

Merged
listlessbird merged 2 commits into
mainfrom
codex/update-fastapi-to-0.131.0
Feb 24, 2026
Merged

Bump FastAPI to 0.131.0 and add explicit API response models#13
listlessbird merged 2 commits into
mainfrom
codex/update-fastapi-to-0.131.0

Conversation

@listlessbird
Copy link
Copy Markdown
Owner

Motivation

  • Upgrade the FastAPI baseline to 0.131.0 to pick up improved JSON response performance and align with the custom-response guidance.
  • Declare explicit response_model and concrete return types on endpoints to make serialization behavior explicit and take advantage of FastAPI optimizations.

Description

  • Bumped fastapi[standard] floor in backend-api/pyproject.toml to >=0.131.0.
  • Added api.models.health with HealthResponse, IndexVersionResponse, and IndexVersionsResponse Pydantic models and exported them from api.models.__init__.
  • Updated the health endpoint to @router.get("/live", response_model=HealthResponse) and to return a concrete HealthResponse while setting the dynamic HTTP status via the Response object.
  • Updated GET /jobs/indexes/versions to declare response_model=IndexVersionsResponse, return typed IndexVersionResponse objects, and use a concrete return type instead of an untyped dict.

Testing

  • Ran linter: backend-api/.venv/bin/ruff check src/api/main.py src/api/routers/health.py src/api/routers/jobs.py src/api/models/health.py src/api/models/__init__.py and it passed.
  • Ran unit tests: backend-api/.venv/bin/pytest tests/api/test_jobs_api.py tests/api/test_search_api.py -q and all tests passed (10 passed).
  • Attempted to refresh lock with uv lock --upgrade-package fastapi but it failed due to external package index connectivity/tunnel errors in this environment.

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae73a01458

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread backend-api/src/api/models/health.py Outdated


class IndexVersionResponse(BaseModel):
version: int
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Align index version type with persisted string IDs

IndexVersionResponse.version is declared as int, but IndexBuild.version is persisted as str in shared/models/orm.py and generated as non-numeric IDs like v20260223-... in activities/indexing/faiss_manager.py; when /jobs/indexes/versions builds IndexVersionResponse(version=b.version, ...), Pydantic validation will fail as soon as any index build exists, turning this endpoint into a 500 instead of returning version data.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4415d223a7

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread backend-api/src/api/models/health.py Outdated
Comment on lines +12 to +15
embed_model: str
index_type: str
num_vectors: int
dimension: int
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Permit nullable index metadata in versions response

IndexVersionResponse now requires embed_model, index_type, num_vectors, and dimension, but IndexBuild persists all four as nullable columns (shared/models/orm.py), so /jobs/indexes/versions will raise a Pydantic validation error and return 500 whenever a historical or partially populated index_builds row has any NULL in those fields. The previous untyped dict response handled these values, so this change introduces a data-dependent regression for valid persisted records.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@listlessbird listlessbird force-pushed the codex/update-fastapi-to-0.131.0 branch from 0afd93d to 13a39a2 Compare February 24, 2026 15:38
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@listlessbird listlessbird merged commit 61afad6 into main Feb 24, 2026
0 of 2 checks passed
@listlessbird listlessbird deleted the codex/update-fastapi-to-0.131.0 branch February 24, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant