Bug
The device identity module hardcodes ~/.openclaw/identity instead of respecting
OPENCLAW_STATE_DIR.
Expected: All state should go to $OPENCLAW_STATE_DIR when set.
Actual: ~/.openclaw/identity/device.json and ~/.openclaw/agents/ are created regardless.
Location
src/infra/device-identity.ts:
const DEFAULT_DIR = path.join(os.homedir(), ".openclaw", "identity");
This pattern appears in multiple built files:
- dist/client-Cb1nog5C.js
- dist/client-BEiMC6c_.js
- dist/extensionAPI.js
- dist/plugin-sdk/index.js
Suggested fix
const OPENCLAW_STATE_DIR = process.env.OPENCLAW_STATE_DIR || path.join(os.homedir(),
".openclaw");
const DEFAULT_DIR = path.join(OPENCLAW_STATE_DIR, "identity");
Same pattern should be applied to agents directory resolution.
Environment
- macOS (arm64)
- OpenClaw installed via npm
- OPENCLAW_STATE_DIR=/Users/jeffgreenberg/Eliza
bug report created by openclaw
Bug
The device identity module hardcodes
~/.openclaw/identityinstead of respectingOPENCLAW_STATE_DIR.Expected: All state should go to
$OPENCLAW_STATE_DIRwhen set.Actual:
~/.openclaw/identity/device.jsonand~/.openclaw/agents/are created regardless.Location
src/infra/device-identity.ts:This pattern appears in multiple built files:
Suggested fix
Same pattern should be applied to agents directory resolution.
Environment