Skip to content

Commit 6903526

Browse files
Document reconnect behavior when onError is omitted
Co-authored-by: Eric Allam <eric@trigger.dev>
1 parent 5307d73 commit 6903526

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

docs/tasks/streams.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,7 @@ 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`.
653653
Subsequent reconnect calls will retry stale inactive-state cleanup until it succeeds.
654+
If `onError` is omitted, reconnect still returns `null` and continues without callback reporting.
654655

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

packages/ai/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ both cleanup steps (`set` inactive state and `delete`) even if one of them fails
151151
- If reconnect finds stale inactive state and run-store cleanup fails, `onError` receives a
152152
`"reconnect"` phase event and reconnect still returns `null`.
153153
- If inactive-state cleanup fails, later reconnect calls retry that cleanup until it succeeds.
154+
- If `onError` is not provided, reconnect still returns `null` and continues operating
155+
without surfacing callback events.
154156
- Provide a custom `runStore` if you need state shared across processes/instances.
155157

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

0 commit comments

Comments
 (0)