We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 45c8efd commit bcff87eCopy full SHA for bcff87e
1 file changed
backend/src/xml-stream-parser.ts
@@ -101,7 +101,10 @@ export async function* processStreamWithTags(
101
}
102
103
const toolName = parsedParams[toolNameParam] as keyof typeof processors
104
- const processor = processors[toolName] ?? defaultProcessor(toolName)
+ const processor =
105
+ typeof toolName === 'string'
106
+ ? processors[toolName] ?? defaultProcessor(toolName)
107
+ : undefined
108
if (!processor) {
109
trackEvent(
110
AnalyticsEvent.UNKNOWN_TOOL_CALL,
@@ -114,6 +117,11 @@ export async function* processStreamWithTags(
114
117
autocompleted,
115
118
},
116
119
)
120
+ onError(
121
+ 'parse_error',
122
+ `Unknown tool ${JSON.stringify(toolName)} for tool call: ${contents}`,
123
+ )
124
+ return
125
126
127
trackEvent(AnalyticsEvent.TOOL_USE, loggerOptions?.userId ?? '', {
0 commit comments