mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:50:43 +00:00
fix(discord): document mention formatting guidance (#75173)
Summary: - This PR adds Discord outbound mention-format guidance to the Discord plugin prompt hints, Discord channel docs, a focused channel test, and the changelog. - Reproducibility: not applicable. as a runtime bug reproduction. There is a high-confidence inspection path: ... lacks the guidance, while the existing formatter/tests and Discord reference establish the expected syntax. ClawSweeper fixups: - Included follow-up commit: fix(discord): document mention formatting guidance Validation: - ClawSweeper review passed for headbf2734a002. - Required merge gates passed before the squash merge. Prepared head SHA:bf2734a002Review: https://github.com/openclaw/openclaw/pull/75173#issuecomment-4354537199 Co-authored-by: Peter Steinberger <steipete@gmail.com> Co-authored-by: clawsweeper-repair <clawsweeper-repair@users.noreply.github.com> Co-authored-by: Peter Steinberger <58493+steipete@users.noreply.github.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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).
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -213,6 +213,7 @@ export const discordPlugin: ChannelPlugin<ResolvedDiscordAccount, DiscordProbe>
|
||||
},
|
||||
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.",
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user