Skip to content

fix: install.ps1 writes Hermes config template to the wrong location - #2211

Open
asorry75 wants to merge 2 commits into
MemTensor:mainfrom
asorry75:fix/install-ps1-hermes-runtime-home
Open

fix: install.ps1 writes Hermes config template to the wrong location#2211
asorry75 wants to merge 2 commits into
MemTensor:mainfrom
asorry75:fix/install-ps1-hermes-runtime-home

Conversation

@asorry75

@asorry75 asorry75 commented Aug 5, 2026

Copy link
Copy Markdown

Summary

On a fresh Windows install, the Hermes branch of install.ps1 writes the template config.yaml to the wrong location:

$HomeDir = $Prefix   # %LOCALAPPDATA%\hermes\memos-plugin (code dir)

The daemon reads its runtime config from ~/.hermes/memos-plugin (resolved from Path.home() in bridge_client.py / the bridge), so right after installation the log shows:

config file not found at ~/.hermes/memos-plugin/config.yaml; using defaults

Result: the LLM summarizer and skill-evolution stay disabled on Windows even though the install reported success. Local embedding still works, which makes the failure easy to miss.

Changes

Use the same split as the OpenClaw branch (which already sets $HomeDir = ~/.openclaw\memos-plugin):

$HomeDir = Join-Path $env:USERPROFILE ".hermes\memos-plugin"

Test

  • Verified on Windows: after install, the daemon now finds the template config at the runtime home; LLM summarizer / skill-evolution become available.
  • The fix is one line and mirrors the existing OpenClaw branch, so behavior for OpenClaw and non-Windows installs is unchanged.

Related to #2221 (systemic Hermes home resolution on Windows).


Note (2026-08-05): #2224 (systemic fix for #2221) covers runtime path resolution; install.ps1 is outside its scope, so this PR addresses the install-script half of the same bug family.

