Skip to content

fix(deployer): probe npm registries before OpenClaw install, fail fast when all blocked - #106

Merged
yikkuro merged 2 commits into
mainfrom
yikkuro/fix-openclaw-registry-probe
Jul 24, 2026
Merged

fix(deployer): probe npm registries before OpenClaw install, fail fast when all blocked#106
yikkuro merged 2 commits into
mainfrom
yikkuro/fix-openclaw-registry-probe

Conversation

@yikkuro

@yikkuro yikkuro commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Problem

On the Microsoft corporate network, installing MicroClaw shows a Windows Security prompt — "This content is blocked by your IT admin … [Te] NPM URL Block" — and then hangs for a long time.

Root cause: the deployer installs the OpenClaw gateway with npm install -g openclaw and forces its own hardcoded registry fallback list (registry.npmjs.orgregistry.npmmirror.com → Huawei), ignoring the machine's configured registry. On corp networks the first two are blocked by Defender Network Protection. For each blocked registry, npm was handed a proc.wait(timeout=900) (15 min), so the install:

  • popped the "blocked by your IT admin" toast for every blocked host, and
  • hung for many minutes per registry before finally reaching a reachable mirror.

Verified from a corp machine: registry.npmjs.org and registry.npmmirror.com fail (SSL blocked), while the Huawei mirror serves openclaw fine.

Fix

  • Add _reachable_npm_registries(): a fast parallel reachability probe (each candidate''s /-/ping, 2.5s timeout). Only registries that respond are attempted, fastest-first. Blocked/unreachable hosts are dropped so they are never handed to the 900s npm install.
  • If no candidate registry is reachable, log a clear, actionable message (naming the likely NPM URL Block policy and the tried registries) and return failure immediately — the install fail screen shows right away instead of making the user wait.

Tests

  • Existing registry-fallback tests updated to stub the probe (identity passthrough) — behavior unchanged.
  • New test_all_registries_unreachable_fails_fast_without_install asserts we fail fast and never call npm install when nothing is reachable.
  • python -m unittest tests.test_windows_setup_upgrade → 25 passed; ruff check / ruff format --check clean.

Fixes #93.

Tao Sun (from Dev Box) and others added 2 commits July 23, 2026 15:03
The Ask Agent button on unavailable skills was wrapped in an el-tooltip
showing the missing-requirement reason, which is redundant — the same
reason is already shown on the 'Unavailable' badge next to the skill
name. Unwrap the button so hovering it no longer shows the tooltip.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…t when all are blocked

On corporate networks (e.g. Microsoft) the public npm registries the
deployer falls back to (registry.npmjs.org, registry.npmmirror.com) are
blocked by network policy (Defender Network Protection 'NPM URL Block').
Previously the installer handed each blocked registry to 'npm install -g
openclaw' with a 900s timeout, so it would hang for many minutes per
registry AND trigger a Windows Security 'blocked by your IT admin' toast
for every blocked host before eventually falling through to a reachable
mirror.

Add a fast parallel reachability probe (per-registry /-/ping, 2.5s
timeout) and only attempt registries that respond, fastest-first. If no
candidate registry is reachable, log a clear, actionable message and
return failure immediately so the install fail screen shows right away
instead of making the user wait through repeated long npm hangs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@yikkuro
yikkuro merged commit c53e035 into main Jul 24, 2026
2 of 3 checks passed
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.

[Bug] Windows Security block prompt ('This content is blocked by your IT admin') shown frequently during app installation

1 participant