Closed
Description
Feature Description
When iterating through TextStreamPart(s) and handling parts of type "error", I'd expect access to the toolCallId or the toolName from within the error chunk. Since those are not being passed down to the errors at:
run-tools-transformation.ts#L86-L202
Use Case
Simply to pass the toolCallId and toolName to a new message "tool-result" with isError set to true.
{
type: 'tool-result',
isError: true,
toolCallId: error.toolCallId,
toolName: error.toolName,
result: part.error,
}
Additional context
If this makes sense for you, I am willing to help with the code edits.
Question:
Is chunk.toolName and chunk.toolCallId guaranteed in the context of the lines I highlighted?
If chunk has those attributes, can't we just wrap everything in a big try/catch with a generic ToolError? Or is that too stupid?