openclaw - 💡(How to fix) Fix [Feature Request] Matrix plugin should auto-accept room invitations [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#56300Fetched 2026-04-08 01:42:34
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
closed ×1commented ×1locked ×1

Code Example

// Listen for RoomMember.membership events
client.on('RoomMember.membership', (event, member) => {
  if (member.membership === 'invite' && member.userId === client.getUserId()) {
    // Check if auto-accept is allowed (whitelist, etc.)
    if (shouldAutoAcceptInvite(member)) {
      client.joinRoom(member.roomId);
    }
  }
});

---

{
  "matrix": {
    "autoAcceptInvites": true,
    "inviteWhitelist": ["@user1:example.com"],
    "inviteBlacklist": [],
    "autoAcceptDmInvites": true
  }
}
RAW_BUFFERClick to expand / collapse

Feature Request: Matrix plugin should auto-accept room invitations

Problem Description

The OpenClaw Matrix plugin lacks the ability to automatically accept room invitations, requiring users to manually log in to a Matrix client (like Element) to accept invitations before OpenClaw can participate in encrypted conversations.

Current Behavior

  1. When another Matrix user invites the OpenClaw Matrix account to join a room or start a DM
  2. OpenClaw does not automatically accept the invitation
  3. User must manually log in to Element using OpenClaw's Matrix account
  4. Manually accept the invitation in Element
  5. Only then can OpenClaw send/receive messages normally

Expected Behavior

OpenClaw Matrix plugin should:

  1. Auto-detect invitation events (m.room.member with invite membership)
  2. Auto-accept invitations to join rooms
  3. Provide configuration options for auto-accept behavior, whitelist, etc.

Technical Analysis

After reviewing the source code, no invitation handling logic was found in:

  • /extensions/matrix/index.js
  • /extensions/matrix/runtime-api.js

Proposed Implementation

// Listen for RoomMember.membership events
client.on('RoomMember.membership', (event, member) => {
  if (member.membership === 'invite' && member.userId === client.getUserId()) {
    // Check if auto-accept is allowed (whitelist, etc.)
    if (shouldAutoAcceptInvite(member)) {
      client.joinRoom(member.roomId);
    }
  }
});

Suggested Configuration Options

{
  "matrix": {
    "autoAcceptInvites": true,
    "inviteWhitelist": ["@user1:example.com"],
    "inviteBlacklist": [],
    "autoAcceptDmInvites": true
  }
}

Reproduction Steps

  1. Configure OpenClaw Matrix plugin
  2. Use another Matrix account to invite OpenClaw's account to a room
  3. Observe that OpenClaw does not automatically join the room
  4. Must manually log in to Element to accept the invitation

Impact

  • Poor UX - Requires manual intervention to establish conversations
  • Against automation philosophy - OpenClaw as an automation tool should handle invitations automatically
  • Blocks E2EE conversations - Without accepting invitations, encrypted conversations cannot proceed

Environment

  • OpenClaw Version: 2026.3.24
  • Matrix Plugin: Built-in version
  • OS: macOS

Additional Context

This issue was discovered after:

  1. Upgrading OpenClaw to 2026.3.24
  2. Fixing Matrix encryption WASM file issues
  3. Completing device verification and key backup restoration

Even with encryption working properly, the invitation issue persists.

Proposed Solutions

Option 1: Basic Auto-Accept (Recommended)

  • Add default auto-accept behavior
  • Auto-accept DM invitations
  • Make room invitations configurable

Option 2: Whitelist Mechanism

  • Only auto-accept invitations from specific users
  • Integrate with existing dm.allowFrom configuration

Option 3: CLI Tools

  • Add openclaw matrix invites list command to view pending invitations
  • Add openclaw matrix invites accept <room-id> command for manual acceptance

Contributor

This feedback is provided by OpenClaw user "豆爸" (DouBa), hoping to contribute to the open source community.


Priority: Medium-High
Labels: enhancement, matrix, good first issue

extent analysis

Fix Plan

To implement the auto-accept room invitations feature, follow these steps:

  1. Add event listener: Listen for RoomMember.membership events in /extensions/matrix/index.js.
  2. Check membership: Verify if the membership is an invite and if the user ID matches the client's user ID.
  3. Implement auto-accept logic: Call client.joinRoom(member.roomId) to accept the invitation if auto-accept is allowed.
  4. Add configuration options: Introduce configuration options for auto-accept behavior, whitelist, and blacklist in /extensions/matrix/runtime-api.js.

Example code:

// /extensions/matrix/index.js
client.on('RoomMember.membership', (event, member) => {
  if (member.membership === 'invite' && member.userId === client.getUserId()) {
    if (shouldAutoAcceptInvite(member)) {
      client.joinRoom(member.roomId);
    }
  }
});

// /extensions/matrix/runtime-api.js
function shouldAutoAcceptInvite(member) {
  const config = getConfig();
  if (config.matrix.autoAcceptInvites) {
    if (config.matrix.inviteWhitelist.includes(member.userId)) {
      return true;
    }
    if (config.matrix.inviteBlacklist.includes(member.userId)) {
      return false;
    }
    // Default to auto-accept if not in whitelist or blacklist
    return true;
  }
  return false;
}

// Configuration options
const config = {
  "matrix": {
    "autoAcceptInvites": true,
    "inviteWhitelist": ["@user1:example.com"],
    "inviteBlacklist": [],
    "autoAcceptDmInvites": true
  }
};

Verification

To verify the fix, follow these steps:

  1. Configure the OpenClaw Matrix plugin with auto-accept invites enabled.
  2. Use another Matrix account to invite OpenClaw's account to a room.
  3. Observe that OpenClaw automatically joins the room.

Extra Tips

  • Make sure to handle errors and edge cases when implementing the auto-accept logic.
  • Consider adding logging and monitoring to track invitation acceptance and any issues that may arise.
  • Review the configuration options and adjust them according to your specific use case.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING