WeKnora/internal/im/wecom
洛根 c0c194f625
fix(im/wecom): preserve image in mixed messages with text captions (#3901)
* fix(im/wecom): preserve image in mixed messages with text captions

convertMixedMessage discarded the image whenever a mixed (text+image)
message contained any text, so the most common shape — a question plus
a screenshot — reached the QA pipeline as text-only and the model never
saw the image, despite the IM integration docs promising images are
handled as QA attachments.

Keep the first image as the message attachment and carry the text as
its caption: the IM service already supports captioned images
(prepareIMAttachments downloads the file while fileMessageQAContent
preserves msg.Content as the query), so the adapter just has to emit
MessageTypeImage with Content set instead of MessageTypeText.

Text-only, image-only, and empty mixed messages keep their previous
behavior. Multiple images still collapse to the first one; supporting
several attachments requires a multi-attachment IncomingMessage and is
left out of this minimal fix.

* fix(im/wecom): wrap over-length line in mixed_test to satisfy lll lint
2026-10-08 01:25:25 +08:00
..
factory.go fix(im): harden connection lifecycle across replicas 2026-07-27 20:39:12 +08:00
longconn.go fix(im/wecom): preserve image in mixed messages with text captions (#3901) 2026-10-08 01:25:25 +08:00
longconn_close_test.go fix(im/wecom): scope connection close to its own generation 2026-08-06 12:26:00 +08:00
mention_test.go feat(im): support custom endpoints for private WeCom deployments 2026-04-13 22:54:42 +08:00
mixed_test.go fix(im/wecom): preserve image in mixed messages with text captions (#3901) 2026-10-08 01:25:25 +08:00
quote.go fix(im): anti-hallucination for non-text quotes and unprocessable media messages 2026-04-03 11:34:22 +08:00
quote_test.go feat(memory): add cross-session long-term memory 2026-08-13 18:00:02 +08:00
reconnect_test.go fix(im): clamp reconnect backoff to avoid int64 overflow → busy loop 2026-05-05 00:36:18 +08:00
webhook_adapter.go fix(im): handle WeCom 32-byte PKCS7 padding (#2848) 2026-08-28 15:40:42 +08:00
webhook_adapter_test.go fix(im): handle WeCom 32-byte PKCS7 padding (#2848) 2026-08-28 15:40:42 +08:00
ws_adapter.go feat(im): align agent stream display with web thinking and tool progress 2026-06-24 10:33:55 +08:00