From 12c24651a26c86e78bbffb551e8368c6b7e320c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=80=AA=E7=A8=8B=E4=BC=9F?= Date: Tue, 9 Jun 2026 10:40:26 +0800 Subject: [PATCH] docs(webchat): clarify agentId is pinned at conversation creation The WebChat stream endpoint resolves agentId only when the (visitorId + sessionId) conversation is first created; later requests with a different agentId reuse the existing conversation's agent and silently ignore the new value. Document this on WebChatRequest.agentId so integrators know to use a new sessionId to reach another agent. --- .../java/vip/mate/channel/webchat/WebChatController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mateclaw-server/src/main/java/vip/mate/channel/webchat/WebChatController.java b/mateclaw-server/src/main/java/vip/mate/channel/webchat/WebChatController.java index 1627af07..bb44c163 100644 --- a/mateclaw-server/src/main/java/vip/mate/channel/webchat/WebChatController.java +++ b/mateclaw-server/src/main/java/vip/mate/channel/webchat/WebChatController.java @@ -328,7 +328,10 @@ public class WebChatController { private String message; private String visitorId; /** Optional: route this call to a specific agent instead of the channel's bound agent. - * Must belong to the channel's workspace. */ + * Must belong to the channel's workspace. + *

Only applied when the (visitorId + sessionId) conversation is first created. Once that + * conversation exists, its agent is fixed: a different agentId on later requests is silently + * ignored. To talk to another agent, use a new sessionId (or a new visitorId). */ private Long agentId; /** Optional: open a distinct conversation thread for the same visitor. * Composed into the server-derived conversationId; never used as a raw conversationId. */