From 69035260fd7762180f5872df3c8646c76323a241 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 15 Feb 2026 03:30:28 +0000 Subject: [PATCH] Document reconnect behavior when onError is omitted Co-authored-by: Eric Allam --- docs/tasks/streams.mdx | 1 + packages/ai/README.md | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docs/tasks/streams.mdx b/docs/tasks/streams.mdx index 3160adf30..994a37188 100644 --- a/docs/tasks/streams.mdx +++ b/docs/tasks/streams.mdx @@ -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: diff --git a/packages/ai/README.md b/packages/ai/README.md index 06fc74c3f..a22cb8b94 100644 --- a/packages/ai/README.md +++ b/packages/ai/README.md @@ -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