Skip to content

Webclaw separation#495

Closed
khaliqgant wants to merge 2 commits intomainfrom
webclaw-separation
Closed

Webclaw separation#495
khaliqgant wants to merge 2 commits intomainfrom
webclaw-separation

Conversation

@khaliqgant
Copy link
Member

@khaliqgant khaliqgant commented Mar 5, 2026

Summary

Test Plan

  • Tests added/updated
  • Manual testing completed

Screenshots


Open with Devin

@khaliqgant khaliqgant requested a review from willwashburn as a code owner March 5, 2026 22:00
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

View 5 additional findings in Devin Review.

Open in Devin Review

Comment on lines +46 to +49
}78",
"endRef": "8033eb28396d49a25ca0215659aed9cac567ea78"
}
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Suggested change
}78",
"endRef": "8033eb28396d49a25ca0215659aed9cac567ea78"
}
}
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +44 to 45
const ocHome = resolveOpenclawHome();
const home = options.homeDir ?? process.env.HOME ?? '/home/node';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@khaliqgant
Copy link
Member Author

Split into two focused PRs and removed trajectory files:

@khaliqgant khaliqgant closed this Mar 6, 2026
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.

1 participant