Skip to content

Commit 3f40257

Browse files
sjarmakclaude
andcommitted
fix: ensure python3 available in OpenHands containers for MCP auth proxy
The kafka container (eclipse-temurin:17-jdk) has no Python, causing the auth proxy to fail with "Permission denied" when nohup tried to exec the .py file directly. Now auto-installs python3 via apt/apk/yum before starting the proxy. Also adds rerun4 config for 3 remaining tasks (1 no-python fix, 2 Daytona build hang retries). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5d8edf6 commit 3f40257

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

agents/harnesses/openhands/agent.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ async def _configure_mcp(self, environment: BaseEnvironment) -> None:
105105
source_path=proxy_src,
106106
target_path="/tmp/sg_auth_proxy.py",
107107
)
108+
# Ensure python3 is available (Java/Go images may not have it)
109+
ensure_python = (
110+
"command -v python3 >/dev/null 2>&1 || command -v python >/dev/null 2>&1 || { "
111+
"(apt-get update && apt-get install -y --no-install-recommends python3) 2>/dev/null || "
112+
"(apk add --no-cache python3) 2>/dev/null || "
113+
"(yum install -y python3) 2>/dev/null || true; }"
114+
)
115+
await environment.exec(ensure_python)
116+
108117
# Start proxy as background daemon (try python3, fall back to python)
109118
start_cmd = (
110119
f"SG_MCP_URL={mcp_endpoint} "

configs/openhands_mcp_rerun4.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"metadata": {
3+
"name": "openhands_mcp_rerun4",
4+
"description": "3-task rerun: 1 no-python-in-container fix, 2 Daytona build hangs (retry)",
5+
"parent": "openhands_mcp_rerun3.json",
6+
"reason": {
7+
"no_python_in_container": [
8+
"kafka-batch-accumulator-refac-001"
9+
],
10+
"daytona_build_hang_retry": [
11+
"pytorch-relu-gelu-fusion-fix-001",
12+
"terraform-plan-null-unknown-fix-001"
13+
]
14+
}
15+
},
16+
"tasks": [
17+
{
18+
"task_id": "kafka-batch-accumulator-refac-001",
19+
"benchmark": "csb_sdlc_refactor",
20+
"task_dir": "csb_sdlc_refactor/kafka-batch-accumulator-refac-001",
21+
"language": "java",
22+
"execution_env": "daytona"
23+
},
24+
{
25+
"task_id": "pytorch-relu-gelu-fusion-fix-001",
26+
"benchmark": "csb_sdlc_fix",
27+
"task_dir": "csb_sdlc_fix/pytorch-relu-gelu-fusion-fix-001",
28+
"language": "cpp",
29+
"execution_env": "daytona"
30+
},
31+
{
32+
"task_id": "terraform-plan-null-unknown-fix-001",
33+
"benchmark": "csb_sdlc_fix",
34+
"task_dir": "csb_sdlc_fix/terraform-plan-null-unknown-fix-001",
35+
"language": "go",
36+
"execution_env": "daytona"
37+
}
38+
]
39+
}

0 commit comments

Comments
 (0)