Skip to content

feat: isolate ClawX OpenClaw config from system-wide installation#281

Open
stone-jin wants to merge 2 commits intoValueCell-ai:mainfrom
stone-jin:feat/isolate-openclaw-config
Open

feat: isolate ClawX OpenClaw config from system-wide installation#281
stone-jin wants to merge 2 commits intoValueCell-ai:mainfrom
stone-jin:feat/isolate-openclaw-config

Conversation

@stone-jin
Copy link

Summary

Closes #280

ClawX previously shared ~/.openclaw with a system-wide OpenClaw CLI installation, causing gateway tokens, provider configs, and channel configs to collide. This PR isolates ClawX's OpenClaw state into ~/.clawx/openclaw.

  • Change getOpenClawConfigDir() to return ~/.clawx/openclaw instead of ~/.openclaw
  • Replace all hardcoded join(homedir(), '.openclaw', ...) paths across 8 files with the centralized getOpenClawConfigDir()
  • Pass OPENCLAW_STATE_DIR env var to the Gateway and doctor-repair spawn processes so the OpenClaw runtime also uses the isolated directory
  • Remove unused homedir imports where they are no longer needed
  • Add unit tests verifying the config path isolation

Test plan

  • All existing unit tests pass (77/77)
  • New config-isolation.test.ts tests pass (5/5)
  • ESLint passes with pnpm run lint
  • TypeScript type check passes with pnpm run typecheck
  • Manual test: start ClawX with an existing ~/.openclaw directory — verify ClawX creates and uses ~/.clawx/openclaw/ instead
  • Manual test: verify a system-wide openclaw gateway still reads from ~/.openclaw without interference

Made with Cursor

ClawX previously shared ~/.openclaw with a system-wide OpenClaw CLI
installation, causing gateway tokens, provider configs, and channel
configs to collide. This change moves ClawX's OpenClaw state to
~/.clawx/openclaw and passes OPENCLAW_STATE_DIR to the Gateway
process so the embedded runtime also uses the isolated directory.

- Change getOpenClawConfigDir() to return ~/.clawx/openclaw
- Replace all hardcoded ~/.openclaw paths with getOpenClawConfigDir()
- Add OPENCLAW_STATE_DIR to Gateway and doctor-repair spawn env
- Add unit tests for config path isolation

Made-with: Cursor
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.

ClawX shares ~/.openclaw config with system-wide OpenClaw installation

1 participant