mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-20 07:17:29 +08:00
fix: harden telegram streaming finalize and resolve session lock-copy vet issue
This commit is contained in:
@@ -1760,7 +1760,8 @@ func rewriteSystemMessageContent(content, template string) string {
|
|||||||
func alSessionListForTool(sm *session.SessionManager, limit int) []tools.SessionInfo {
|
func alSessionListForTool(sm *session.SessionManager, limit int) []tools.SessionInfo {
|
||||||
items := sm.List(limit)
|
items := sm.List(limit)
|
||||||
out := make([]tools.SessionInfo, 0, len(items))
|
out := make([]tools.SessionInfo, 0, len(items))
|
||||||
for _, s := range items {
|
for i := range items {
|
||||||
|
s := &items[i]
|
||||||
out = append(out, tools.SessionInfo{
|
out = append(out, tools.SessionInfo{
|
||||||
Key: s.Key,
|
Key: s.Key,
|
||||||
Kind: s.Kind,
|
Kind: s.Kind,
|
||||||
|
|||||||
@@ -1068,7 +1068,7 @@ func (c *TelegramChannel) deleteTelegramMessageWithRetry(ctx context.Context, ch
|
|||||||
|
|
||||||
func (c *TelegramChannel) handleAction(ctx context.Context, chatID int64, action string, msg bus.OutboundMessage) error {
|
func (c *TelegramChannel) handleAction(ctx context.Context, chatID int64, action string, msg bus.OutboundMessage) error {
|
||||||
messageID, ok := parseTelegramMessageID(msg.MessageID)
|
messageID, ok := parseTelegramMessageID(msg.MessageID)
|
||||||
if !ok && action != "send" && action != "stream" {
|
if !ok && action != "send" && action != "stream" && action != "finalize" {
|
||||||
return fmt.Errorf("message_id required for action=%s", action)
|
return fmt.Errorf("message_id required for action=%s", action)
|
||||||
}
|
}
|
||||||
switch action {
|
switch action {
|
||||||
|
|||||||
Reference in New Issue
Block a user