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]

Tweaks to use swe-agent web UI from docker (#423)

Kilian Lieretb62510534c8e
diff --git a/Dockerfile b/Dockerfile
index 3c11c739..fbebfa36 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -18,4 +18,7 @@ RUN curl -fsSL https://get.docker.com -o get-docker.sh && \
COPY . /app
# Install Python dependencies
-RUN pip install .
+RUN pip install -e '.'
+
+# Install react dependencies ahead of time
+RUN cd sweagent/frontend && npm install
diff --git a/start_web_ui.sh b/start_web_ui.sh
index 1350dac3..356e8603 100755
--- a/start_web_ui.sh
+++ b/start_web_ui.sh
@@ -33,4 +33,7 @@ echo " web_api.log for error messages!"
cd ../../
trap print_log ERR
-python sweagent/api/server.py > web_api.log 2>&1
+python sweagent/api/server.py > web_api.log 2>&1 &
+
+wait -n
+exit $?
diff --git a/sweagent/api/server.py b/sweagent/api/server.py
index c8bfdb32..cdc46b94 100644
--- a/sweagent/api/server.py
+++ b/sweagent/api/server.py
@@ -209,4 +209,4 @@ def _build_cors_preflight_response():
if __name__ == "__main__":
app.debug = True
- socketio.run(app, port=8000, debug=True)
+ socketio.run(app, port=8000, debug=True, allow_unsafe_werkzeug=True)