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
feat(ai): pass chat context and toolCallId to subtasks, add typed ai.chatContext helpers
- Store chat turn context (chatId, turn, continuation, clientData) in locals for auto-detection
- toolFromTask now auto-detects chat context and passes it to subtask metadata
- Skip serializing messages array (can be large, rarely needed by subtasks)
- Tag subtask runs with toolCallId for dashboard visibility
- Add ai.toolCallId() convenience helper
- Add ai.chatContext<typeof myChat>() with typed clientData inference
- Add ai.chatContextOrThrow<typeof myChat>() that throws if not in a chat context
- Update deepResearch example to use ai.chatContextOrThrow
- Document all helpers in ai-chat guide
|`ai.toolCallId()`|`string \| undefined`| The AI SDK tool call ID |
927
+
|`ai.chatContext<typeof myChat>()`|`{ chatId, turn, continuation, clientData } \| undefined`| Chat context with typed `clientData`. Returns `undefined` if not in a chat context. |
928
+
|`ai.chatContextOrThrow<typeof myChat>()`|`{ chatId, turn, continuation, clientData }`| Same as above but throws if not in a chat context |
929
+
|`ai.currentToolOptions()`|`ToolCallExecutionOptions \| undefined`| Full tool execution options |
0 commit comments