File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
packages/core/src/codewhispererChat/controllers/chat/messenger Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,14 @@ export class Messenger {
272272 toolUse . toolUseId = cwChatEvent . toolUseEvent . toolUseId ?? ''
273273 toolUse . name = cwChatEvent . toolUseEvent . name ?? ''
274274 try {
275- toolUse . input = JSON . parse ( toolUseInput )
275+ try {
276+ toolUse . input = JSON . parse ( toolUseInput )
277+ } catch ( error : any ) {
278+ getLogger ( ) . error ( `JSON parse error for toolUseInput: ${ error } ` )
279+ // set toolUse.input to the raw value
280+ toolUse . input = toolUseInput
281+ error . message = `Tool input has invalid JSON format: ${ error . message } `
282+ }
276283 const availableToolsNames = ( session . pairProgrammingModeOn ? tools : noWriteTools ) . map (
277284 ( item ) => item . toolSpecification ?. name
278285 )
You can’t perform that action at this time.
0 commit comments