Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Fix need to use asyncio for is_alive

Kilian Lieret8e6e1f0773b4
diff --git a/sweagent/agent/agents.py b/sweagent/agent/agents.py
index b95d83d3..b9879d0c 100644
--- a/sweagent/agent/agents.py
+++ b/sweagent/agent/agents.py
@@ -1,5 +1,6 @@
from __future__ import annotations
+import asyncio
import copy
import json
import logging
@@ -716,7 +717,7 @@ class DefaultAgent(AbstractAgent):
step = step.model_copy()
step.done = True
assert self._env is not None
- if not self._env.deployment.is_alive(timeout=10):
+ if not asyncio.run(self._env.deployment.is_alive(timeout=10)):
self.logger.error("Runtime is no longer alive")
try:
last_trajectory_step = self.trajectory[-1]