Skip to content

feat: offer OpenClaw migration during setup#846

Closed
kshitijk4poor wants to merge 6 commits intoNousResearch:mainfrom
kshitijk4poor:fix/issue-829-openclaw-setup
Closed

feat: offer OpenClaw migration during setup#846
kshitijk4poor wants to merge 6 commits intoNousResearch:mainfrom
kshitijk4poor:fix/issue-829-openclaw-setup

Conversation

@kshitijk4poor
Copy link
Contributor

@kshitijk4poor kshitijk4poor commented Mar 10, 2026

Problem

OpenClaw migration currently lives behind an optional migration skill, which means users need Hermes running before they can import the API keys and config needed to run Hermes in the first place.

Issue #829 asks for that migration to happen naturally during install/setup instead of after first boot.

Closes #829
Supersedes the earlier hermes migrate direction in #826

What This PR Changes

  • Adds a shared OpenClaw migration wrapper in hermes_cli/openclaw_migration.py so setup can call the existing migration script directly.
  • Adds hermes setup --migrate-from openclaw in hermes_cli/main.py.
  • Runs migration at the start of hermes setup when explicitly requested, or offers it automatically on first-run when ~/.openclaw/ is detected.
  • Wires both installers (scripts/install.sh and scripts/install.ps1) to hand off into setup with the right migration flags.
  • Passes --skip-migration-prompt when the installer prompt is declined so setup does not immediately ask again.
  • Fixes the shell installer prompt to consume the full input line, so answers like no or yes do not leak characters into the next setup prompt.
  • Adds CLI/setup regression coverage for the new migration paths.

Behavior Covered

  • First install + ~/.openclaw/ present: setup offers migration before provider prompts.
  • Installer accepts migration: setup starts with --migrate-from openclaw and imports immediately.
  • Installer declines migration: setup receives --skip-migration-prompt and does not re-prompt.
  • Existing Hermes install: explicit hermes setup --migrate-from openclaw still runs the migration.
  • Missing Hermes config: setup bootstraps config.yaml before importing command allowlists and related config.
  • Shell installer prompt: multi-character input like no is fully consumed and does not corrupt the next prompt.

Review Guide

  1. hermes_cli/setup.py
    Main setup-flow integration: detection, explicit migration, skip flag behavior, and summary path.
  2. hermes_cli/openclaw_migration.py
    Thin wrapper around the existing migration script.
  3. hermes_cli/main.py
    New setup CLI flags.
  4. scripts/install.sh and scripts/install.ps1
    Installer handoff into setup.
  5. tests/hermes_cli/test_main.py, tests/hermes_cli/test_setup_migration.py, tests/hermes_cli/test_install_sh.py
    Regression coverage for the new flows.

Notes For Reviewers

  • tests/tools/test_vision_tools.py is a test-only stabilization change to keep the suite green; it does not change production behavior for this feature.
  • The migration implementation intentionally reuses optional-skills/migration/openclaw-migration/scripts/openclaw_to_hermes.py rather than duplicating logic in setup.

Verification

Ran locally after the follow-up installer fix:

  • python -m pytest tests/hermes_cli/test_install_sh.py -q -> 1 passed
  • python -m pytest tests/hermes_cli/test_main.py tests/hermes_cli/test_setup_migration.py -q -> 7 passed
  • python -m pytest tests/tools/test_vision_tools.py -q -> 42 passed
  • python -m hermes_cli.main setup --help -> passed
  • bash -n scripts/install.sh -> passed
  • python -m pytest tests/ -q -> 2868 passed, 5 skipped, 23 deselected, 3 warnings

Branch Status

  • PR branch updated with follow-up fix: fix: consume full installer prompt input (62b5a7d)

@kshitijk4poor kshitijk4poor force-pushed the fix/issue-829-openclaw-setup branch from 0e0b996 to abff438 Compare March 10, 2026 16:26
- Use get_hermes_home() instead of hardcoded Path.home() / ".hermes"
  so HERMES_HOME env var is respected
- Rename setup.py's run_openclaw_migration to perform_openclaw_migration
  to avoid confusing shadowing with openclaw_migration.run_openclaw_migration
- Remove unused keyword params from run_openclaw_migration (YAGNI)
- Normalize Optional[Path] to Path | None (already uses __future__ annotations)
- Eliminate double load_config() call on migration path
@teknium1
Copy link
Contributor

Thanks for the work on this! We're going in a slightly different direction — we want the OpenClaw migration integrated directly into the interactive setup wizard flow (after install, before API/tool configuration starts), rather than via CLI flags and installer script changes.

We'll be opening a new PR that takes the simpler approach: detect ~/.openclaw/ during the setup wizard, ask the user if they're migrating, and run the existing migration script inline. Appreciate the thorough test coverage and clean code though!

@kshitijk4poor
Copy link
Contributor Author

kshitijk4poor commented Mar 11, 2026

Replacement PR is up at #981 with the requested wizard-only OpenClaw migration flow. This new PR carries the verified rebuild on a fresh branch instead.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: offer agent migration during install.sh and hermes setup

2 participants