Skip to content

fix(exec-approvals): respect OPENCLAW_STATE_DIR for store paths#2139

Open
BingqingLyu wants to merge 3 commits into
mainfrom
fork-pr-62938-fix-exec-approvals-state-dir-62917
Open

fix(exec-approvals): respect OPENCLAW_STATE_DIR for store paths#2139
BingqingLyu wants to merge 3 commits into
mainfrom
fork-pr-62938-fix-exec-approvals-state-dir-62917

Conversation

@BingqingLyu

@BingqingLyu BingqingLyu commented Apr 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • make exec approvals store paths respect OPENCLAW_STATE_DIR
  • keep OPENCLAW_HOME as the fallback when no explicit state dir is set
  • add store-path tests covering OPENCLAW_STATE_DIR precedence and file creation

Why

exec-approvals was still resolving exec-approvals.json and exec-approvals.sock from the legacy home-based path logic, even when the rest of OpenClaw state had been relocated via OPENCLAW_STATE_DIR. That left exec-approvals as the odd one out and could trigger repeated Multiple state directories detected warnings in openclaw doctor.

Closes openclaw#62917.

Validation

  • git diff --check
  • corepack pnpm vitest run src/infra/exec-approvals-store.test.ts src/infra/exec-approvals-config.test.ts
  • corepack pnpm vitest run src/commands/doctor-state-integrity.test.ts src/commands/doctor-security.test.ts

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: exec-approvals does not respect OPENCLAW_STATE_DIR, causing duplicate state-dir doctor warning

2 participants