-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Question
Who should generate the git URL - the runner (coop.py) or the agent adapters?
Current State
How It Works Now
- Runner creates git server:
coop.pycreates the git server usingmini_swe_agent.connectors.create_git_server()when--gitflag is enabled - URL passed to agents: The
git_server_urlis passed to all agent adapters - Agents use provided URL: All adapters (including
openhands_sdk) use the provided URL
Git Server Implementations
There are two different implementations:
-
mini_swe_agent.connectors.git_servers.modal.ModalGitServer- Used by
coop.py(default) - Modal app:
"cooperbench" - Signature:
create(app, run_id, timeout)- noagentsparam - URL format:
git://{hostname}/repo.git
- Used by
-
openhands_agent_sdk.connectors.git_server.ModalGitServer- Used internally by OpenHands adapter (fallback)
- Modal app:
"cooperbench-openhands" - Signature:
create(app, run_id, agents, timeout)- hasagentsparam - URL format:
git://{hostname}/repo.git
Both implementations are functionally equivalent - they create the same git daemon setup.
Current Flow
CLI (--git flag)
↓
coop.py creates git server (mini_swe_agent implementation)
↓
git_server_url passed to all agents
↓
openhands_sdk adapter uses provided URL (doesn't create its own)
Code References
Runner creates git server:
# src/cooperbench/runner/coop.py:65-66
git_server = create_git_server(backend=backend, run_id=run_id, app=app)
git_server_url = git_server.urlOpenHands adapter uses provided URL:
# src/cooperbench/agents/openhands_agent_sdk/adapter.py:326
git_url = git_server_url
# Only creates own if git_server_url is None:
# src/cooperbench/agents/openhands_agent_sdk/adapter.py:351-353
if git_enabled and not git_server_url:
git_url = _get_or_create_git_server(run_id, agents, self.timeout)Architectural Inconsistency
There's an inconsistency in infrastructure management:
- Redis: OpenHands adapter manages its own (
ModalRedisServer) - Git: Runner (
coop.py) manages it, adapter has fallback
The OpenHands adapter README states:
"No external Redis or Git server needed - adapter creates its own"
But in practice, the runner creates the git server, so the adapter's self-management capability isn't used.
Status: ✅ Works Correctly
The current setup works fine:
- Git flag is passed correctly through the chain
coop.pygenerates the git URL- All agents (including
openhands_sdk) use the provided URL - Both implementations are compatible (same URL format)
Potential Improvements (Optional)
If we want consistency with the OpenHands adapter's self-contained design:
-
Option A: Let agents manage their own git servers
- Only create git server in
coop.pyfor agents that need it (e.g.,mini_swe_agent) - Let
openhands_sdkcreate its own (like it does for Redis)
- Only create git server in
-
Option B: Keep current approach
- Runner manages git server for all agents
- Simpler, centralized management
- Works for all agent types
Recommendation
Keep current approach - it works correctly and provides centralized infrastructure management. The OpenHands adapter's self-management capability serves as a useful fallback if needed in the future.
Related Files
src/cooperbench/runner/coop.py- Creates git serversrc/cooperbench/agents/openhands_agent_sdk/adapter.py- Uses provided URLsrc/cooperbench/agents/mini_swe_agent/connectors/git_servers/modal.py- Git server implementation (used by runner)src/cooperbench/agents/openhands_agent_sdk/connectors/git_server.py- Git server implementation (fallback)