mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(migration): don't auto-archive OpenClaw source directory
Remove auto-archival from hermes claw migrate — not its responsibility (hermes claw cleanup is still there for that). Skip MESSAGING_CWD when it points inside the OpenClaw source directory, which was the actual root cause of agent confusion after migration. Use Path.is_relative_to() for robust path containment check. Salvaged from PR #8192 by opriz. Co-authored-by: opriz <opriz@users.noreply.github.com>
This commit is contained in:
parent
1871227198
commit
36f57dbc51
4 changed files with 54 additions and 165 deletions
|
|
@ -1023,7 +1023,17 @@ class Migrator:
|
|||
.get("workspace")
|
||||
)
|
||||
if isinstance(workspace, str) and workspace.strip():
|
||||
additions["MESSAGING_CWD"] = workspace.strip()
|
||||
ws_path = workspace.strip()
|
||||
# Skip if the workspace points inside the OpenClaw source directory —
|
||||
# that path will be stale after migration and would cause the Hermes
|
||||
# gateway to use the old OpenClaw workspace as its cwd, picking up
|
||||
# OpenClaw's AGENTS.md, MEMORY.md, etc.
|
||||
try:
|
||||
inside_source = Path(ws_path).resolve().is_relative_to(self.source_root.resolve())
|
||||
except (ValueError, OSError):
|
||||
inside_source = False
|
||||
if not inside_source:
|
||||
additions["MESSAGING_CWD"] = ws_path
|
||||
|
||||
allowlist_path = self.source_root / "credentials" / "telegram-default-allowFrom.json"
|
||||
if allowlist_path.exists():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue