From b67473e66e456e87951cfc5a1e68417085af0618 Mon Sep 17 00:00:00 2001 From: aishannon Date: Sun, 15 Mar 2026 19:15:13 +0800 Subject: [PATCH] 1. fix seq reset. 2. remove SendMarkdown config --- pkg/channels/qq/qq.go | 8 +++++--- pkg/config/config.go | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/channels/qq/qq.go b/pkg/channels/qq/qq.go index 532d05178..79dc81030 100644 --- a/pkg/channels/qq/qq.go +++ b/pkg/channels/qq/qq.go @@ -37,7 +37,7 @@ const ( dedupInterval = 60 * time.Second dedupMaxSize = 10000 // hard cap on dedup map entries typingResend = 8 * time.Second - typingSeconds = 20 + typingSeconds = 10 ) var emojiRegexp = regexp.MustCompile(`<[^<]*?ext="([^"]+)"[^<]*?faceType=(\d+)[^<]*?>|<[^<]*?faceType=(\d+)[^<]*?ext="([^"]+)"[^<]*?>`) @@ -57,6 +57,8 @@ type QQChannel struct { // Passive reply: store last inbound message ID per chat. lastMsgID sync.Map // chatID → string + // 消息回复时API时的SEQ,用于回复时去重 + // 被动回复: 同一个chatID+replyMsgID+seq 去重。 主动回复:不限制。 replySeq atomic.Uint32 seqLock sync.Mutex @@ -248,9 +250,9 @@ func (c *QQChannel) getReplyExtInfo(ctx context.Context, chatID string) (replyID defer c.seqLock.Unlock() seq = c.replySeq.Add(1) if seq > math.MaxInt32 { - c.replySeq.Store(1) + c.replySeq.Store(0) + seq = c.replySeq.Add(1) } - return replyID, seq } diff --git a/pkg/config/config.go b/pkg/config/config.go index 2937c36e4..41393fbc7 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -353,7 +353,6 @@ type QQConfig struct { AllowFrom FlexibleStringSlice `json:"allow_from" env:"PICOCLAW_CHANNELS_QQ_ALLOW_FROM"` GroupTrigger GroupTriggerConfig `json:"group_trigger,omitempty"` MaxMessageLength int `json:"max_message_length" env:"PICOCLAW_CHANNELS_QQ_MAX_MESSAGE_LENGTH"` - SendMarkdown bool `json:"send_markdown" env:"PICOCLAW_CHANNELS_QQ_SEND_MARKDOWN"` ReasoningChannelID string `json:"reasoning_channel_id" env:"PICOCLAW_CHANNELS_QQ_REASONING_CHANNEL_ID"` }