fix: support linux config paths with unified home resolution#223
fix: support linux config paths with unified home resolution#223jiang1997 wants to merge 1 commit into
Conversation
|
Thanks for the contribution! We'll review the Linux config path support. |
Add optional-path helpers for XDG-style config lookup and resolveHomeDir() so gateway config discovery and default data dir share the same home fallback chain (HOME, USERPROFILE, os.homedir, userInfo, /tmp).
cbcb088 to
e8047a2
Compare
|
Thanks for the contribution! The gateway config path resolution part looks good — clean code, proper XDG support, and solid test coverage. However, this PR only partially fixes #103. There are two other files with the same fragile home-directory resolution pattern that should be updated in this PR for a complete fix:
Line 155 still uses the old inline pattern without a /tmp fallback: const home = getEnv("HOME") ?? getEnv("USERPROFILE") ?? "";This should use resolveHomeDir() instead. The three fs.existsSync calls in this function (lines 145, 151, 158) should also be replaced with optionalConfigFileExists for consistency.
Line 33 uses bare homedir() with no fallback chain: path.join(homedir(), ".openclaw")This should use resolveHomeDir() so all three call sites share the same HOME → USERPROFILE → os.homedir() → userInfo().homedir → /tmp resolution chain. Both are the same class of bug described in #103. Could you apply resolveHomeDir() to these two files as well? |
|
Triage note: #443 is now the canonical verified fix for #103. I previously could not select #223 because local focused verification still resolved the default port instead of the test fixture config path. #443 covers the same Linux/XDG config-path problem with a shared helper and regression tests for Gateway config, OpenClaw config, and OpenClaw state-dir fallback. Verified #443 locally with:
Recommendation: close this as superseded by #443. |
Description | 描述
$XDG_CONFIG_HOME/memory-tencentdbor~/.config/memory-tencentdbHOME -> USERPROFILE -> os.homedir() -> userInfo().homedir -> /tmpRelated Issue | 关联 Issue
Fix #103
Change Type | 修改类型
Self-test Checklist | 自测清单