Available agents
CooperBench includes the following built-in agents:- mini_swe_agent (default) - Lightweight SWE-agent implementation
- mini_swe_agent_v2 - Enhanced version with improved tooling
- swe_agent - Full SWE-agent framework
- openhands_sdk - OpenHands agent SDK
Using agents
Specify agent in run()
List available agents
Agent interface
All agents implement theAgentRunner protocol:
AgentResult structure
Creating custom agents
Basic custom agent
Use custom agent
Register external agents
You can also register agents via environment variable:Agent configuration
Pass agent-specific config
You can pass additional configuration to agents:Use config file
For complex configurations, use a config file:Agent task specification
Thetask parameter passed to agents contains:
Working with agent results
Access agent logs
Extract patches
Advanced agent features
Cooperative mode features
When running in cooperative mode (setting="coop"), agents have access to:
Messaging
Agents can send messages to each other:Git collaboration
Whengit_enabled=True, agents can:
- Push changes:
git push origin feature-branch - Pull updates:
git pull origin feature-branch - Merge branches:
git merge other-branch - View history:
git log
Environment access
Agents run in Docker containers with:- Full repository access
- Python/Node.js/etc. runtime
- Git (if enabled)
- Redis client (if messaging enabled)
Best practices
Choose the right agent
- mini_swe_agent: Fast, lightweight, good for most tasks
- mini_swe_agent_v2: Enhanced tooling, better for complex tasks
- swe_agent: Full-featured, best for maximum capability
- openhands_sdk: Alternative framework with different strengths
Optimize costs
Debug agent issues
Related functions
- run() - Execute tasks with agents
- list_agents() - List available agents
- get_runner() - Get agent instance