Aegis: Taxonomy and Optimizations for Overcoming Agent-Environment Failures in LLM Agents