Skip to content

Migration 0.30x

Use when upgrading from a version older than these releases: 0.309.0, 0.308.0, 0.306.0, 0.305.0, 0.304.0, 0.302.0, 0.301.0 and 0.300.0.

Part of the Migration guide.

0.309.0 — other behaviour changes

Besides the filters key refusal (next section), 0.309.0 brings these changes that may need an adjustment:

  1. JobStore.reclaim_stale() returns ReclaimedJobs, not int. if await store.reclaim_stale(): keeps working (__len__); code that compares against a number or adds the return reads .total instead.
  2. make_auth_router throttles login by default: 5 wrong passwords for the same email within 900 s become 429. Pass login_throttle=False to turn it off, or your own AttemptThrottle for another budget.
  3. make_prometheus_router(dependencies=[require_x_token]) is refused at construction with TypeError. Use dependencies=[make_token_dependency(secret)], which reads the X-Token header.
  4. Readiness has a timeout: every make_health_router check gets timeout=3.0 s by default and running past it counts as a failure. A slower check needs a larger timeout= (or None).
  5. MinIOSettings is deprecated in favour of StorageSettings (STORAGE_*). The MINIO_* names are still read; setting both names of a pair to different values fails the boot. When you regenerate docker-compose.yaml (which now writes STORAGE_*), drop the old MINIO_* from .env or keep both at the same value.
  6. test_session / test_database are deprecated: switch to make_test_session / make_test_database (same signature).

0.309.0 — an unknown filters key raises

A filters key that is not a column of the model ({"usr_id": 1}) or a suffix that is not an operator ({"user_id__bogus": 1}) used to be ignored in silence — and with only the wrong key in the dict, delete_many and bulk_update changed the whole table. Now every method that takes filters, Q, BaseService, BaseController and TenantScopedRepository raise UnknownFilterKeyException (422, code="UNKNOWN_FILTER_KEY", details={"filter": <key>}) before any statement runs.

Who is affected: anyone who passed, on purpose or unknowingly, a key the model cannot resolve. The most common case is a filter schema with a non-column field (search, include_archived) forwarded whole through get_conditions(): a request that fills that field now answers 422.

What to do

  1. Non-column schema field: take it out of the dict before forwarding and handle it in the service.

    from typing import Any
    
    from tempest_fastapi_sdk import BasePaginationFilterSchema
    
    
    class TicketFilterSchema(BasePaginationFilterSchema):
        status: str | None = None
        search: str | None = None
    
    
    def split_conditions(f: TicketFilterSchema) -> tuple[dict[str, Any], str | None]:
        """Separate the column filters from the free-text term."""
        conditions = f.get_conditions()
        search = conditions.pop("search", None)
        return conditions, search
    
  2. Admin: list_filter, search_fields and every Lens' filters are now checked when the AdminModel is built. A wrong name becomes a ValueError at boot (AdminModel lens 'Open' filters on keys Ticket cannot resolve: stauts); fix the name.

  3. Code that wanted "everything" on purpose through a nonexistent key: pass {} (or no key), which still adds no condition. bulk_update keeps refusing an empty mapping.

0.308.0 — the tempest CLI became the [cli] extra

tempest-cli left the base package's dependencies, together with typer and click, and moved to the new [cli] extra (which [all] also includes). tempest-cli requires ruff>=0.8.0 at runtime: in the base, every service adopting the SDK carried a formatter as a production dependency, and a project pinning ruff<0.8 in its dev group could not even resolve its lock (uv lock refused with tempest-cli>=0.4.0 depends on ruff>=0.8.0). The library — import tempest_fastapi_sdk and everything a service imports at runtime — is unchanged.

Who is affected: only whoever runs the tempest command without [cli] or [all]. Without the extra the script is still installed, but it prints the instruction and exits with code 2:

$ tempest --help
error: missing tempest_cli, typer, click. The tempest CLI needs the optional [cli] extra. Install it with:
  uv add --dev "tempest-fastapi-sdk[cli]"   (in a project)
  uv tool install "tempest-fastapi-sdk[cli]"   (as a global command)

What to do

  1. Global CLI (uv tool install tempest-fastapi-sdk): reinstall with the extra.

    uv tool install --force "tempest-fastapi-sdk[cli]"
    
  2. CLI in the project (uv run tempest check, tempest db upgrade in the terminal, in CI): add the extra to the dev group. Projects generated by tempest new from 0.308.0 on already come that way.

    uv add --dev "tempest-fastapi-sdk[cli]"
    
  3. tempest inside the production image (for instance an entrypoint that runs tempest db upgrade before starting the app): the dev group does not enter an image built with uv sync --no-dev, so there the extra goes into the runtime dependencies — "tempest-fastapi-sdk[cli,...]" — or the step switches to alembic upgrade head, which does not need the CLI.

  4. Direct import of tempest_fastapi_sdk.cli.main, .config, .lint or .pr_prompt, or of tempest_fastapi_sdk.cli.app / TempestConfig: without the extra it raises ImportError with the same instruction. Install [cli] wherever that code runs.

If you already install [all], there is nothing to do: [all] brings [cli].

0.306.0 — single-use TOTP codes need the totp_last_step column

MFAMixin gained the totp_last_step column (integer, nullable), where the SDK stores the 30-second step of the last accepted TOTP code so the same code is refused a second time. Since it is mapped on the mixin, migrate the database before upgrading the package: without the column every query on the user model fails — signup and login answer 500 (no such column: <table>.totp_last_step, measured with SQLite). Projects that do not use MFAMixin change nothing.

What to do

  1. Generate the migration (uv run tempest db revision -m "totp last step", or alembic revision --autogenerate) or write it by hand:

    import sqlalchemy as sa
    from alembic import op
    
    revision: str = "0306_totp_last_step"
    down_revision: str | None = "<the previous revision>"
    
    
    def upgrade() -> None:
        """Add the last accepted TOTP step column."""
        op.add_column("users", sa.Column("totp_last_step", sa.Integer(), nullable=True))
    
    
    def downgrade() -> None:
        """Drop the last accepted TOTP step column."""
        op.drop_column("users", "totp_last_step")
    
  2. Run uv run tempest db upgrade (or alembic upgrade head) and only then deploy the new version.

Existing rows stay NULL, which means "no code spent yet": the next valid code is accepted and records its step.

Two behaviour changes come along, with no required step:

  • A TOTP code is worth one acceptance. The code used at confirm no longer works for the first login, nor the login code for an immediate disable: the user waits for the next code in the app (up to 30 seconds). An automated test that reuses pyotp.TOTP(secret).now() after confirm now gets 401; use the next step's code, pyotp.TOTP(secret).at(int(time.time()) + 30).
  • POST /auth/mfa/verify answers 429 after five wrong codes per account in 15 minutes. The default counter lives in the process; with more than one worker, pass make_auth_router(mfa_throttle=AttemptThrottle(redis, ...)) — see Attempt limit.

0.306.0 — make_logs_router refuses an empty secret

make_logs_router(token_secret="") raises ValueError at construction. Up to 0.305.0 an empty secret disabled the X-Token check, and GET /logs and DELETE /logs answered anyone. The service generated by tempest new mounts /logs only when TOKEN_SECRET is not empty.

What to do

  • Service in production: set TOKEN_SECRET (for example with uv run tempest secrets init) in every environment. Without it, the app no longer starts.
  • Service that must start without a secret: mount the router only when there is one, as the template does:

    from fastapi import FastAPI
    
    from tempest_fastapi_sdk import make_logs_router
    
    from src.core.settings import settings
    
    app = FastAPI()
    
    if settings.TOKEN_SECRET.strip():
        app.include_router(
            make_logs_router(
                log_dir=settings.LOG_DIR,
                token_secret=settings.TOKEN_SECRET,
            ),
        )
    
  • Local run that needs /logs open: pass make_logs_router(..., allow_unauthenticated=True).

  • TOKEN_SECRET padded with whitespace: the padding is now stripped before the comparison, so clients send the value without it.

0.306.0 — a download only goes inline for a safe type

as_attachment=False is now a request: DownloadUtils, FileStoreUtils and AsyncMinIOClient.download_response/serve_object only answer Content-Disposition: inline when the response type is in INLINE_SAFE_MEDIA_TYPES. Any other — text/html, image/svg+xml, application/octet-stream — goes out as attachment. Every download response also carries X-Content-Type-Options, Content-Security-Policy and Cross-Origin-Resource-Policy.

accel_redirect_response changes its default to as_attachment=True, and with as_attachment=False only serves inline when media_type= is passed.

build_content_disposition(name, as_attachment=False) with no media_type= returns attachment.

What to do

  • Route that shows an image, PDF, audio or video in the browser: nothing, if the type is on the list. In X-Accel-Redirect mode, pass media_type= (for example guess_media_type(key)), or the file becomes a download.
  • A call to accel_redirect_response that relied on inline by default: pass as_attachment=False and media_type=.
  • Deployment with STORAGE_ACCEL_REDIRECT=true: add proxy_hide_header X-Content-Type-Options; and the three add_header ... always; lines from the storage recipe to nginx's internal location. nginx does not forward the headers the app sets on the empty response.
  • A page that embeds the download in an <iframe> or from another site: the sandbox CSP and same-site CORP apply to it. Pass the value you need in headers= — it replaces the default of the same name.
  • build_content_disposition(..., as_attachment=False) called by hand: pass media_type= with the response type.

0.305.0 — a deactivated account's token no longer authenticates

current_user_dependency() and the authenticated routes of make_auth_router now refuse an account with is_active=False with 403 ACCOUNT_INACTIVE (or AuthExceptions.account_inactive), even while the token is still valid. Up to 0.304.0 a deactivated account kept getting in with the token issued before, for the whole access TTL.

What to do

  • A route that must serve an inactive account (reactivation, data export before closure): build the dependency with current_user_dependency(require_active=False).
  • A client that handles the deactivated account under another code: pass inactive_exception=YourException.
  • A get_user override that only raised 403 for an inactive account: can be removed.

confirm_password_reset with a token whose user no longer exists raised NotFoundException (404). It now raises InvalidTokenException (401 INVALID_TOKEN, or the class in AuthExceptions.invalid_token), as activate and confirm_email_change already did: to the caller it is a link that does not work.

What to do

  • A client that handled 404 on POST /auth/password-reset/confirm: handle it like the expired-link error.
  • Code that builds PasswordPolicyViolation(...) by hand: pass code=PasswordViolationCode.<...>, now required. Callers that only read what check_password_policy returns change nothing.

0.305.0 — signup writes the schema fields that are columns

make_auth_router(signup_schema=...) now sets on the row, before the insert, every field your signup_schema adds on top of SignupSchema that is also a column of the user model (outside SIGNUP_PROTECTED_FIELDS: id, email, hashed_password, is_active, is_admin). Up to 0.304.0 those fields reached the row only if on_signup copied them.

What to do

  • An on_signup that only copied the fields (user.phone = payload.phone): can be removed.
  • A schema field named like a column that you transform before storing (normalizing a phone, say): on_signup still runs afterwards, in the same transaction, and overwrites the value. But uniqueness is checked at the insert, against the raw value — if that matters, normalize in a validator on the schema itself.
  • A schema field named like a column that must not reach the row: rename the field.

0.304.0 — the Google Sheets CSV reader has a limit by default

read_google_sheet and read_google_sheet_as gained max_bytes and max_rows, on by default: an export over 10 MiB (DEFAULT_GOOGLE_CSV_MAX_DOWNLOAD_BYTES) or with more than 100,000 data rows (DEFAULT_XLSX_MAX_ROWS) now raises SpreadsheetTooLargeError (413, SPREADSHEET_TOO_LARGE). Up to 0.303.2 the same tab was read whole, with no ceiling. Details in A tab that is too large.

What changes

  • A tab with 100,001 data rows: it used to return all 100,001; it now raises SpreadsheetTooLargeError with details == {"limit": "rows", "max": 100000, "actual": 100001, "sheet": None, "row": 100002}.
  • An export over 10 MiB: the transfer is closed and the same error is raised with details["limit"] == "download_bytes".
  • A blank row does not count toward max_rows.

What to do

  • A tab you know is large and whose source you trust: raise the limit (max_rows=500_000, max_bytes=50 * 1024 * 1024) or turn it off with max_rows=None / max_bytes=None.
  • An endpoint that lets the exception through: the error is already an AppException with 413; nothing to do if you use the SDK's register_exception_handlers.

0.304.0 — SQLite enforces foreign keys

Every SQLite engine AsyncDatabaseManager and create_test_engine build now runs PRAGMA foreign_keys=ON on each connection. None did before, so SQLite accepted what PostgreSQL refuses: a child pointing at a missing parent, ON DELETE CASCADE deleting nothing, and add_all([child, parent]) with no relationship() sending the child's INSERT first. Details and measurements in Database.

What changes

  • A test that writes a child without its parent fails with IntegrityError: FOREIGN KEY constraint failed. It was a test that passed on SQLite and would fail on PostgreSQL.
  • ON DELETE CASCADE deletes the children on SQLite too.
  • create_test_engine applies the manager's savepoint fix: a begin_nested() that exits cleanly no longer commits the outer transaction.
  • The migration engine stays without FK, and the generated env.py refuses a handed-over connection with FK on — see below.

