diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c0ce75c02e..cfa7fb2f3a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -244,6 +244,7 @@ Docs: https://docs.openclaw.ai - Agents/tools: let plugins declare media generation auth aliases and base-url guards in manifests, preserving OpenAI Codex OAuth image generation availability without core-owned provider special cases. Thanks @shakkernerd. - Agents/tools: reuse the auth profile store already loaded for the active run when deciding media and generation tool availability, avoiding repeated provider-auth runtime discovery during reply startup. Thanks @shakkernerd. - Agents/tools: keep image, video, and music generation tool registration on manifest/auth control-plane checks instead of loading runtime provider registries during reply startup, reducing live-path tool-prep blocking while leaving provider runtime resolution for execution and list actions. Thanks @shakkernerd. +- Discord: document canonical mention formatting in agent prompt hints and channel docs so outbound replies use `<@USER_ID>`, `<#CHANNEL_ID>`, and `<@&ROLE_ID>` instead of legacy nickname mentions. (#75173) - fix: block workspace CLOUDSDK_PYTHON override and always set trusted interpreter for gcloud. (#74492) Thanks @pgondhi987. - Providers/Z.AI: move the bundled GLM catalog and auth env metadata into the plugin manifest, so `models list --all --provider zai` shows the full known catalog without duplicated runtime seed data. Thanks @shakkernerd. - Providers/Qianfan and Providers/Stepfun: declare setup auth metadata (`api-key` method, `QIANFAN_API_KEY`, `STEPFUN_API_KEY`) in the plugin manifest so onboarding and `models setup` surface the expected env var without falling back to legacy `providerAuthEnvVars` runtime seed data. Thanks @shakkernerd. diff --git a/docs/channels/discord.md b/docs/channels/discord.md index ac324dcd426..ba95ef8376f 100644 --- a/docs/channels/discord.md +++ b/docs/channels/discord.md @@ -579,6 +579,8 @@ Example: - configured mention patterns (`agents.list[].groupChat.mentionPatterns`, fallback `messages.groupChat.mentionPatterns`) - implicit reply-to-bot behavior in supported cases + When writing outbound Discord messages, use canonical mention syntax: `<@USER_ID>` for users, `<#CHANNEL_ID>` for channels, and `<@&ROLE_ID>` for roles. Do not use the legacy `<@!USER_ID>` nickname mention form. + `requireMention` is configured per guild/channel (`channels.discord.guilds...`). `ignoreOtherMentions` optionally drops messages that mention another user/role but not the bot (excluding @everyone/@here). diff --git a/extensions/discord/src/channel.test.ts b/extensions/discord/src/channel.test.ts index 60563c66e26..696dbeb506d 100644 --- a/extensions/discord/src/channel.test.ts +++ b/extensions/discord/src/channel.test.ts @@ -119,6 +119,14 @@ describe("discordPlugin outbound", () => { expect(discordPlugin.outbound?.preferFinalAssistantVisibleText).toBe(true); }); + it("adds Discord mention formatting to agent prompt hints", () => { + const hints = discordPlugin.agentPrompt?.messageToolHints?.({} as never) ?? []; + + expect(hints).toContain( + "- Discord mentions: use canonical outbound syntax: users `<@USER_ID>`, channels `<#CHANNEL_ID>`, and roles `<@&ROLE_ID>`. Do not use the legacy `<@!USER_ID>` nickname form.", + ); + }); + it("preserves normalized explicit Discord targets for delivery routing", () => { const parseExplicitTarget = discordPlugin.messaging?.parseExplicitTarget; if (!parseExplicitTarget) { diff --git a/extensions/discord/src/channel.ts b/extensions/discord/src/channel.ts index 4a373828c55..2738e47d586 100644 --- a/extensions/discord/src/channel.ts +++ b/extensions/discord/src/channel.ts @@ -213,6 +213,7 @@ export const discordPlugin: ChannelPlugin }, agentPrompt: { messageToolHints: () => [ + "- Discord mentions: use canonical outbound syntax: users `<@USER_ID>`, channels `<#CHANNEL_ID>`, and roles `<@&ROLE_ID>`. Do not use the legacy `<@!USER_ID>` nickname form.", "- Discord components: set `components` when sending messages to include buttons, selects, or v2 containers.", "- Forms: add `components.modal` (title, fields). OpenClaw adds a trigger button and routes submissions as new messages.", ],