Install-Hermes sets $HomeDir = $Prefix (%LOCALAPPDATA%\hermes\memos-plugin),
but the daemon reads its runtime config from ~/.hermes/memos-plugin
(Path.home() based). The template config.yaml therefore lands where the
daemon never looks: after a fresh install on Windows the LLM summarizer
and skill-evolution stay disabled ("config file not found ... using
defaults").

Align with the OpenClaw branch which already splits the runtime home:
use ~/.hermes\memos-plugin for Hermes.
@Memtensor-AI Memtensor-AI added area:plugin OpenClaw & Hermes status:in-progress Someone or AI is working on it | 人工或 AI 正在处理 labels Aug 5, 2026
@Memtensor-AI

Memtensor-AI commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

🤖 Open Code Review

Target: PR #2211
Task: 03152aa29959c320
Base: main
Head: fix/install-ps1-hermes-runtime-home

🔍 OpenCodeReview found 1 issue(s) in this PR.


1. apps/memos-local-plugin/install.ps1 (L405)

This changes the runtime home directory from %LOCALAPPDATA%\hermes\memos-plugin to %USERPROFILE%\.hermes\memos-plugin. For existing installations, user data under the old path (config.yaml, data/, skills/, logs/) will be silently abandoned — Ensure-RuntimeHome will start fresh in the new location without migrating or even warning about the old one. Consider adding a migration block that detects and moves the old directory, or at minimum emits a warning pointing users to the old path.

💡 Suggested Change

Before:

    $HomeDir = Join-Path $env:USERPROFILE ".hermes\memos-plugin"

After:

    $HomeDir = Join-Path $env:USERPROFILE ".hermes\memos-plugin"
    $LegacyHomeDir = Join-Path $env:LOCALAPPDATA "hermes\memos-plugin"
    if ((Test-Path $LegacyHomeDir) -and -not (Test-Path $HomeDir)) {
        Write-Info "Migrating runtime home from $LegacyHomeDir to $HomeDir"
        Move-Item -Path $LegacyHomeDir -Destination $HomeDir -Force
    } elseif (Test-Path $LegacyHomeDir) {
        Write-Warn "Legacy runtime home detected at $LegacyHomeDir — it is no longer used. You may remove it manually."
    }

Generated by cloud-assistant via Open Code Review.

@asorry75

asorry75 commented Aug 5, 2026

Copy link
Copy Markdown
Author

Thanks for the review. A few clarifications from the reporter side:

1. This is not a path change — the path was wrong from day one for new installs.

We hit this as a brand-new user (first install, no legacy data): after a clean Windows install, the daemon logs config file not found at ~/.hermes/memos-plugin/config.yaml; using defaults, and the LLM summarizer / skill-evolution stay disabled. There was nothing to migrate — the template config was simply written to the wrong directory from the start.

The OpenClaw branch already sets $HomeDir = ~/.openclaw\memos-plugin (line 238); the Hermes branch at line 405 uses $HomeDir = $Prefix, which collides the runtime home with the code directory. That is the bug — $HomeDir should always have pointed at the runtime home.

2. Same root cause, second manifestation: #2210

The native-memory import path (server/routes/import-export.ts) has the same wrong assumption: it hardcodes ~/.hermes instead of resolving the actual Hermes home (HERMES_HOME / %LOCALAPPDATA%\hermes on Windows). So on a fresh Windows install, both the install-time config placement and the import feature point at a directory that doesn't exist. PR #2210 fixes the import side; this PR fixes the install side.

3. Migration for existing users — agreed, and which approach do you prefer?

Existing installs may have runtime data under the old (wrong) location, possibly mixed with the code. Options:

  • (a) migrate only runtime data subdirs (config.yaml, data/, logs/, skills/) to the new home
  • (b) move the whole old directory contents (but it also contains code / node_modules)
  • (c) create a directory junction from the old location to the new one for backward compatibility

Happy to implement whichever fits this repo best.

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

⚠️ Automated Test Results: ENV ISSUE

The test environment encountered an issue that requires manual attention.

Details: Contract test phase exited with code 4 without running any tests (0 passed, 0 failed), indicating a pytest collection or infrastructure failure unrelated to the diff. [advisory, non-gating] AI-generated tests on branch test/auto-gen-74b9f622a6463748-20260805130806: 27/27 passed — these do NOT affect the PR verdict; review the branch manually.
Branch: fix/install-ps1-hermes-runtime-home

Memtensor-AI pushed a commit to Memtensor-AI/MemOS that referenced this pull request Aug 5, 2026
…r#2221)

The memos-local-plugin resolved the Hermes home as ~/.hermes in several
places, while Hermes itself uses %LOCALAPPDATA%\hermes on Windows
(HERMES_HOME). The plugin's runtime data, PID files, and native import
sources therefore landed outside Hermes' real home on Windows: install
config never reached the daemon (MemTensor#2211), native memory import missed
MEMORY.md (MemTensor#2210), hermes backup could skip plugin state, and host and
plugin tooling disagreed on where the data lived.

Add a single canonical Hermes-home resolver on each language side that
mirrors Hermes' own _get_platform_default_hermes_home:

  - Python: adapters/hermes/memos_provider/hermes_home.py
  - TypeScript: core/config/hermes-home.ts

Resolution: HERMES_HOME env -> %LOCALAPPDATA%\hermes on win32 (with
~/AppData/Local/hermes fallback) -> ~/.hermes elsewhere. All hard-coded
sites now route through it: the Python provider fallback +
child-session lookup, the bridge_client runtime home, both
bridge.cts/bridge.mts pidFilePath resolvers, core/config/paths.ts
resolveHome (hermes default), and the migrate + import-export server
routes.

Non-Hermes agents (openclaw, custom) keep the ~/.<agent>/memos-plugin
convention. MEMOS_HOME / MEMOS_CONFIG_FILE still win over HERMES_HOME.

Tests: added tests/python/test_hermes_home.py (8 tests) and
tests/unit/config/hermes-home.test.ts (6 tests) covering all four
resolver branches plus the Python provider / bridge_client
integration paths. Extended tests/unit/config/paths.test.ts with a
resolveHome("hermes") + HERMES_HOME regression assertion. Full Python
suite (109) and full vitest suite (1274) pass; tsc --noEmit clean.
@Memtensor-AI

Copy link
Copy Markdown
Collaborator

⚠️ Automated Test Results: ENV ISSUE

The test environment encountered an issue that requires manual attention.

Details: Contract test phase exited with code 4 without running any tests (0 passed, 0 failed), indicating a test collection or infrastructure failure rather than an actual test failure related to the diff.
Branch: fix/install-ps1-hermes-runtime-home

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:plugin OpenClaw & Hermes status:in-progress Someone or AI is working on it | 人工或 AI 正在处理

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants