Skip to content

openclaw: fix case-insensitive /pooled allow turning away devices and reject index 0 - #434

Open
Pybsama wants to merge 1 commit into
Nehanth:mainfrom
Pybsama:fix/openclaw-pooled-command-case-and-index
Open

Pybsama wants to merge 1 commit into
Nehanth:mainfrom
Pybsama:fix/openclaw-pooled-command-case-and-index

Conversation

@Pybsama

@Pybsama Pybsama commented Dec 3, 2026

Copy link
Copy Markdown

Summary

Fixes two bugs in runPooledCommand (packages/openclaw/src/commands.js):

  1. Case-insensitive /pooled Allow ran denyJoin instead of allowJoin: switch (sub.toLowerCase()) matched "allow" case-insensitively, but the allow/deny branch checked sub === "allow" against the un-lowercased token. On clients that auto-capitalize chat text (e.g. /pooled Allow or /pooled Allow 1), the command fell into the denyJoin path and turned away the waiting device instead of letting it in (and rejected /pooled Allow all). Using const cmd = sub.toLowerCase() consistently fixes this.
  2. Index 0 acted on waiting device TURN relay for strict NATs #1: [q[(+arg || 1) - 1]] treated arg = "0" as falsy and defaulted to 1, so /pooled allow 0 and /pooled deny 0 silently allowed or denied the first waiting device instead of reporting that index 0 is out of range. Parsing const idx = arg ? +arg : 1 keeps the omitted-argument default while rejecting 0.

Validation

  • Added regression test in packages/openclaw/test/v1_test.mjs covering /pooled allow 0, /pooled DENY 0, /pooled Allow 1 (verifying allowJoin is called, not denyJoin), and /pooled ALLOW all; confirmed it fails on origin/main before the fix.
  • Ran node --check packages/openclaw/src/commands.js packages/openclaw/test/v1_test.mjs (clean).
  • Ran npm run test:packages (214 pass, 0 fail, 6 skipped).

@Pybsama
Pybsama requested a review from Nehanth as a code owner December 3, 2026 00:32
@vercel

vercel Bot commented Dec 3, 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