Skip to content

Commit 5f6e78b

Browse files
Document retry behavior for stale inactive reconnect cleanup
Co-authored-by: Eric Allam <eric@trigger.dev>
1 parent d604b94 commit 5f6e78b

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

docs/tasks/streams.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,7 @@ class MemoryRunStore implements TriggerChatRunStore {
650650
the transport clears stored run state and future reconnect attempts return `null`.
651651
If stale inactive reconnect state cannot be cleaned up, reconnect still returns `null` and
652652
the failure is surfaced through `onError` with phase `reconnect`.
653+
Subsequent reconnect calls will retry stale inactive-state cleanup until it succeeds.
653654

654655
For richer TypeScript ergonomics in app code, `@trigger.dev/ai` also exports:
655656

packages/ai/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@
1818
- Added best-effort run-store cleanup so cleanup failures do not mask root transport errors.
1919
- Improved best-effort run-store cleanup to attempt both inactive-state writes and deletes even if one step fails.
2020
- Added reconnect cleanup error reporting for stale inactive state while still returning `null`.
21+
- Added retry semantics for stale inactive reconnect cleanup on subsequent reconnect attempts.

packages/ai/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ both cleanup steps (`set` inactive state and `delete`) even if one of them fails
150150
- Once a stream completes or errors, its run state is cleaned up and reconnect returns `null`.
151151
- If reconnect finds stale inactive state and run-store cleanup fails, `onError` receives a
152152
`"reconnect"` phase event and reconnect still returns `null`.
153+
- If inactive-state cleanup fails, later reconnect calls retry that cleanup until it succeeds.
153154
- Provide a custom `runStore` if you need state shared across processes/instances.
154155

155156
## `ai.tool(...)` example

0 commit comments

Comments
 (0)