Add AI Features Behind a Transcript Store, Not a Live Call
Описание и применение
Добавление AI‑функций через хранение транскриптов вместо прямых вызовов в запросах повышает надёжность, позволяет откатываться и аудитировать результаты.
Задача
Live AI calls in request paths cause failures and loss of data when the provider errors, making it hard to debug and recover.
Результат
The new design eliminates live call failures by persisting transcripts, enabling retries, auditing, and smoother user experience.
Рабочий процесс
- 1. User triggers AI feature via POST request.
- 2. Handler validates permissions and incident existence.
- 3. Handler creates a transcript row with status 'queued' and stores input payload.
- 4. Background worker picks up queued rows, calls the AI provider, updates status to 'running' and then to 'succeeded' or 'failed' with output payload.
- 5. UI polls the transcript row endpoint to display current status and result.
- 6. On failure, UI shows error and allows retry; transcript remains for incident review.
Доказательства
I opened the API logs, found a 502 from the provider, and discovered nothing durable remained.
The HTTP handler writes a queued transcript, and a worker may fill the output later.
- Дата записи: 2026-09-15T15:45:35.011Z