innercontext/backend/alembic
Piotr Oleszczyk 092fd87606 fix(llm): log and handle non-STOP finish_reason from Gemini
When Gemini stops generation early (e.g. due to safety filters or
thinking-model quirks), finish_reason != STOP but no exception is raised,
causing the caller to receive truncated JSON and a confusing 502 "invalid
JSON" error. Now:
- finish_reason is extracted from candidates[0] and stored in ai_call_logs
- any non-STOP finish_reason raises HTTP 502 with a clear message
- Alembic migration adds the finish_reason column to ai_call_logs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 20:08:22 +01:00
..
versions fix(llm): log and handle non-STOP finish_reason from Gemini 2026-03-01 20:08:22 +01:00
env.py fix(backend): apply black/isort formatting and fix ruff noqa annotations 2026-03-01 17:27:07 +01:00
README feat(backend): add Alembic migrations 2026-02-28 20:14:57 +01:00
script.py.mako feat(backend): add Alembic migrations 2026-02-28 20:14:57 +01:00

Generic single-database configuration.