Skip to content

Commit cd21a94

Browse files
sjarmakclaude
andcommitted
Fix OpenHands jupyter crash: use [sandbox] plugins config (not [core])
The [core] enable_jupyter=false didn't prevent plugin loading. OpenHands reads the sandbox plugins list to decide which plugins to pass to the action_execution_server. Set [sandbox] plugins = ["agent_skills"] (excluding jupyter) and SANDBOX_PLUGINS env var. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b69ef19 commit cd21a94

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

agents/harnesses/openhands/agent.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ def create_run_agent_commands(self, instruction: str):
136136
else:
137137
env.pop("PYTHONPATH", None)
138138
env["PYTHONSAFEPATH"] = "1"
139-
# Core-level env vars control LocalRuntime plugin loading.
140-
# AGENT_ENABLE_JUPYTER only sets the agent config — the runtime
141-
# reads the core-level config to decide whether to start jupyter.
139+
# Disable jupyter at every config level to prevent LocalRuntime
140+
# from starting jupyter-kernelgateway (crashes in Daytona).
141+
env["SANDBOX_PLUGINS"] = "agent_skills" # excludes jupyter plugin
142142
env["ENABLE_JUPYTER"] = "false"
143143
env["ENABLE_BROWSING"] = "false"
144144
env["AGENT_ENABLE_JUPYTER"] = "false"
@@ -299,14 +299,18 @@ def _build_workspace_guidance(self, workdir: str) -> str:
299299

300300
def _build_config_toml(self, mcp_url: str | None = None) -> str:
301301
lines = [
302-
# Core-level settings control plugin loading in LocalRuntime.
303-
# Without [core], enable_jupyter under [agent] is ignored and
304-
# the jupyter-kernelgateway plugin starts, fails to bind, and
305-
# crashes with tenacity.RetryError in _wait_until_alive.
306302
"[core]",
307303
"enable_jupyter = false",
308304
"enable_browsing = false",
309305
"",
306+
# The sandbox plugins list controls what LocalRuntime passes to
307+
# --plugins on the action_execution_server command line. The
308+
# default is ["agent_skills", "jupyter"]. Excluding "jupyter"
309+
# prevents the jupyter-kernelgateway from starting — it cannot
310+
# bind inside Daytona sandboxes and crashes with RetryError.
311+
"[sandbox]",
312+
'plugins = ["agent_skills"]',
313+
"",
310314
"[agent]",
311315
f"enable_mcp = {'true' if mcp_url else 'false'}",
312316
"enable_jupyter = false",

0 commit comments

Comments
 (0)