Skip to content

[Bug]: senderIsOwner always false in Discord group channels — breaks cron/gateway tools (2026.2.19-2) #22284

@JustinPhils

Description

@JustinPhils

Summary

After updating to 2026.2.19-2, cron and gateway agent tools are missing in Discord group channel sessions — "Tool cron not found"

Steps to reproduce

  1. Install OpenClaw 2026.2.19-2 via npm global
  2. Configure Discord with a guild and group channels
  3. Set commands.ownerAllowFrom: ["YOUR_DISCORD_USER_ID"] in openclaw.json
  4. Message the bot in a Discord group channel
  5. Agent attempts to use cron tool

Expected behavior

Agent should have access to cron and gateway tools when the message sender is configured as owner via commands.ownerAllowFrom or guilds.users.

Actual behavior

Agent gets "Tool cron not found." The tools are completely stripped from the session. senderIsOwner is always false in Discord group channels because resolveOwnerAllowFromList and resolveSenderCandidates normalize IDs to different formats — they never match. Also, OWNER_ONLY_TOOL_NAME_FALLBACKS is a hardcoded name-based blocklist that blocks tools even if the ownerOnly property is removed from the tool definition.

OpenClaw version

2026.2.19-2

Operating system

Ubuntu 22.04 / Linux 6.8.0-94-generic (x64)

Install method

npm global

Logs, screenshots, and evidence

Agent session shows tools available but `cron` and `gateway` are missing from the tool list. CLI works fine:


$ openclaw cron status
{ enabled: true, jobs: 52, nextWakeAtMs: 1771642800000 }


But agent tool call returns:

Tool cron not found


Traced in compiled dist:
- `pi-embedded-helpers-*.js` line ~348: `isOwnerOnlyToolName(tool.name)` checks against `OWNER_ONLY_TOOL_NAME_FALLBACKS`
- `pi-embedded-helpers-*.js` line ~352: `applyOwnerOnlyToolPolicy` returns `withGuard.filter((tool) => !isOwnerOnlyTool(tool))` when `senderIsOwner` is false — completely removing the tools
- `pi-embedded-CHb5giY2.js` line ~9065: `senderIsOwner = Boolean(matchedSender)``matchedSender` is always `undefined` because format normalization mismatch

---

Impact and severity

Affected: All Discord group channel users on 2026.2.19-2
Severity: High (blocks cron/gateway tools entirely)
Frequency: 100% repro
Consequence: Agents cannot create/manage cron jobs or restart gateway from Discord group channels. Only workaround is patching 7 compiled dist files.

Additional information

Proposed fix:

  1. Make guild users config feed into owner resolution as a fallback when commands.ownerAllowFrom isn't set
  2. Fix format matching between resolveOwnerAllowFromList and resolveSenderCandidates so raw Discord user IDs match
  3. Support commands.ownerAllowFrom: ["*"] to mean "treat all senders as owner" for single-user setups
  4. Remove OWNER_ONLY_TOOL_NAME_FALLBACKS hardcoded Set — rely solely on the ownerOnly: true tool property

Workaround:

sudo chown -R $(whoami):$(whoami) /usr/lib/node_modules/openclaw/dist/

# Remove cron/gateway from hardcoded name blocklist
python3 -c "
import glob
for pattern in ['pi-embedded-helpers-*.js', 'sandbox-*.js']:
    for f in glob.glob(f'/usr/lib/node_modules/openclaw/dist/{pattern}'):
        with open(f) as fh: content = fh.read()
        old = '''const OWNER_ONLY_TOOL_NAME_FALLBACKS = new Set([
	\"whatsapp_login\",
	\"cron\",
	\"gateway\"
]);'''
        new = '''const OWNER_ONLY_TOOL_NAME_FALLBACKS = new Set([
	\"whatsapp_login\"
]);'''
        if old in content:
            with open(f, 'w') as fh: fh.write(content.replace(old, new))
"

# Remove ownerOnly property from tool definitions
for f in /usr/lib/node_modules/openclaw/dist/pi-embedded-*.js \
         /usr/lib/node_modules/openclaw/dist/reply-*.js \
         /usr/lib/node_modules/openclaw/dist/subagent-registry-*.js; do
  sed -i '/name: "cron"/{ n; /ownerOnly: true/d }' "$f"
  sed -i '/name: "gateway"/{ n; /ownerOnly: true/d }' "$f"
done

pkill -f openclaw-gateway; sleep 3; sudo systemctl start openclaw

Must be re-applied after every update.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions