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]

Web: Catch bug with empty observation

Kilian Lieret7595e2860b82
diff --git a/sweagent/api/hooks.py b/sweagent/api/hooks.py
index 0d4a34dd..87c7b951 100644
--- a/sweagent/api/hooks.py
+++ b/sweagent/api/hooks.py
@@ -114,6 +114,9 @@ class AgentUpdateHook(AgentHook):
type_ = "output"
if self._sub_action == "submit":
type_ = "diff"
+ if obs is None:
+ # This can happen for empty patch submissions
+ obs = ""
msg = obs.strip()
self._wu.up_env(message=msg, thought_idx=self._thought_idx, type_=type_)