Replace the code-level string-replacement hotfix system (openclawRuntimeHotfix.ts)
with git patch files applied to OpenClaw TypeScript sources before compilation.
Patches are now organized under scripts/patches/<version>/ directories, tied to
the openclaw version declared in package.json.
- Move 8 patch files into scripts/patches/v2026.3.2/
- Update apply-openclaw-patches.cjs to resolve version from package.json
- Update build-openclaw-runtime.sh patch hash to use versioned directory
- Remove openclaw:hotfix build step from all 6 platform build chains
- Delete openclawRuntimeHotfix.ts, apply-openclaw-runtime-hotfixes.cjs, and tests
- Remove applyRuntimeHotfixes() from openclawEngineManager.ts
Signed-off-by: Dylan <[email protected]>
- Remove warmupCompileCacheIfNeeded and its execFile import since
ELECTRON_RUN_AS_NODE warmup cache is incompatible with gateway's
spawn context (1514 vs 6026 cache files, never hit)
- Remove NSIS install-time warmup (wrote cache to wrong admin path)
- Add Windows Defender exclusion for cfmind/ during NSIS install
to reduce first-launch I/O overhead from Defender scanning
- Clean up Defender exclusion on uninstall
- Simplify gateway-launcher.cjs to minimal logging
- Remove warmup-compile-cache.cjs copy step from bundle script
Move SKILLs from common extraResources to platform-specific sections so Windows can ship skills.tar and python-win.tar alongside cfmind.tar. All three archives are packed in beforePack, extracted by the NSIS customInstall macro via the shared unpack-cfmind.cjs script, then deleted to free disk space. Mac and Linux retain the original directory-copy approach.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <[email protected]>
Replace the extraResources directory copy of vendor/openclaw-runtime/current with a single cfmind.tar archive for Windows builds. The beforePack hook now packs the runtime into tar, electron-builder ships the tar as a resource, and the NSIS customInstall macro extracts it post-install using Electron's Node runtime before V8 warmup. This dramatically speeds up NSIS installation on NTFS by avoiding per-file 7z extraction of thousands of small files.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <[email protected]>
Add minimal zero-dependency POSIX ustar tar writer (pack-openclaw-tar.cjs) and reader (unpack-cfmind.cjs) for packing the OpenClaw runtime directory into a single archive at build time and extracting it during NSIS post-install. This avoids the slow per-file extraction of thousands of small files on NTFS.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <[email protected]>
Add scripts/precompile-openclaw-extensions.cjs that uses esbuild to
compile each extension's TypeScript entry point to JavaScript at build
time. This eliminates jiti's runtime Babel transpilation (~135s on
first Windows startup reduced to ~82s). Extensions already shipping
as .js (feishu-openclaw-plugin, wecom-openclaw-plugin) are skipped.
Also:
- Add install timing log to NSIS installer for diagnosing slow installs
- Hide empty details list (ShowInstDetails nevershow) since
electron-builder uses 7z solid extraction with no per-file output
- Integrate precompile step into all openclaw:runtime:* build scripts
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Remove plugins from minimal openclaw config so gateway can bind port
immediately on fresh install (plugins loaded via jiti were blocking
httpServer.listen for minutes)
- Protect existing configs with IM plugin settings from being overwritten
by minimal config on sync
- Show file extraction details in NSIS installer while hiding warmup
operations from progress text
- Fix apply-openclaw-patches idempotent detection for patches containing
new files
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Override isbinaryfile to ^5.0.0 to fix RangeError in @electron/osx-sign
- Add cleanup for broken symlinks in cfmind/extensions before signing
Co-Authored-By: Claude Opus 4.5 <[email protected]>
On Windows, @electron/asar listPackage() returns backslash-separated
paths (e.g. \dist\entry.js) but the validation code checks for
forward-slash paths (/dist/entry.js). Normalize to forward slashes.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Enable V8 compile cache for the openclaw gateway to eliminate cold-start
V8 compilation overhead (~35s for the 26MB bundle).
Changes:
- Set NODE_COMPILE_CACHE env var in utilityProcess.fork() for ESM support
- Add enableCompileCache() + flushCompileCache() in gateway-launcher.cjs
- Add warmup-compile-cache.cjs script for pre-populating the cache
- Add NSIS post-install hook to run warmup during Windows installation
- Copy warmup script to runtime dir during bundle step
The compile cache is stored at <userData>/openclaw/state/.compile-cache
and persists across app restarts. On Windows NSIS install, the warmup
runs automatically after file extraction using ELECTRON_RUN_AS_NODE=1.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Prevents npm from installing peer dependencies (e.g. openclaw) into
plugin directories. The qqbot plugin's peerDependencies pulled in ~2 GB
of unnecessary packages; with this flag, only the 3 actual dependencies
(silk-wasm, ws, mpg123-decoder) are installed.
Ref: https://github.com/sliverp/qqbot/issues/89
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add a plugin preinstall mechanism that declares plugins in package.json
(openclaw.plugins), auto-downloads them during development, and bundles
them into the runtime for production builds.
- Add openclaw.plugins array in package.json with DingTalk connector as first plugin
- Create scripts/ensure-openclaw-plugins.cjs for downloading and caching plugins
- Update all openclaw:runtime:* scripts to run plugin install after runtime build
- Update openclawConfigSync.ts to write plugins.allow + entries.enabled config
- Set OPENCLAW_BUNDLED_PLUGINS_DIR env var for reliable plugin discovery
- Add plugin verification in electron-builder-hooks.cjs beforePack
- Add vendor/openclaw-plugins/ to .gitignore
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Resolve conflicts:
- .gitignore: add .vscode/ from main
- package.json: bump version to 0.2.2, keep openclaw config
- Settings.tsx: adopt custom icon components from main, keep CpuChipIcon for openclaw
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Fix build cache check: use "node -" with process.argv instead of
"node -e" with interpolated paths (MSYS2 path style breaks require())
- Fix unbound variable error: use ${OPENCLAW_FORCE_BUILD:-} for set -u
- Remove slow `du -sh` at end of build script (extremely slow on Windows)
- Use NTFS junction (Windows) / symlink (macOS/Linux) instead of
fs.cpSync for near-instant runtime sync
- Fix asar extraction: preserve backslash paths for extractFile() lookup
- Fix gateway-launcher.cjs: use fs.realpathSync to resolve junctions
when comparing process.argv[1] with __filename
- Fix client module loading: use require(path) instead of
import(file://url) since TypeScript CJS output downgrades import()
to require() which doesn't support file:// URLs
- Increase gateway boot timeout from 120s to 180s
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Add `openclaw.version` and `openclaw.repo` config in package.json
- Add `ensure-openclaw-version.cjs` to auto-clone or checkout the pinned tag
- Add build cache in `build-openclaw-runtime.sh` — skip rebuild when version matches
- Enhanced `runtime-build-info.json` with openclawVersion and openclawCommit
- Fix Windows: prefer Git Bash over WSL bash (WindowsApps\bash.exe)
- Fix Windows: normalize PATH env for bash, use relative script path
- Fix Windows: add `shell: true` for npm.cmd in openclaw-runtime-host.cjs
- Add `.gitattributes` to enforce LF line endings for .sh files
- Update README.md and README_zh.md with OpenClaw dev workflow and version management docs
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Three issues prevented the gateway from starting on Windows after a fresh
runtime build:
1. The build script packs openclaw.mjs and dist/ into gateway.asar then
deletes the originals, but utilityProcess.fork() cannot load ESM from
inside .asar archives on Windows. Added auto-extraction of bare entry
files from gateway.asar at startup (ensureBareEntryFiles) and at
build-time (sync-openclaw-runtime-current.cjs).
2. The ESM loader misinterprets Windows drive letters (e.g. "D:") as URL
schemes, causing ERR_UNSUPPORTED_ESM_URL_SCHEME. Added a CJS wrapper
(gateway-launcher.cjs) that uses pathToFileURL() to load the ESM entry
via a proper file:// URL.
3. OpenClaw's isMainModule() guard checks process.argv[1] basename against
known entry pairs. The CJS wrapper patches argv[1] back to the ESM
entry path so the guard recognizes it as the main module.
Co-Authored-By: Claude Opus 4.6 <[email protected]>