agent: check if a tags file is set before calling loadTagsFile