From 235ca0971e7eaf2aee3582398415ca2b97940765 Mon Sep 17 00:00:00 2001 From: john Date: Sat, 27 Jun 2026 18:33:53 +0800 Subject: [PATCH] fix: reconcile reused wechat agent sessions --- wechat-mp.mjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wechat-mp.mjs b/wechat-mp.mjs index f034a64..16848cf 100644 --- a/wechat-mp.mjs +++ b/wechat-mp.mjs @@ -1658,6 +1658,7 @@ export function createWechatMpService({ tolerateInvalidWorkingDir: true, }, ); +<<<<<<< HEAD const routeHasTools = await sessionHasRequiredTools( fetchForSession, existingRoute.agentSessionId, @@ -1694,9 +1695,9 @@ export function createWechatMpService({ throw new Error('公众号专属 Agent 会话创建失败'); } - if (!startAgentSession && typeof userAuth.registerAgentSession === 'function') { - await userAuth.registerAgentSession(userId, sessionId); - } + // `/agent/start` already persists the owning user and goosed node via the + // portal proxy. Re-registering here without the node can overwrite the + // correct mapping back to node 0 in multi-goosed production. await reconcileAgentSession( (pathname, init) => fetchForSession(sessionId, pathname, init), sessionId,