Skip to content

openclaw: AbortSignal.timeout(5000) too aggressive on cold gateway init #105

@kaghni

Description

@kaghni

Summary

After PR #97 (feat/centralize-autoupdate), the OpenClaw plugin's checkForUpdate() correctly polls the npm registry instead of ClawHub, and emits Run: hivemind update instead of openclaw plugins update hivemind. But during cold gateway init, the 5-second AbortSignal.timeout(5000) on the registry fetch fires before the response lands, swallowing the upgrade-available notice for that gateway run.

Symptom

[plugins] Hivemind plugin registered
[plugins] Auto-update check failed: The operation was aborted due to timeout

Expected output ⬆️ Hivemind update available: <current> → <latest>. Run: hivemind update never renders.

Repro

  1. Start a fresh openclaw gateway with --dev profile (or production)
  2. Watch /tmp/openclaw.log for the [plugins] lines

The timeout is reproducible on cold start. Re-running the gateway tends to succeed (warm TLS / DNS).

Confirmation that the change itself is in the bundle

$ grep -oE 'registry.npmjs.org/@deeplake|clawhub.ai' ~/.openclaw/extensions/hivemind/dist/index.js
registry.npmjs.org/@deeplake

$ grep -c 'openclaw plugins update' ~/.openclaw/extensions/hivemind/dist/index.js
0

So the centralization at the source-of-truth layer (npm registry vs ClawHub) and the advice-text layer (Run: hivemind update) is in place. Only the live notice render is unreliable due to the cold-init timeout.

Confirmation the registry itself is fast

$ time curl -sS -o /dev/null https://registry.npmjs.org/@deeplake/hivemind/latest
real    0m0.167s

So 5s is plenty in steady state. The first-run timeout was likely cold TLS + bonjour-watchdog noise running concurrently with plugin register.

Suggested fix

In openclaw/src/index.ts:checkForUpdate:

  1. Bump the timeout from 5000 to 10000 ms to absorb cold-init latency.
  2. OR: on AbortError, retry once with exponential backoff before silently giving up.
const res = await fetch(VERSION_URL, { signal: AbortSignal.timeout(10000) });  // was 5000

What this PR established for OpenClaw

  • ✅ Bundle URL changed from clawhub.airegistry.npmjs.org/@deeplake/...
  • ✅ Advice text changed from openclaw plugins update hivemindRun: hivemind update (in the in-prompt notice, the registerCommand handler, AND the inlined SKILL.md)
  • ⚠️ Live notice render not observed in E2E this run (5s timeout); registry measured 167ms in steady state, so a small bump fixes it.

Priority

Low. The check runs once per gateway start and doesn't affect runtime behavior. Users still get hivemind update (manually or through any other agent's session-start centralized trigger) — just don't get the in-prompt nudge from OpenClaw on the cold-start gateway run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions