Skip to content

openclaw: harden pool settings, close/abort handling, and download progress - #445

Open
Pybsama wants to merge 1 commit into
Nehanth:mainfrom
Pybsama:fix/openclaw-pool-settings-close-and-download
Open

Pybsama wants to merge 1 commit into
Nehanth:mainfrom
Pybsama:fix/openclaw-pool-settings-close-and-download

Conversation

@Pybsama

@Pybsama Pybsama commented Dec 4, 2026

Copy link
Copy Markdown

Summary

Harden OpenClaw room configuration, close/abort responsiveness, singleton lifecycle, and download progress formatting in packages/openclaw/src/pool.js and packages/openclaw/src/download.js:

  1. roomSettings() numeric & boolean env parsing (packages/openclaw/src/pool.js):
    • Reject NaN, non-finite, negative, or non-integer values for minDevices, waitSeconds, pledgeGB, and ctx, falling back to valid plugin config or defaults instead of allowing NaN (which could hang ensureOnline()/transport() wait loops) or negative limits.
    • Preserve explicit waitSeconds: 0 / POOLED_WAIT_S="0" instead of overriding it to 120.
    • Ignore empty/whitespace-only POOLED_ASK / POOLED_PULL / POOLED_PREWARM / POOLED_ALLOW_API env vars so they do not clobber explicit false plugin config values, and trim whitespace in off().
  2. Close/abort handling & singleton cleanup (packages/openclaw/src/pool.js):
    • Check r.closed alongside signal?.aborted in admitted(), bridgeFor(), and transport() so closing a room aborts pending waits immediately instead of timing out after lobbyMs / waitSeconds (and avoids creating a new Bridge on an already-closed room).
    • Race r.pullP against signal abort in ensureOnline({ waitPull: true }) and clean up the listener in finally.
    • Clear the process singleton slot when r.close() runs and avoid returning a closed handle from ensureRoom().
  3. Download abort normalization & progress clamping (packages/openclaw/src/download.js):
    • Normalize standard AbortError (e?.name === "AbortError" or signal?.aborted) to "stopped" in download().
    • Clamp pullLine() percentage to [0, 100] in running and checking states, clamp remaining bytes for ETA to >= 0, and omit non-finite or non-positive bps values.

Verification

  • node --check packages/openclaw/src/pool.js packages/openclaw/src/download.js packages/openclaw/test/pool_download_test.mjs: pass
  • node --test packages/openclaw/test/pool_download_test.mjs: 6 pass, 0 fail (all new tests confirmed RED before fix)
  • npm run test:packages: 219 pass, 0 fail, 6 skipped
  • npm run test:runtime: pass (all 6 runtime checks)

@Pybsama
Pybsama requested a review from Nehanth as a code owner December 4, 2026 22:41
@vercel

vercel Bot commented Dec 4, 2026

Copy link
Copy Markdown

@Pybsama is attempting to deploy a commit to the nehanth's projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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