Skip to content

AI 0.19.1: A request with a missing prompt no longer causes a 500

AI 0.19.1 fixes a crash: logging an AI request that pointed at a prompt that no longer existed raised a database error and answered with a 500, instead of returning an ordinary changeset error.

The request now declares the prompt’s foreign key under both names it can have in the database. Core’s migrations create it under two names on a fresh database and one on an older one, and the check matches whichever exists.

The endpoint form’s inputs also move to daisyUI 5’s field classes. The release builds against PhoenixKit 2.4.0, and the minimum stays at 2.0.

Full release notes: AI 0.19.1

0.19.1 · 14 August 2026

Fixed

  • A request referencing a missing prompt returned a 500 instead of a changeset error. Request.changeset/2 declared no foreign_key_constraint for prompt_uuid at all, so the violation escaped as a raw Ecto.ConstraintError. It now declares both names the constraint can carry: core’s v135 adds this foreign key twice under two names, each block guarded only by its own, so a freshly migrated database has both while an older one has only phoenix_kit_ai_requests_prompt_uuid_fkey. Ecto matches by name and Postgres reports one conname, so the name that exists matches and the other is inert — and this stays correct now that core 2.4.0’s V169 converges the pair on the legacy name (#21, #19).

  • Three tests had been asserting behaviour this package no longer has, and had been failing since 0.15.0/0.16.0 without blocking a release: speak/3’s response shape gained :timestamps in 0.16.0; TTS cost_cents stopped being nil in 0.15.0 when it began being estimated from TtsPricing; and the image-generation override test asked a stored quality default to disappear because size was overridden, which the code never did and never should. Nothing runs mix test automatically here — neither precommit nor CI on push — which is why they sat red.

Changed

  • Minimum phoenix_kit is unchanged at ~> 2.0; the lockfile moves to 2.4.0.

AI 0.19.1. Install or update: {:phoenix_kit_ai, "~> 0.19"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.