File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,7 +141,10 @@ function extractSideQuestionResponse(messages: Message[]): string | null {
141141 // No text — check if the model tried to call a tool despite instructions.
142142 const toolUse = assistantBlocks . find ( b => b . type === 'tool_use' )
143143 if ( toolUse ) {
144- const toolName = 'name' in toolUse ? ( toolUse as any ) . name : 'a tool'
144+ const toolName =
145+ 'name' in toolUse
146+ ? ( toolUse as unknown as { name : string } ) . name
147+ : 'a tool'
145148 return `(The model tried to call ${ toolName } instead of answering directly. Try rephrasing or ask in the main conversation.)`
146149 }
147150 }
@@ -153,7 +156,7 @@ function extractSideQuestionResponse(messages: Message[]): string | null {
153156 m . type === 'system' && 'subtype' in m && m . subtype === 'api_error' ,
154157 )
155158 if ( apiErr ) {
156- return `(API error: ${ formatAPIError ( apiErr . error as any ) } )`
159+ return `(API error: ${ formatAPIError ( apiErr . error as Parameters < typeof formatAPIError > [ 0 ] ) } )`
157160 }
158161
159162 return null
You can’t perform that action at this time.
0 commit comments