Skip to content

Discord: a mention of the app's own managed role is silently ignored #1615

Closed

Description

@DoodleBears

Problem

In Discord, typing @<app name> offers two entries with the same name: the app's bot user and the managed role Discord creates for that app. Picking the role looks the same in the sent message, but the bound PersonaBot is never woken and nobody is told why.

This is the root cause of #1609. The Host does not lose the message; it never counted as a mention of the app.

What happens today

  • The Provider (@xmanrui/dsh-im 4.32.0, pin 1eee207c) sets mentionedAccount from the native mentions array only, which lists users. A role mention is in mention_roles, so mentionedAccount is false.
  • When the app has the Message Content intent, the Provider still forwards the message as ordinary channel text. Its received counter goes up and the Host returns accepted.
  • The Host treats a group event with mentionedAccount: false as context only (packages/core/src/messaging/inbound.ts, default traffic). With no Conversation ingest for that channel it writes nothing: no implicit conversation entry, no Source Event, no Inbox admission, no log line.
  • A mention of the bot user in the same channel is admitted and answered normally.

ADR-0128 says the mention path "does not infer direct addressing from role mentions, display names or @everyone". That rule is right for ordinary roles, which can have many members. It does not discuss the app's own managed role, which belongs to exactly one app.

Evidence

Reproduced on an isolated Host built from main at be7fb070 with DSH 0.2.0-rc.2, using temporary trace logging in the default-traffic path:

Mention chosen mentionedAccount User mentions in event Result
Managed role of the app false 0 Accepted, nothing written, no reply
Bot user of the app true 1 Implicit entry created, admitted, replied

The same behaviour was seen on the long-run validation Host at tags long-run-v1 and long-run-v2.

Proposed behaviour

  • A mention of the app's own managed role counts as a mention of the app. Discord marks that role with tags.bot_id equal to the app's bot user id, so the check is exact.
  • Mentions of any other role and @everyone / @here keep today's behaviour.
  • If the role mention is not accepted as addressing, the message should at least not look received: either no received count, or a visible reason in the app's reception state.

Where the change goes

  • mentionedAccount is decided in the Provider (normalizeDiscordHumanText and #acceptExternalMessage in the Discord runtime). The Host only sees the result and has no role data, so the main change is in dsh-im.
  • This repository then needs a new qualified Provider pin (scripts/dev-im-provider.mjs), an update to ADR-0128, and a Discord verification record for the role-mention case.
  • A Discord connection guide does not exist yet; whichever behaviour is chosen, it should say which @ entry to pick.

Acceptance

  • Mentioning the app's managed role in a guild channel wakes the bound Bot and it replies in place.
  • Mentioning an unrelated role that the app's member holds does not wake the Bot.
  • @everyone and @here do not wake the Bot.
  • ADR-0128 records the decision.

Refs #1609, #1593

Activity

  1. DoodleBears commented on Oct 15, 2026

    @DoodleBears
    ContributorAuthor

    Agent work claim

    • Agent: Codex
    • Task: codex/local/01a13902-0d72-7872-ac0f-440e152155d5 (not a DSH Session).
    • Issue scope: Discord: a mention of the app's own managed role is silently ignored #1615 — trusted own managed-role mention recognition in the maintained Discord Provider, public-boundary regression, immutable Core/product pin integration, ADR-0128 clarification and genuine own-location Discord qualification. Other roles and everyone/here remain non-addressing. No additional receiver, policy store or platform permission is introduced.
    • Branch: codex/1615-discord-managed-role (Core and maintained Provider).
    • Started: 2026-10-16 UTC.
    • State: active.
    • Preflight: current issue has no claims; no open matching implementation PR was found. Human requested advancing the suggested Discord: a mention of the app's own managed role is silently ignored #1615 fix before the Bridge tracer: Lark file cards with download and safe open-with #1022 media tracer. No production receiver switch, unrelated stack restart, global release, merge or deployment authorization is inferred for this new slice. Native QA will use a verified designated test destination and an exclusive authorized receiver.
  2. added
    agent:activeOne or more coding-agent tasks currently claim this issue; see claim comments for task IDs
    ready-for-agentFully specified, ready for an AFK agent
    and removed
    needs-triageMaintainer needs to evaluate this issue
    on Oct 15, 2026
  3. DoodleBears commented on Oct 15, 2026

    @DoodleBears
    ContributorAuthor

    Agent work progress — native installed-product acceptance passed

    Task: codex/local/01a13902-0d72-7872-ac0f-440e152155d5 (not a DSH Session). Date: 2026-10-16 JST. State: active; review presentation and feedback still pending.

    The Human confirmed registered Discord QA1 was idle and requested testing through the built-in browser. The actual six-tarball 1.3.0-test.1615.1 candidate, Provider .22 at 1fc80010ab7cfd10ecc4f63c1d46c098e829c6a6, ran in an isolated Host with official DeepSeek Flash.

    • Native Bot-user B marker: one rendered USER_OK and one source-referencing accepted Outbox.
    • Native own-managed-role B marker: one rendered ROLE_OK and one source-referencing accepted Outbox; zero user mentions in the native message and canonical Source.
    • Unrelated unmanaged role held by the Bot, with zero permissions: no new Source, Admission, Outbox or model usage.
    • Native @everyone and @here: same negative result. Provider reception and native readback confirmed all three messages were actually received.
    • Temporary role deleted and original native role/member state verified. Exact task-owned receiver stopped before its cutoff; QA1 returned to idle. No pre-existing receiver or App permission was changed.

    Full verification record, Core draft #1927, maintained Provider draft #30.

    Provider affected tests 96/96, shared/other-platform tests 286/286, integrated Core/packaging tests 80/80 and integration CI passed. The latest documentation-only commit has a separate CI run. Private native facts/screenshots/recording remain machine-local; a matched base/candidate visual pair and GitHub-rendered review images are still owed. A local HTML explainer is bound to Core head 20f533999d05ca2efd17d0fe707a9de27b386ac4 and Provider head 1fc80010ab7cfd10ecc4f63c1d46c098e829c6a6; it is not reviewer-hosted or runtime evidence. Neither PR has been merged, globally published or deployed.

  4. added this to the v2.0 milestone on Oct 24, 2026
  5. DoodleBears commented on Nov 3, 2026

    @DoodleBears
    ContributorAuthor

    Fixed by #1927 with BotHarness/dsh-im#30 and verified on Discord QA1 (2026-11-02). Ships with Provider 4.32.0-botharness.26.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:activeOne or more coding-agent tasks currently claim this issue; see claim comments for task IDsfeature:messagingMessaging module and external providersready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions