- Re-raise AgentRepositoryError before the generic except handler so
security error messages are not swallowed (Cursor Bugbot feedback)
- Move module import to top-level to fix mixed import style warning
- Replace unnecessary lambda with MagicMock class reference
- Add noqa for PERF203 on the new except clause
Co-Authored-By: João <joao@crewai.com>