Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

OpenClaw 2026.10.1: define the CI agent under keyed agents.entries (#13266)

Daniel Hanbeb556e908b5
diff --git a/.github/scripts/agent-guides-drive.sh b/.github/scripts/agent-guides-drive.sh
index adb73d50cc1..45159341d64 100755
--- a/.github/scripts/agent-guides-drive.sh
+++ b/.github/scripts/agent-guides-drive.sh
@@ -448,12 +448,31 @@ p = sys.argv[2]
cfg = json.load(open(p)) if os.path.exists(p) else {}
agents = cfg.setdefault("agents", {})
agents.setdefault("defaults", {})["skipBootstrap"] = True
-lst = [a for a in agents.get("list", []) if a.get("id") != "ci"]
-agent = {"id": "ci", "contextInjection": "never"}
+# OpenClaw 2026.10.1 rejects the legacy agents.list array ("agents.list moved to
+# keyed agents.entries") and refuses to start. Keyed entries are read since at least
+# 2026.8.1, so always define the ci agent under agents.entries.
+entries = agents.get("entries")
+entries = dict(entries) if isinstance(entries, dict) else {}
+# `unsloth start` never writes agents.list, and a fresh managed dir has none; migrating one
+# correctly is OpenClaw Doctor's job, so refuse rather than half-migrate it here.
+if "list" in agents:
+ sys.exit("[openclaw] unexpected legacy agents.list in the config unsloth start wrote; "
+ "run `openclaw doctor --fix` on it")
+owner = None
+for key, entry in entries.items():
+ if isinstance(entry, dict) and entry.pop("default", None) is True and owner is None:
+ owner = key
+agent = {"contextInjection": "never"}
if mode == "notools":
agent["tools"] = {"deny": ["*"]}
-lst.append(agent)
-agents["list"] = lst
+entries["ci"] = agent
+agents["entries"] = entries
+# More than one agent needs explicit ownership (the retired default marker is rejected).
+if len(entries) > 1:
+ owner = owner or next(k for k in entries if k != "ci")
+ agents.setdefault("ownership", "explicit")
+ agents["defaults"].setdefault("systemAgent", {}).setdefault("agentId", owner)
+ agents["defaults"].setdefault("heartbeat", {}).setdefault("agentId", owner)
with open(p, "w") as fh:
json.dump(cfg, fh, indent=2)
print(f"[openclaw] agent ci tools = {agent.get('tools', 'default')}")
diff --git a/unsloth_cli/commands/start.py b/unsloth_cli/commands/start.py
index 79dee783d2c..e3cd495f7ad 100644
--- a/unsloth_cli/commands/start.py
+++ b/unsloth_cli/commands/start.py
@@ -4708,6 +4708,19 @@ def _openclaw_provider(
}
+def _openclaw_doctor_command(path: Path, *, windows: bool) -> str:
+ """`openclaw doctor --fix` against Unsloth's managed config, in the user's shell syntax."""
+ env = {"OPENCLAW_CONFIG_PATH": str(path), "OPENCLAW_STATE_DIR": str(path.parent)}
+ if windows:
+ sets = "; ".join(
+ f'$env:{name} = "{value.replace("`", "``").replace(chr(34), "`" + chr(34)).replace("$", "`$")}"'
+ for name, value in env.items()
+ )
+ return f"{sets}; openclaw doctor --fix"
+ inline = " ".join(f"{name}={shlex.quote(value)}" for name, value in env.items())
+ return f"{inline} openclaw doctor --fix"
+
+
def write_openclaw_config(
base: str,
key: str,
@@ -4768,12 +4781,24 @@ def write_openclaw_config(
workspace_path = str(workspace)
defaults["workspace"] = workspace_path
# Per-agent paths override agents.defaults.workspace and OPENCLAW_STATE_DIR. This config is itself an isolated Unsloth copy, so remove stale explicit paths and let OpenClaw resolve every listed agent beneath the managed defaults/state directory.
+ # OpenClaw 2026.10.1 keys agents by id under agents.entries; older configs carry an agents.list array.
agent_list = agents.get("list")
+ agent_entries = agents.get("entries")
+ listed = list(agent_list) if isinstance(agent_list, list) else []
+ if isinstance(agent_entries, dict):
+ listed += list(agent_entries.values())
+ for agent_config in listed:
+ if isinstance(agent_config, dict):
+ agent_config.pop("workspace", None)
+ agent_config.pop("agentDir", None)
if isinstance(agent_list, list):
- for agent_config in agent_list:
- if isinstance(agent_config, dict):
- agent_config.pop("workspace", None)
- agent_config.pop("agentDir", None)
+ # 2026.10.1 rejects agents.list. Converting it (id normalization, ownership, channel bindings,
+ # workspace pins) is OpenClaw's own migration, so point at it rather than half-reimplement it.
+ typer.echo(
+ f"Note: {path} still has the legacy agents.list, which OpenClaw 2026.10.1+ rejects. "
+ f"Migrate it with: {_openclaw_doctor_command(path, windows = os.name == 'nt')}",
+ err = True,
+ )
# Unauthenticated loopback gateway: without auth.mode=none the client will not open the websocket. The daemon must still be started separately (`openclaw gateway`).
gateway = _subdict(config, "gateway")
gateway.setdefault("mode", "local")
diff --git a/unsloth_cli/tests/test_start.py b/unsloth_cli/tests/test_start.py
index 59498cad6ba..4e27bc8f761 100644
--- a/unsloth_cli/tests/test_start.py
+++ b/unsloth_cli/tests/test_start.py
@@ -5417,6 +5417,63 @@ def test_write_openclaw_config_clears_per_agent_path_overrides(tmp_path):
]
+def test_write_openclaw_config_points_a_legacy_agent_list_at_openclaw_doctor(tmp_path, capsys):
+ path = tmp_path / "openclaw.json"
+ path.write_text(json.dumps({"agents": {"list": [{"id": "main"}]}}))
+
+ start.write_openclaw_config(BASE, "sk-unsloth-abc", MODEL, path)
+
+ captured = capsys.readouterr()
+ # stderr, so the copy-paste launch recipe on stdout stays clean.
+ assert "legacy agents.list" in captured.err
+ assert "openclaw doctor --fix" in captured.err
+ assert "legacy agents.list" not in captured.out
+
+
+def test_openclaw_doctor_command_matches_the_shell(tmp_path):
+ path = tmp_path / "with space" / "openclaw.json"
+ posix = start._openclaw_doctor_command(path, windows = False)
+ assert posix.startswith("OPENCLAW_CONFIG_PATH=")
+ assert shlex.split(posix)[:2] == [
+ f"OPENCLAW_CONFIG_PATH={path}",
+ f"OPENCLAW_STATE_DIR={path.parent}",
+ ]
+ assert posix.endswith(" openclaw doctor --fix")
+ windows = start._openclaw_doctor_command(path, windows = True)
+ assert windows.startswith(f'$env:OPENCLAW_CONFIG_PATH = "{path}"; ')
+ assert f'$env:OPENCLAW_STATE_DIR = "{path.parent}"; openclaw doctor --fix' in windows
+ assert "OPENCLAW_CONFIG_PATH=" not in windows
+
+
+def test_write_openclaw_config_clears_per_agent_path_overrides_in_keyed_entries(tmp_path):
+ # OpenClaw 2026.10.1 moved agents.list to agents.entries keyed by agent id.
+ path = tmp_path / "openclaw.json"
+ path.write_text(
+ json.dumps(
+ {
+ "agents": {
+ "defaults": {"workspace": "/old/default"},
+ "entries": {
+ "main": {
+ "workspace": "/old/main-workspace",
+ "agentDir": "/old/main-agent",
+ "model": "keep/me",
+ },
+ "reviewer": {"workspace": "/old/reviewer-workspace"},
+ },
+ }
+ }
+ )
+ )
+
+ start.write_openclaw_config(BASE, "sk-unsloth-abc", MODEL, path)
+
+ agents = json.loads(path.read_text())["agents"]
+ assert agents["defaults"]["workspace"] == str(tmp_path / "workspace")
+ assert agents["entries"] == {"main": {"model": "keep/me"}, "reviewer": {}}
+ assert "list" not in agents
+
+
def test_write_openclaw_config_preserves_and_idempotent(tmp_path):
path = tmp_path / "openclaw.json"
path.write_text(