Skip to content

Commit cc9f8c6

Browse files
committed
docs(sdk): note the interaction-resume double-call in hydrateMessages jsdoc
1 parent 9f8015e commit cc9f8c6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • packages/trigger-sdk/src/v3

packages/trigger-sdk/src/v3/ai.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5523,6 +5523,13 @@ export type ChatAgentOptions<
55235523
* },
55245524
* });
55255525
* ```
5526+
*
5527+
* Note: on a channel HITL resume turn (a button click that lands on a fresh
5528+
* run whose accumulator doesn't yet hold the pending tool call), this hook is
5529+
* called twice for the one delivery: once with `incomingMessages: []` to load
5530+
* the chain and locate the pending tool call, then again with the synthesized
5531+
* resolution message so it can be persisted. Keep the hook's read path
5532+
* idempotent.
55265533
*/
55275534
hydrateMessages?: (
55285535
event: HydrateMessagesEvent<inferSchemaOut<TClientDataSchema>, TUIMessage>

0 commit comments

Comments
 (0)