mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-08-14 12:26:04 +00:00
fix: Strip bot self-mention in Discord responses and remove AGENTS.md from summoning modal
Discord: include sender's mention format in [From:] annotation so models use the correct user ID, and strip the bot's own @mention from message content to prevent the model from echoing it back. Summoning modal: remove AGENTS.md from progress list since backend only generates SOUL.md and IDENTITY.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
42263e5cc5
commit
2f44e86ef2
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -330,10 +331,14 @@ func (c *Channel) handleMessage(_ *discordgo.Session, m *discordgo.MessageCreate
|
||||
c.placeholders.Store(m.ID, placeholder.ID)
|
||||
}
|
||||
|
||||
// Strip bot @mention from content — it's just the trigger, not meaningful.
|
||||
content = strings.ReplaceAll(content, "<@"+c.botUserID+">", "")
|
||||
content = strings.TrimSpace(content)
|
||||
|
||||
// Build final content with group context.
|
||||
finalContent := content
|
||||
if peerKind == "group" {
|
||||
annotated := fmt.Sprintf("[From: %s]\n%s", senderName, content)
|
||||
annotated := fmt.Sprintf("[From: %s (<@%s>)]\n%s", senderName, senderID, content)
|
||||
if c.historyLimit > 0 {
|
||||
finalContent = c.groupHistory.BuildContext(channelID, annotated, c.historyLimit)
|
||||
} else {
|
||||
|
||||
@@ -21,7 +21,6 @@ interface SummoningModalProps {
|
||||
const SUMMONING_FILES = [
|
||||
{ name: "SOUL.md", label: "Soul & Personality" },
|
||||
{ name: "IDENTITY.md", label: "Identity Card" },
|
||||
{ name: "AGENTS.md", label: "Operating Instructions" },
|
||||
];
|
||||
|
||||
export function SummoningModal({
|
||||
|
||||
Reference in New Issue
Block a user