Document reconnect behavior when onError is omitted

Co-authored-by: Eric Allam <eric@trigger.dev>
This commit is contained in:
Cursor Agent
2026-02-15 03:30:28 +00:00
parent 5307d734ee
commit 69035260fd
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -651,6 +651,7 @@ the transport clears stored run state and future reconnect attempts return `null
If stale inactive reconnect state cannot be cleaned up, reconnect still returns `null` and
the failure is surfaced through `onError` with phase `reconnect`.
Subsequent reconnect calls will retry stale inactive-state cleanup until it succeeds.
If `onError` is omitted, reconnect still returns `null` and continues without callback reporting.
For richer TypeScript ergonomics in app code, `@trigger.dev/ai` also exports:
+2
View File
@@ -151,6 +151,8 @@ both cleanup steps (`set` inactive state and `delete`) even if one of them fails
- If reconnect finds stale inactive state and run-store cleanup fails, `onError` receives a
`"reconnect"` phase event and reconnect still returns `null`.
- If inactive-state cleanup fails, later reconnect calls retry that cleanup until it succeeds.
- If `onError` is not provided, reconnect still returns `null` and continues operating
without surfacing callback events.
- Provide a custom `runStore` if you need state shared across processes/instances.
## `ai.tool(...)` example