You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(bb-agent): treat empty channelId as unset in stream()
6
+
7
+
An empty `channelId` now falls back to `conversationId` or a random UUID, preventing all streams from sharing the same channel. Empty strings are treated as unset rather than used literally.
|`getPendingInterrupts(conversationId)`|`Promise<Array<...>>`| Get unanswered interrupts (for reload support). |
50
50
|`getChannel(channelId)`|`Promise<RealtimeChannel>`| Get a Realtime channel for subscribing to chunks. |
51
51
52
-
`stream()` submits the message to AsyncJob and returns immediately — no API Gateway timeout risk. The agent runs asynchronously and publishes chunks to Realtime.
52
+
`stream()` submits the message to AsyncJob and returns immediately — no API Gateway timeout risk. The agent runs asynchronously and publishes chunks to Realtime. The channel ID is resolved as `options.channelId || options.conversationId || crypto.randomUUID()` — empty strings are treated as unset and fall through to the next value.
53
53
54
54
**Important: Subscribe before sending.** The agent starts emitting chunks immediately after `stream()` is called. If you subscribe to the channel after calling `stream()`, early chunks may be dropped. Always subscribe first, await `established`, then send:
if(!options?.userId&&!this.config.inferenceOnly)throwblocksAgentError(AgentErrors.PersistenceRequired,'userId is required when persistence is enabled. Pass it via options.userId.');
0 commit comments