Updates error handling in case of incorrect tool calling. (#2304)

This commit is contained in:
Vachan
2025-06-27 16:57:40 -07:00
committed by GitHub
parent 150df382f8
commit db115c468a
2 changed files with 71 additions and 1 deletions

View File

@@ -110,10 +110,15 @@ export async function runNonInteractive(
);
if (toolResponse.error) {
const isToolNotFound = toolResponse.error.message.includes(
'not found in registry',
);
console.error(
`Error executing tool ${fc.name}: ${toolResponse.resultDisplay || toolResponse.error.message}`,
);
process.exit(1);
if (!isToolNotFound) {
process.exit(1);
}
}
if (toolResponse.responseParts) {