Skip to content

[Bug]: OPENCLAW_HOME not respected #54014

@robertPiro

Description

@robertPiro

Bug type

Behavior bug (incorrect output/state without crash)

Summary

OPENCLAW_HOME overwritten by os.homedir()
also
OPENCLAW_HOME should determine OPENCLAW_STATE_DIR and OPEN_CLAW_CONFIG_PATH, OPENCLAW_GIT_DIR unless explicitly set.

shell-env-BOu7XeT_.js, line 237 overwrites home (v2026.3.23-2)
update-cli-Bh5F5dRy.js, line 315 sets default GitDir in user's home.
setup.finalize-B1Lq2LFO.js, line 217 does not check OPENCLAW_HOME
server-startup-matrix-migration-BnKhjFnf.js does not check for OPENCLAW_HOME (? maybe unintuitive)
skills-DAP6Yelo.js line 555 sets ~/.agents/skills
routes-sPyjSxSY.js, line 4144 sets trash dir to home dir
update-cli-Bh5F5dRy.js, line 707 (?) should also check OPENCLAW_HOME

Steps to reproduce

  1. Start OpenClaw (v2026.3.23-2), set a different home directory.
  2. Still another .openclaw directory is created in the user's home directory

Expected behavior

2026.3.23-2 should respect OPENCLAW_HOME.

Actual behavior

Writes information and searches for information into surprising directories

OpenClaw version

2026.3.23-2

Operating system

Ubuntu 24.04.4 LTS

Install method

npm

Model

google-vertex/gemini-2.5-pro

Provider / routing chain

openclaw -> gateway

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

Affected: systems
Severity: Annoying
Frequency: always
Consequence: hard to install

Additional information

No response

Metadata

Metadata

Assignees

Labels

P2Normal backlog priority with limited blast radius.bugSomething isn't workingbug:behaviorIncorrect behavior without a crashclawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions