change: check call tool result error

This commit is contained in:
lilong.129
2025-05-26 15:30:51 +08:00
parent 5eafcc8a2b
commit 7045a9d452
4 changed files with 19 additions and 22 deletions

View File

@@ -101,9 +101,10 @@ func (dExt *XTDriver) ExecuteAction(action MobileAction) (err error) {
// Check if the tool execution had business logic errors
if result.IsError {
if len(result.Content) > 0 {
return fmt.Errorf("tool execution failed: %s", result.Content[0])
return fmt.Errorf("invoke tool %s failed: %v",
tool.Name(), result.Content)
}
return fmt.Errorf("tool execution failed")
return fmt.Errorf("invoke tool %s failed", tool.Name())
}
log.Debug().Str("method", string(action.Method)).