What to do

  1. Seed the parent in tests. Create the referenced row before the one that references it, and flush() after the parent when the models have no relationship(). Do not turn FK off in the test to make it pass: the defect is the test, not the FK.
  2. Existing SQLite database: look for orphans before upgrading.

    import sqlite3
    
    with sqlite3.connect("app.db") as conn:
        for row in conn.execute("PRAGMA foreign_key_check"):
            print(row)
    

    Each row is (table, rowid, parent table, FK index): the member with id 2 pointing at an organization that does not exist prints ('member', 2, 'org', 0). Measured on SQLite 3.47.1: with FK on, the database opens and reads normally, an UPDATE of another column of the orphan and a DELETE of it pass; what fails is writing a key with no parent (an INSERT, or an UPDATE of the FK column to a missing parent). 3. Need to postpone it? Turn it off on the path you use — ignored on every backend other than SQLite:

    from sqlalchemy.ext.asyncio import AsyncEngine
    
    from tempest_fastapi_sdk import AsyncDatabaseManager
    from tempest_fastapi_sdk.testing import create_test_engine
    
    db: AsyncDatabaseManager = AsyncDatabaseManager(
        "sqlite+aiosqlite:///./app.db",
        sqlite_foreign_keys=False,
    )
    engine: AsyncEngine = create_test_engine(foreign_keys=False)
    

    From the environment: DATABASE_SQLITE_FOREIGN_KEYS=false, read by DatabaseSettings.database_kwargs(). 4. Connection shared with Alembic: if you hand an AsyncDatabaseManager connection to env.py (config.attributes["connection"]), it now arrives with FK on — and batch mode rebuilding the parent table deletes the ON DELETE CASCADE children without an error (measured with Alembic 1.19.1: 3 rows → 0). The env.py already in your repository does not refuse. Migrate on a connection from AsyncDatabaseManager(url, sqlite_foreign_keys=False) and regenerate env.py — step by step in Migrations. AlembicHelper and tempest db ... open their own engine, without FK, and do not change.

0.304.0 — a raw tool error no longer reaches the model

When an agent tool raises an exception that is not an AgentToolError, the model now reads only tool failed: <Type> as the observation. It used to read the exception's whole text — and the HTTPStatusError from raise_for_status() carries the full URL: measured, the observation took ?apikey=s3cr3t to the model, which can repeat what it reads. The trace has kept only the type since 0.300.0; now the conversation does too. Details in Why translate the exception.

