Conversation
| }78", | ||
| "endRef": "8033eb28396d49a25ca0215659aed9cac567ea78" | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
🟡 Malformed JSON in trajectory file causes parse failures
.trajectories/active/traj_5aodeh2qd7mw.json contains duplicated/corrupted content after the valid JSON closing brace. Lines 46-49 are garbage data (}78",\n "endRef": ...) appended after the file's valid end at line 45. Any code that reads this file via JSON.parse() (e.g., packages/trajectory/src/integration.ts:122) will throw a parse error. The readSingleTrajectoryIndex function has a try/catch that would gracefully handle index failures, but individual trajectory reads elsewhere may not be similarly guarded.
| }78", | |
| "endRef": "8033eb28396d49a25ca0215659aed9cac567ea78" | |
| } | |
| } |
Was this helpful? React with 👍 or 👎 to provide feedback.
| const ocHome = resolveOpenclawHome(); | ||
| const home = options.homeDir ?? process.env.HOME ?? '/home/node'; |
There was a problem hiding this comment.
🔴 options.homeDir silently ignored for OpenClaw home path resolution
The runtimeSetup function still accepts options.homeDir and assigns it to const home at line 45, but home is now completely unused — the OpenClaw home path is resolved solely via resolveOpenclawHome() (line 44), which ignores options.homeDir. Previously, options.homeDir controlled the OpenClaw home via join(home, '.openclaw'). Any caller passing homeDir (e.g., a Docker container specifying a non-standard home) will silently get different behavior — resolveOpenclawHome() only checks env vars and probes os.homedir(), not the passed-in homeDir. The RuntimeSetupOptions.homeDir interface field is now misleading dead code.
Before vs After behavior
Before: runtimeSetup({ homeDir: '/custom' }) → config written to /custom/.openclaw/
After: runtimeSetup({ homeDir: '/custom' }) → homeDir silently ignored, config written to wherever openclawHome() resolves (e.g. ~/.openclaw/)
Prompt for agents
In packages/openclaw/src/runtime/setup.ts, the `options.homeDir` parameter is now silently ignored for OpenClaw home resolution (line 44 uses `resolveOpenclawHome()` which doesn't consult `options.homeDir`). Either:
1. Remove `homeDir` from `RuntimeSetupOptions` (lines 27-28) and remove the unused `const home` assignment (line 45), updating any callers. OR
2. Make `resolveOpenclawHome()` respect `options.homeDir` as a fallback, e.g. by setting `process.env.OPENCLAW_HOME` temporarily or by adding a parameter to `openclawHome(defaultHome?: string)` in config.ts.
Option 1 is preferred if no callers rely on `homeDir` for OpenClaw path resolution. The current CLI caller in cli.ts:224 does not pass `homeDir`, so removing it is likely safe.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
Split into two focused PRs and removed trajectory files:
|
Summary
Test Plan
Screenshots