Skip to content

Commit aab79a0

Browse files
Document dual-step best-effort run-store cleanup behavior
Co-authored-by: Eric Allam <eric@trigger.dev>
1 parent 43205f7 commit aab79a0

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

docs/tasks/streams.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,8 @@ optional `runId`, and the underlying `error` (non-Error throws are normalized to
623623
instances).
624624

625625
Run-store cleanup is handled as best effort, and cleanup failures won't mask the original
626-
transport failure that triggered `onError`.
626+
transport failure that triggered `onError`. Cleanup still attempts both persistence steps
627+
(`set` inactive state and `delete`) even when one step fails.
627628

628629
```ts
629630
import type { TriggerChatRunState, TriggerChatRunStore } from "@trigger.dev/ai";

packages/ai/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
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.
1818
- Added best-effort run-store cleanup so cleanup failures do not mask root transport errors.
19+
- Improved best-effort run-store cleanup to attempt both inactive-state writes and deletes even if one step fails.

packages/ai/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ The callback receives:
141141
- `error`
142142

143143
Cleanup operations against custom `runStore` implementations are best-effort. If store cleanup
144-
fails, the original transport error is still preserved and surfaced.
144+
fails, the original transport error is still preserved and surfaced. The transport also attempts
145+
both cleanup steps (`set` inactive state and `delete`) even if one of them fails.
145146

146147
## Reconnect semantics
147148

0 commit comments

Comments
 (0)