fix: isolate WeChat runtime delivery path

This commit is contained in:
john
2026-07-28 09:33:25 +08:00
parent 5a13950bc3
commit 7f9453433c
8 changed files with 226 additions and 9 deletions
+7 -1
View File
@@ -1430,6 +1430,7 @@ export function createTkmindProxy({
sessionPolicy = null,
recipe = null,
disableImageReading = false,
origin = 'h5',
} = {},
) {
const resolvedWorkingDir = workingDir ?? await userAuth.resolveWorkingDir(userId);
@@ -1458,7 +1459,12 @@ export function createTkmindProxy({
throw new Error('创建会话失败:缺少 session id');
}
await rememberSessionTarget(session.id, startTarget);
await sessionStore.registerAgentSession(userId, session.id, startTarget);
await sessionStore.registerSession({
userId,
sessionId: session.id,
target: startTarget,
origin: origin === 'wechat' ? 'wechat' : 'h5',
});
const baseSessionScopedPolicy =
typeof userAuth.getAgentSessionPolicy ===
'function'