feat(dingtalk): stabilize multimodal answer workflows

This commit is contained in:
姚章浩
2026-09-09 13:57:43 +08:00
parent 18c81232ce
commit 0798a2dac7
46 changed files with 2309 additions and 195 deletions
+6 -2
View File
@@ -2,6 +2,7 @@ package dingtalk
import (
"context"
"reflect"
"strings"
"sync"
"testing"
@@ -186,7 +187,7 @@ func TestBotCallbackFromSDK(t *testing.T) {
SessionWebhook: "https://oapi.dingtalk.com/robot/sendBySession?session=abc",
Text: " 你好 ",
}
if cb != want {
if !reflect.DeepEqual(cb, want) {
t.Fatalf("BotCallbackFromSDK() = %+v, want %+v", cb, want)
}
})
@@ -450,7 +451,7 @@ func TestBotCallbackFromSDKRichText(t *testing.T) {
}
})
t.Run("first non-empty downloadCode used, subsequent ignored", func(t *testing.T) {
t.Run("all picture downloadCodes collected in order", func(t *testing.T) {
t.Parallel()
data := &chatbot.BotCallbackDataModel{
ConversationType: "1",
@@ -468,6 +469,9 @@ func TestBotCallbackFromSDKRichText(t *testing.T) {
if cb.DownloadCode != "code-first" {
t.Fatalf("DownloadCode = %q, want first code-first", cb.DownloadCode)
}
if len(cb.DownloadCodes) != 2 || cb.DownloadCodes[0] != "code-first" || cb.DownloadCodes[1] != "code-second" {
t.Fatalf("DownloadCodes = %+v, want [code-first code-second]", cb.DownloadCodes)
}
})
t.Run("picture item missing downloadCode still picture", func(t *testing.T) {