What changes

  • The observation of a raw exception was HTTPStatusError: Client error '401 Unauthorized' for url '...?apikey=...' and becomes tool failed: HTTPStatusError.
  • The trace does not change: still HTTPStatusError: the tool failed (details withheld). The log (tempest_fastapi_sdk.agents.agent) still has the whole exception.
  • AgentToolError does not change: its message reaches the model and the trace as written.
  • expose_tool_errors=True now covers both sides: it hands the text to the model and the trace, with the obvious credential shapes masked (?apikey=***, Authorization: Bearer ***, postgresql://admin:***@db).

What to do

  • A tool that relied on the model reading the raw text to correct itself (a 404 that said "does not exist", another library's validation error) translates the failure into an AgentToolError with the sentence the model needs to read.
  • A test that asserted the raw text in the observation now asserts tool failed: <Type> — or turns expose_tool_errors=True on for that agent.
  • To get the text back to the model in development, Agent(..., expose_tool_errors=True). It also writes the text to the trace, which the HTTP router serves: do not turn it on behind an open endpoint.

0.302.0 — a composite constraint carries every column in its name

NAMING_CONVENTION named unique constraints, indexes and foreign keys after the first column only, so UniqueConstraint("title") and UniqueConstraint("title", "release_year") both became uq_books_title. PostgreSQL refuses the CREATE TABLE (relation "uq_books_title" already exists); SQLite accepts both, which is why the defect passed on the test database. The convention now uses every column.

What changes

  • A composite constraint is renamed. A uq, ix or fk over more than one column carries all of them in the name: uq_books_title → uq_books_title_release_year, ix_books_author → ix_books_author_books_title, fk_books_tenant_id_authors → fk_books_tenant_id_author_id_authors.
  • A single-column name does not change, and neither do pk and ck.
  • The SDK itself has two. The model from make_user_oauth_account_model renames uq_<table>_provider → uq_<table>_provider_subject and uq_<table>_user_id → uq_<table>_user_id_provider.
  • The constraint from parse_integrity_error follows the database. After the RENAME, PostgreSQL returns the new name; your own map from constraint name to error code needs the new key.

What to do

alembic revision --autogenerate over an old database proposes drop + create for the composite uniques and indexes and does not see the renamed composite FK (measured against PostgreSQL 16 and Alembic 1.19.1). That drop fails when an FK depends on the unique. The way through is a revision with RENAME:

  1. With every model imported, generate the RENAMEs with legacy_constraint_renames(BaseModel.metadata). Each item is a ConstraintRename(kind, table, schema, columns, old_name, new_name); statement(dialect) writes the SQL and inverse() gives the downgrade() one. A constraint with an explicit name= is left out.

    from sqlalchemy import Index, UniqueConstraint
    from sqlalchemy.dialects import postgresql, sqlite
    from sqlalchemy.orm import Mapped, mapped_column
    
    from tempest_fastapi_sdk import (
        BaseModel,
        ConstraintRename,
        legacy_constraint_renames,
    )
    
    
    class BookModel(BaseModel):
        """Books in the catalogue."""
    
        __tablename__ = "books"
        __table_args__ = (
            UniqueConstraint("isbn"),
            UniqueConstraint("title", "release_year"),
            Index(None, "author", "title"),
        )
    
        isbn: Mapped[str] = mapped_column()
        title: Mapped[str] = mapped_column()
        release_year: Mapped[int] = mapped_column()
        author: Mapped[str] = mapped_column()
    
    
    renames: list[ConstraintRename] = legacy_constraint_renames(BaseModel.metadata)
    for rename in renames:
        print(rename.kind, rename.old_name, "->", rename.new_name)
        print(rename.statement(postgresql.dialect()))
    
    try:
        renames[0].statement(sqlite.dialect())
    except ValueError as exc:
        print(f"ValueError: {exc}")
    

    Output:

    index ix_books_author -> ix_books_author_books_title
    ALTER INDEX ix_books_author RENAME TO ix_books_author_books_title
    unique uq_books_title -> uq_books_title_release_year
    ALTER TABLE books RENAME CONSTRAINT uq_books_title TO uq_books_title_release_year
    ValueError: ConstraintRename.statement supports postgresql, not 'sqlite'; SQLite cannot rename a constraint, so use the batch migration alembic --autogenerate renders
    

    uq_books_isbn, a single-column unique, does not show up: its name did not change.

  2. Paste the statements into an empty revision and run alembic upgrade head before deploying the new version. The step by step, with the full revision and its downgrade(), is in Database → Migrate composite constraints from the old convention.

  3. On SQLite statement() raises ValueError, as in the output above: SQLite cannot rename a constraint, and there the batch migration the autogenerate renders works.

To postpone

Give the composite constraint the name it already has in the database (UniqueConstraint("title", "release_year", name="uq_books_title")): an explicit name beats the convention, and legacy_constraint_renames leaves the constraint out. The old convention is still available as LEGACY_NAMING_CONVENTION.

0.301.0 — CSS, DataTable, forms, SSR and sessions

The release that brought the tempest-bucket admin panel's bridges into the SDK changes behaviour in five areas a service notices. None needs a database migration.

CSS

  • make_css_router and css_response change the default Cache-Control from public, max-age=3600 to no-cache on the unversioned path: the browser revalidates through the ETag (304, no body) before using its copy. For the long cache, link sheet.url(path), which appends ?v=<version> and receives public, max-age=31536000, immutable. If you already passed an explicit cache_control=, nothing changes.
  • The StyleSheet reset gained a font-family on body. A rule of your own that sets the family still wins when it comes after the reset (which is the case for app_stylesheet's extra=).

Details in Typed CSS.

DataTable

The <table> now comes inside <div class="tui-table-scroll">, so a wide table scrolls inside its container instead of widening the page on a phone. A selector of your own that targeted .tui-card__body > table needs to include the wrapper.

Forms

  • A present help_text always wins. {"ui": {"help_text": ""}}, None or False suppress the hint; before, it fell back to the field's description.
  • An UploadFile field no longer renders as <input type="text">: it renders <input type="file">, and the form gains enctype="multipart/form-data".

Details in Forms.

SSR

html_response(page) without title= uses page.document_title() instead of raising ValueError. The error stays for a widget that is not a Page.

Sessions

  • make_session_dependency(...) returns an async dependency. Inside Depends(...) nothing changes; a test that called the resolver directly needs an await.
  • SessionAuth.user_model is type[BaseUserModel] | None. Typed code that reads the attribute has to narrow it.
  • SESSION_COOKIE_SAMESITE is Literal["lax", "strict", "none"]. No value accepted before is refused now; a Settings that overrides the field as str becomes an incompatible override under mypy — override it with the Literal or drop the override.
  • make_session_router's logout deletes the cookie with the settings' attributes, instead of always Secure and HttpOnly.

Details in Sessions.

0.300.0 — the chat attachment records who uploaded it

BaseMessageAttachmentModel gained the uploader_id column (nullable, indexed). Since every concrete attachment table inherits it, migrate the database before upgrading the package: without the column, every chat route that builds a message answers 500 (no such column: message_attachments.uploader_id, measured with SQLite).

What to do

  1. Generate the migration (alembic revision --autogenerate) or write it by hand — one op.add_column(..., sa.Column("uploader_id", sa.Uuid(), nullable=True)) and one op.create_index(...). The full file, with downgrade(), is in the chat recipe.
  2. Run alembic upgrade head, and only then deploy the new version.
  3. Record the upload through ChatService.add_attachment(uploader_id, ...), or pass uploader_id= where you already write the row by hand.

Existing rows keep uploader_id NULL and stay claimable by any sender — the transition window. A new row with an uploader is claimed only by a message from that uploader; anyone else gets the same 404 as for an id that does not exist.

0.300.0 — the other breaking changes: AI, chat, metrics and migrations

The same release closes security and resource defects in the AI modules, and some fixes change the contract. Walk the list and apply what you use; the measured reason for each item is in CHANGELOG.md.

make_ai_chat_router

  • The user_id field left the body — a client that still sends it does not break, the field is ignored. The memory owner now comes from a dependency: make_ai_chat_router(pipeline, current_user_id=...). A pipeline with memory= mounted without current_user_id= raises ValueError at mount time. Complete example in Long-term memory.
  • history with a role other than user/assistant answers 422.

ContentExtractor

  • A private host (intranet, localhost, cloud metadata) is refused with failed=True. To fetch from the intranet, pass allow_private_networks=True.
  • A page above 5 MiB needs a larger max_response_bytes=.
  • HTTPS through an HTTP proxy now fails closed; behind a proxy, use allow_private_networks=True and leave egress control to the proxy.

New limits that answer 422

  • make_genai_router checks GenAIRequestLimits before running the model; pass limits=GenAIRequestLimits(...) if you need more (Per-request limits). POST /image refuses num_images > 1.
  • make_vision_router reads at most 20 MiB and 50 MP per image (max_upload_bytes= / max_image_pixels=).
  • make_chat_router requires page >= 1 and 1 <= page_size <= 100 (max_page_size=), and the chat schemas have length caps.
  • modelops's POST /predict refuses batches above 10 000 rows (max_rows=; None removes the cap).

Agent router

  • The artifact route moved from /runs/{index}/artifacts/{name} to /runs/{run_id}/artifacts/{name}; POST /run returns the run_id.
  • Without owner=, every run is still visible to every caller — pass make_agent_router(agent, owner=...) when there is more than one user (Serving it over HTTP).
  • An unexpected tool error shows in the trace only as its type; Agent(expose_tool_errors=True) restores the full text.
  • A custom backend implementing ChatBackend / ToolCallingBackend gets the messages positionally and no longer has to accept **kwargs.

Chat

  • A caller who cannot see the message gets 404 where it used to get 403. A sender who is still a participant keeps getting 403 for someone else's message.

RAG

  • add and index on the SDK's stores and on HybridRetriever replace by source: pass every chunk of a source in the same call, or its earlier batches are gone.

Metrics

  • genai_requests_total and genai_request_seconds gained the status label (ok / error). A {model, op} selector still matches, but each series becomes two: sum by status or filter status="ok" in queries and alerts that compare the whole series.

modelops

  • /model returns only the file name in path; make_prediction_router(expose_model_path=True) restores the absolute path.
  • [modelops] now installs numpy.

AlembicHelper

  • A sync method that runs env.py, called with an event loop running (the FastAPI lifespan), raises RuntimeError — use the _async pair (await helper.upgrade_async()). The env.py you already have keeps working (migrations recipe).

Other

  • RedisFactStore: a fact written before under subject="" or subject="_" stays under the old {prefix}:_ key, and the new version writes those subjects to another key.
  • The private helper genai/_lifecycle.py moved to utils/_lifecycle.py, with no shim.