From cff29fa7fdeb92a7e52530479a5fbf3cb3ec4689 Mon Sep 17 00:00:00 2001 From: Teknium Date: Tue, 28 Apr 2026 00:39:00 -0700 Subject: [PATCH] chore(migration): reuse existing load_openclaw_config() helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drop the duplicate _load_openclaw_config_early() added in the salvaged commit — load_openclaw_config() (line 979) has the identical body and is a plain instance method that only needs self.source_root, which is already set before __init__ needs it. --- .../scripts/openclaw_to_hermes.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/optional-skills/migration/openclaw-migration/scripts/openclaw_to_hermes.py b/optional-skills/migration/openclaw-migration/scripts/openclaw_to_hermes.py index b7beefcd47..5a8c5901ed 100644 --- a/optional-skills/migration/openclaw-migration/scripts/openclaw_to_hermes.py +++ b/optional-skills/migration/openclaw-migration/scripts/openclaw_to_hermes.py @@ -625,7 +625,7 @@ class Migrator: # default ~/.openclaw/workspace/. Reading agents.defaults.workspace # lets source_candidate() find files in the actual workspace. self._custom_workspace: Optional[Path] = None - oc_config = self._load_openclaw_config_early() + oc_config = self.load_openclaw_config() ws = (oc_config.get("agents", {}).get("defaults", {}).get("workspace") or "").strip() if ws: ws_path = Path(ws).expanduser().resolve() @@ -651,18 +651,6 @@ class Migrator: + ", ".join(sorted(SKILL_CONFLICT_MODES)) ) - def _load_openclaw_config_early(self) -> Dict[str, Any]: - """Load openclaw.json during __init__ (before migrate() is called).""" - for name in ("openclaw.json", "clawdbot.json", "moltbot.json"): - config_path = self.source_root / name - if config_path.exists(): - try: - data = json.loads(config_path.read_text(encoding="utf-8")) - return data if isinstance(data, dict) else {} - except json.JSONDecodeError: - continue - return {} - def is_selected(self, option_id: str) -> bool: return option_id in self.selected_options