fix: reconcile reused wechat agent sessions
This commit is contained in:
+4
-3
@@ -1658,6 +1658,7 @@ export function createWechatMpService({
|
|||||||
tolerateInvalidWorkingDir: true,
|
tolerateInvalidWorkingDir: true,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
<<<<<<< HEAD
|
||||||
const routeHasTools = await sessionHasRequiredTools(
|
const routeHasTools = await sessionHasRequiredTools(
|
||||||
fetchForSession,
|
fetchForSession,
|
||||||
existingRoute.agentSessionId,
|
existingRoute.agentSessionId,
|
||||||
@@ -1694,9 +1695,9 @@ export function createWechatMpService({
|
|||||||
throw new Error('公众号专属 Agent 会话创建失败');
|
throw new Error('公众号专属 Agent 会话创建失败');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!startAgentSession && typeof userAuth.registerAgentSession === 'function') {
|
// `/agent/start` already persists the owning user and goosed node via the
|
||||||
await userAuth.registerAgentSession(userId, sessionId);
|
// portal proxy. Re-registering here without the node can overwrite the
|
||||||
}
|
// correct mapping back to node 0 in multi-goosed production.
|
||||||
await reconcileAgentSession(
|
await reconcileAgentSession(
|
||||||
(pathname, init) => fetchForSession(sessionId, pathname, init),
|
(pathname, init) => fetchForSession(sessionId, pathname, init),
|
||||||
sessionId,
|
sessionId,
|
||||||
|
|||||||
Reference in New Issue
Block a user