Document reconnect inactive-cleanup error reporting semantics

Co-authored-by: Eric Allam <eric@trigger.dev>
This commit is contained in:
Cursor Agent
2026-02-15 02:36:30 +00:00
parent 9cf96d932b
commit 87f92e7080
3 changed files with 5 additions and 0 deletions
+2
View File
@@ -648,6 +648,8 @@ class MemoryRunStore implements TriggerChatRunStore {
`reconnectToStream()` only resumes active streams. When a stream completes or errors,
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`.
For richer TypeScript ergonomics in app code, `@trigger.dev/ai` also exports:
+1
View File
@@ -17,3 +17,4 @@
- Added normalization of non-Error throw values into Error instances before `onError` reporting.
- Added best-effort run-store cleanup so cleanup failures do not mask root transport errors.
- Improved best-effort run-store cleanup to attempt both inactive-state writes and deletes even if one step fails.
- Added reconnect cleanup error reporting for stale inactive state while still returning `null`.
+2
View File
@@ -148,6 +148,8 @@ both cleanup steps (`set` inactive state and `delete`) even if one of them fails
- `reconnectToStream({ chatId })` resumes only while a stream is still active.
- Once a stream completes or errors, its run state is cleaned up and reconnect returns `null`.
- If reconnect finds stale inactive state and run-store cleanup fails, `onError` receives a
`"reconnect"` phase event and reconnect still returns `null`.
- Provide a custom `runStore` if you need state shared across processes/instances.
## `ai.tool(...)` example