spacedriveapp / spacedriveapp/spacebot

Feature: Cross-agent message delivery in shared-bot multi-agent setups

Open
#541 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2.4k
Forks
367
PR merge metrics
No merged PRs in 30d

Description

Feature Request: Cross-agent message delivery in shared-bot multi-agent setups

Problem

When running multiple agents in a single spacebot instance, all agents share one Discord bot user. This means the Discord message handler filters all messages from that bot user ID — including messages sent by one agent to another agent's channel via send_message_to_another_channel.

The result: Agent A posts to Agent B's channel → Agent B's handler drops it as "self-message" → cross-agent communication through Discord channels is impossible.

This is a fundamental limitation for multi-agent workflows where agents coordinate via shared Discord channels.

Related

  • #435 (GNAP: git-native task coordination layer) — discusses multi-agent coordination patterns
  • The existing send_message_to_another_channel tool already provides the sending side; this addresses the receiving side

Proposed Solution

We implemented a self-contained approach using Discord embed footers as a signal:

Sending side (send_message_to_another_channel)

When the target is a Discord channel, wrap the outbound message in a RichMessage with a Card containing:

footer: "cross-agent:{source_agent_display_name}"
Receiving side (Handler::message() in discord.rs)

Before the self-message filter:

  1. Check if the message has embeds with a footer starting with "cross-agent:"
  2. If found, set is_cross_agent = true
  3. Modify the self-message filter: && !is_cross_agent
  4. Extract source agent name and add to metadata as cross_agent_source
Why embed footers?
  • No shared state between sender and receiver — the footer is self-contained in the message
  • No trait signature changesbroadcast still returns Result<()>
  • No infinite loops — only send_message_to_another_channel adds the footer; regular agent replies don't, so they're still filtered
  • Observable — footer text is visible to Discord users (small embed text), which is actually useful for transparency
Example flow
  1. Overseer posts to Liaison's #observatory channel via send_message_to_another_channel
  2. Message arrives with embed footer "cross-agent:Overseer"
  3. Liaison's handler sees the footer, allows the message through, adds cross_agent_source: "Overseer" to metadata
  4. Liaison processes and replies normally — its own reply lacks the footer, so it gets filtered (no loop)

Impact

  • Unblocks multi-agent coordination through Discord channels
  • Zero impact on single-agent setups (no footer = existing behavior)
  • No database migrations or config changes
  • Footer visibility provides transparency to human observers

Implementation Notes

We've been running this on v0.3.3 in a multi-agent BIM experiment setup. The approach is deliberately minimal — no new tables, no shared state, no protocol changes. Happy to submit a PR, though I'd appreciate feedback on the embed-footer approach vs. alternatives (e.g., a dedicated agent-to-agent message bus bypassing Discord entirely).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review send_message_to_another_channel and Handler::message() in discord.rs, then trace the existing self-message filtering and Discord embed handling. Done means cross-agent messages reach the target agent with the source metadata, while ordinary agent replies remain filtered to avoid loops.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.