coach: close an aborted turn with a persisted cancelled marker

Navigating away mid-reply aborts the SSE fetch; the provider call tears
down, but the conversation was left with the user message dangling and
no trace of the interruption. Persist an empty assistant row tagged
providerType "cancelled" (the refusal/nudge sentinel channel) when the
request signal is aborted, refund stays intact, and the abort is
annotated as insights.coach.cancelled instead of a provider failure or
a GlitchTip defect. Cancelled markers are filtered out of the provider
transcript on later turns. Refs #781
This commit is contained in:
Marc-André Bombeck committed 2026-08-13 06:16:45 +02:00
1 parent 12e5817c16
commit 9a631c8f8b
4 files changed
+300 -6

No files matched your search

+3 -1
View File
@@ -28647,7 +28647,9 @@ components:
anyOf:
- type: string
- type: "null"
description: Provider that produced the reply (e.g. anthropic, openai, local, refusal); null for user turns.
description: Provider that produced the reply (e.g. anthropic, openai, local, refusal). The sentinel `cancelled` marks
an empty assistant row closing a turn the client aborted mid-generation (navigation away); clients should
render it as an interrupted turn with a retry affordance. Null for user turns.
promptVersion:
anyOf:
- type: string