Repository navigation
Description
Describe the bug
When a caller supplies an OutboundAddress with a nonblank threadId, Feishu's ordinary send path posts each message to the chat-level create-message endpoint. The receipt-based path for the same address uses the thread-reply endpoint. A caller using FeishuChannel.deliver(address, messages) can therefore send replies to the parent chat instead of the selected thread.
To Reproduce
- Use the loopback server in
FeishuOutboundClientTest. Return its normal token response and a successful send response ({"code":0,"data":{"message_id":"om-1"}}). Record the request URIs for the message endpoint. - Call
client.send(new OutboundAddress("feishu", null, "feishu:GROUP:chat-1", "om-root"), List.of(text("one"), text("two"))).block(). - Compare both outgoing request URIs with the expected thread reply. No Feishu account or network service is needed.
Expected behavior
Both requests should use POST /open-apis/im/v1/messages/om-root/reply, matching the supplied address and the existing receipt-based routing. Sending to an address without a thread should still create a chat message.
Error messages
No transport error is emitted. Both actual URIs were /open-apis/im/v1/messages?receive_id_type=chat_id. A regression assertion on the two URIs failed on main; the other two tests in the class passed.
Environment
- AgentScope Java 2.1.0-SNAPSHOT, main
b5159827fe5835489e6fb8a69dc582d26da53c65 - Java 17, Windows, Maven
mvn -B -T1C -pl :agentscope-extensions-channel-feishu -am -Dtest=FeishuOutboundClientTest -Dsurefire.failIfNoSpecifiedTests=false test
Additional context
OutboundAddress.threadId is documented as the context for threaded replies. In FeishuOutboundClient, ordinary sends call sendOneReceipt with a null thread, whereas sendWithReceipt passes address.threadId(). The smaller fix can reuse the existing reply builder. This reproduction supplies a threaded address explicitly and does not rely on inbound Feishu event mapping.
I am working on the fix and a loopback regression test and will submit the linked PR. Please assign this issue to me if assignment is required. AI assistance was used for investigation and testing.
Activity