Skip to content

Self-improving AI Employees for everyone

fix(install): survive slow Temporal CLI downloads in npm postinstall

trohitgf1f9f015f8d2
diff --git a/scripts/install.js b/scripts/install.js
index f7713bff..f5d34a1a 100755
--- a/scripts/install.js
+++ b/scripts/install.js
@@ -242,7 +242,15 @@ try {
// cache hit. Idempotent on re-install (pooch cache).
step++;
console.log(`[${step}/${totalSteps}] Installing Temporal binaries...`);
- run('uv run python -m services.temporal._install', serverDir, 600000);
+ // Non-fatal: TemporalServerRuntime._pre_spawn() re-runs this download
+ // lazily on first `machina start` — a failed fetch must never fail
+ // `npm install`.
+ try {
+ run('uv run python -m services.temporal._install', serverDir, 600000);
+ } catch (err) {
+ console.log(` Warning: Temporal CLI download failed (non-fatal): ${err.message}`);
+ console.log(' It will be fetched automatically on first `machina start`.');
+ }
// WhatsApp RPC is now an npm dependency - binary downloaded via postinstall
console.log('');
diff --git a/server/services/temporal/_install.py b/server/services/temporal/_install.py
index b9216186..673963c1 100644
--- a/server/services/temporal/_install.py
+++ b/server/services/temporal/_install.py
@@ -128,7 +128,12 @@ def _fetch_cli_sync() -> Path:
path=_cache_dir(),
fname=fname,
processor=processor,
- progressbar=True,
+ # requests' timeout is per-socket-read, not total download time —
+ # only a 300s zero-byte stall aborts, so slow links can finish.
+ # pooch's default is 30s, which killed npm installs on slow/WSL
+ # links. progressbar must live on the downloader: retrieve()
+ # ignores its own progressbar kwarg when downloader= is explicit.
+ downloader=pooch.HTTPDownloader(timeout=300, progressbar=True),
)
target = "temporal.exe" if is_windows else "temporal"