Skip to content

feat: allow bot-to-bot messaging via configurable allowlist #243

@chengli

Description

@chengli

Description

openab currently hard-rejects all messages from other bots (msg.author.bot → return in discord.rs:41-43). This is a sensible default to prevent loops, but it blocks a legitimate and increasingly common architecture: a dispatcher bot that routes tasks to openab worker agents.

Proposed change

Add an allowed_bots_from config option that accepts a list of bot user IDs whose messages should be processed instead of ignored:

[discord]
allowed_bots_from = ["123456789012345678"]

The bot filter logic would become:

if msg.author.bot {
    // Self-loop guard: never process own messages
    if msg.author.id == bot_id {
        return;
    }
    // Allow explicitly trusted bots
    if !self.allowed_bots_from.contains(&msg.author.id.to_string()) {
        return;
    }
}

When allowed_bots_from is empty (default), behavior is identical to today — all bot messages are rejected.

Use Case

In a multi-agent setup, a central dispatcher bot creates threads, assigns tasks, and @mentions specific openab agents. Without bot-to-bot messaging, this workflow is impossible — the dispatcher's mentions are silently ignored.

An allowlist approach (rather than a blanket "accept all bots" flag) keeps the default safe:

  • Only explicitly trusted bot IDs are accepted
  • Self-loop guard prevents an agent from processing its own messages, even if misconfigured
  • Unrelated bots in the same server cannot accidentally trigger agents

This pattern is used in production multi-agent deployments today via a fork, and upstreaming it would benefit anyone building dispatcher/worker architectures with openab.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions