Skip to content

fix(plugin): add OpenClaw state dir fallback#85

Open
YOMXXX wants to merge 1 commit into
Tencent:mainfrom
YOMXXX:fix/openclaw-state-dir-fallback
Open

fix(plugin): add OpenClaw state dir fallback#85
YOMXXX wants to merge 1 commit into
Tencent:mainfrom
YOMXXX:fix/openclaw-state-dir-fallback

Conversation

@YOMXXX
Copy link
Copy Markdown
Contributor

@YOMXXX YOMXXX commented May 24, 2026

Summary

  • add an ESM-safe helper for resolving the OpenClaw state directory
  • fall back to ~/.openclaw when api.runtime.state is unavailable during plugin registration
  • reuse the same resolved state dir for plugin data and CLI registration
  • keep the npm tarball under Size Guard by publishing built runtime artifacts only

Fixes #78.

This is intended as a safer alternative to #79: it avoids bare require("os") in the ESM source path and adds a focused unit test for the fallback behavior.

Verification

  • npm test
  • npm run build
  • npm pack --dry-run (package size: 340.2 kB, unpacked: 1.3 MB)

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.

fix: runtime.state.resolveStateDir undefined on OpenClaw >=2026.5.x

1 participant