fix: buildThinkingUserPrompt嵌套锁死锁 + 管理员群聊路由优化

- thinker.go:1662/1762 defer t.muUnlock→立即解锁,消除buildThinkingUserPrompt自死锁
  (1662持锁后1762再Lock→同goroutine自死锁→23h锁泄露→3769 goroutine泄漏)
- platform-bridge: 管理员在群里@别人走group_ambient而非normal,避免频繁插嘴
This commit is contained in:
2026-06-30 12:41:24 +08:00
parent 88755e131a
commit ddb1120ee1
2 changed files with 12 additions and 4 deletions
@@ -1660,8 +1660,8 @@ func (t *Thinker) buildThinkingUserPrompt(
sb.WriteString("刚有人和你聊完天。你想自然地在心里回味一下刚才的对话……\n")
case "silence":
t.muLock()
defer t.muUnlock()
silenceDuration := time.Since(t.lastUserTime())
t.muUnlock()
sb.WriteString(fmt.Sprintf("已经大约 %s 没有说话了。你有点想知道大家在做什么……\n",
formatDurationHuman(silenceDuration)))
@@ -1760,7 +1760,7 @@ func (t *Thinker) buildThinkingUserPrompt(
// OBv11 platform identity and available channels for proactive messaging.
t.muLock()
defer t.muUnlock()
t.muUnlock()
qqChannels := t.platformChannels
botUIDs := t.botUIDs
activeSID := t.activeSessionID