I don't understand the problem.  Should I just delete this whole function (parse_agent_config)?