Skip to content

fix(agents): respect active OpenClaw, Hermes and Qwen directories - #2451

Open
morluto wants to merge 1 commit into
vercel-labs:mainfrom
morluto:fix/active-agent-skill-directories
Open

morluto wants to merge 1 commit into
vercel-labs:mainfrom
morluto:fix/active-agent-skill-directories

Conversation

@morluto

@morluto morluto commented Oct 10, 2026

Copy link
Copy Markdown

Global installs currently succeed into inactive directories when OpenClaw, Hermes Agent or Qwen Code runs with an alternate home/profile. For example, QWEN_HOME=/tmp/qwen-work skills add ./skill -a qwen-code -g -y writes to ~/.qwen/skills rather than /tmp/qwen-work/skills.

Resolve the active directories in src/agents.ts, where installation, detection, listing and removal already obtain their paths:

  • OpenClaw: honor OPENCLAW_STATE_DIR and OPENCLAW_HOME, including leading ~ and invocation-relative paths. Explicit state directories take precedence over existing default/legacy roots; retain legacy discovery when there is no state override.
  • Hermes Agent: honor the literal HERMES_DATA_DIR_SUFFIX, the Windows LOCALAPPDATA default, and explicit HERMES_HOME precedence with home/environment expansion.
  • Qwen Code: honor QWEN_HOME using Qwen's tilde/relative-path semantics, without applying another client's trimming or environment expansion rules.

Detection checks the same resolved directory used by the other commands. Document the overrides and isolate them in the CLI test environment. Existing installations are not automatically moved or deleted.

Closes #2450.

Validation

  • All 992 tests in 72 files pass on macOS with Node 24.18.0 and pnpm 10.17.1.
  • The six new public CLI regression cases fail on the unmodified base. They pass with this change and cover add/list/remove, copy and actual symlink installs, repeat installs, supporting resources and preservation of an inactive profile's skill.
  • Path tests cover override precedence, defaults, missing-profile detection, leading tilde, relative paths and Windows home resolution. Existing OpenClaw legacy-path tests pass.
  • Type checking, formatting, agent metadata validation, build and git diff --check pass.
  • Packed the npm distribution and invoked it through npx --package <tarball> skills. 11 isolated scenarios pass add, repeat, list and remove, installing all six files of reverse-engineer-anything byte-for-byte. These cover all three agents' defaults plus absolute overrides, relative paths, OpenClaw home expansion, Hermes suffix/environment expansion and Qwen tilde expansion.

Windows defaults are covered by resolver tests; I have not run a native Windows session or a model-backed harness session.

Upstream contracts checked

This branch has not been deployed

No deployments
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.

[Bug]: Global installs ignore active OpenClaw, Hermes and Qwen directories

1 participant