Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

Fix OpenClawEntryPath to respect OPENCLAW_STATE_DIR when UserHomeDir fails

Cursor Agentd45b376e13cb
diff --git a/cli/beacon/internal/endpoint/hooks/openclaw.go b/cli/beacon/internal/endpoint/hooks/openclaw.go
index 4d7e91cd..9131ac9b 100644
--- a/cli/beacon/internal/endpoint/hooks/openclaw.go
+++ b/cli/beacon/internal/endpoint/hooks/openclaw.go
@@ -283,12 +283,9 @@ func openClawInstalledAt(path string) bool {
func OpenClawEntryPath(level Level) (string, error) {
home, err := os.UserHomeDir()
if err != nil {
- // Only the user level needs a home directory. Failing here for a project install would
- // refuse a path that does not depend on the value that could not be read.
- if level == LevelProject {
- return OpenClawEntryPathForHome("", level)
- }
- return "", err
+ // Pass an empty home and let downstream resolution decide: project scope never
+ // needs one, and user scope can resolve from OPENCLAW_STATE_DIR alone.
+ return OpenClawEntryPathForHome("", level)
}
return OpenClawEntryPathForHome(home, level)
}