fix(page-data): scope WeChat survey delivery when tool calls are hidden
Memind CI / Test, build, and release guards (push) Failing after 3s
Memind CI / Test, build, and release guards (push) Failing after 3s
Collect request-scoped tool messages in the WeChat SSE stream, infer this turn Page Data HTML via mtime when messages lack writes, and limit bind and delivery smoke to those paths so historical already_bound pages cannot block new surveys. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+6
-6
@@ -345,14 +345,16 @@ export async function executeSessionReply(
|
||||
const routingId = event.chat_request_id ?? event.request_id;
|
||||
if (routingId && routingId !== requestId) continue;
|
||||
|
||||
if (event.type === 'Message' && event.message?.metadata?.userVisible) {
|
||||
if (event.type === 'Message' && event.message) {
|
||||
const hasActionRequired = event.message.content?.some((item) => item.type === 'actionRequired');
|
||||
if (hasActionRequired) {
|
||||
throw new Error('当前回复需要人工确认,公众号通道暂不支持');
|
||||
}
|
||||
if (event.message.role === 'assistant') hasScopedAssistantUpdate = true;
|
||||
messages = pushMessage(messages, event.message);
|
||||
requestMessages = pushMessage(requestMessages, event.message);
|
||||
if (event.message?.metadata?.userVisible) {
|
||||
if (event.message.role === 'assistant') hasScopedAssistantUpdate = true;
|
||||
messages = pushMessage(messages, event.message);
|
||||
}
|
||||
} else if (event.type === 'UpdateConversation') {
|
||||
// Ignore unscoped snapshots until this request has yielded an assistant update.
|
||||
// Otherwise a stale session snapshot can overwrite the current reply with a
|
||||
@@ -1213,9 +1215,7 @@ async function enforcePageDataCollectDelivery({
|
||||
userId,
|
||||
reply: {
|
||||
text: String(reply?.text ?? ''),
|
||||
messages: Array.isArray(reply?.messages)
|
||||
? reply.messages
|
||||
: [],
|
||||
messages: replyRequestMessages(reply),
|
||||
},
|
||||
intent: {
|
||||
agentText: String(intent?.agentText ?? ''),
|
||||
|
||||
Reference in New Issue
Block a user