Skip to content

Commit b912e4f

Browse files
Document best-effort run-store cleanup error semantics
Co-authored-by: Eric Allam <eric@trigger.dev>
1 parent 382577f commit b912e4f

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

docs/tasks/streams.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,9 @@ The default payload sent to your task is a rich, typed object that includes:
622622
optional `runId`, and the underlying `error` (non-Error throws are normalized to `Error`
623623
instances).
624624

625+
Run-store cleanup is handled as best effort, and cleanup failures won't mask the original
626+
transport failure that triggered `onError`.
627+
625628
```ts
626629
import type { TriggerChatRunState, TriggerChatRunStore } from "@trigger.dev/ai";
627630

packages/ai/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
- Added optional `onError` callback support for observing non-fatal transport issues.
1616
- Added phase-aware `onError` reporting across send, stream-subscribe, reconnect, and stream-consumption paths.
1717
- Added normalization of non-Error throw values into Error instances before `onError` reporting.
18+
- Added best-effort run-store cleanup so cleanup failures do not mask root transport errors.

packages/ai/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ The callback receives:
140140
- `runId` (may be `undefined` before a run is created)
141141
- `error`
142142

143+
Cleanup operations against custom `runStore` implementations are best-effort. If store cleanup
144+
fails, the original transport error is still preserved and surfaced.
145+
143146
## Reconnect semantics
144147

145148
- `reconnectToStream({ chatId })` resumes only while a stream is still active.

0 commit comments

Comments
 (0)