diff --git a/tkmind-proxy.mjs b/tkmind-proxy.mjs index 43e4e70..512f084 100644 --- a/tkmind-proxy.mjs +++ b/tkmind-proxy.mjs @@ -1572,7 +1572,7 @@ export function createTkmindProxy({ : null, }, ); - await applySessionLlmProvider(session.id, { userId }); + await applySessionLlmProvider(session.id, { userId, intentKind: 'agent_orchestration' }); return session; } @@ -2053,7 +2053,14 @@ export function createTkmindProxy({ forceDeepReasoning, disableImageReading: disableImageReading || visionHandlesThisTurn, }); - await applySessionLlmProvider(sessionId, { userId }); + await applySessionLlmProvider(sessionId, { + userId, + intentKind: + userMessage?.metadata?.memindRun?.rainHandoff === true + || userMessage?.metadata?.memindRun?.rainMode === true + ? 'rain' + : 'agent_orchestration', + }); await repairSessionToolHistory(sessionId); const user = await userAuth.getUserById(userId); @@ -2432,7 +2439,10 @@ export function createTkmindProxy({ }); return; } - await applySessionLlmProvider(session.id, { userId: req.currentUser.id }); + await applySessionLlmProvider(session.id, { + userId: req.currentUser.id, + intentKind: 'agent_orchestration', + }); } res.status(upstream.status).json(session); } catch (err) { @@ -2517,7 +2527,10 @@ export function createTkmindProxy({ } } - await applySessionLlmProvider(sessionId, { userId: req.currentUser.id }); + await applySessionLlmProvider(sessionId, { + userId: req.currentUser.id, + intentKind: 'agent_orchestration', + }); res.status(upstream.status).json(payload); } catch (err) { diff --git a/wechat-cursor-executor-policy.mjs b/wechat-cursor-executor-policy.mjs index f25df71..dd013c5 100644 --- a/wechat-cursor-executor-policy.mjs +++ b/wechat-cursor-executor-policy.mjs @@ -43,6 +43,8 @@ export function resolveCursorChatBridgeEligible({ // WeChat Goose sessions always carry tools; the bridge PoC rejects tool calls. if (normalizedChannel === CURSOR_EXECUTOR_CHANNEL.WECHAT_MP) return false; if (String(intentKind ?? '').trim() === 'page.generate') return false; + // Bridge is text-only: only explicit direct-chat intents; agent / rain / empty → DeepSeek. + if (String(intentKind ?? '').trim() !== 'chat.general') return false; if (!isChannelAllowedByCursorPolicy(normalizedChannel || CURSOR_EXECUTOR_CHANNEL.H5, policy)) { return false; } diff --git a/wechat-cursor-executor-policy.test.mjs b/wechat-cursor-executor-policy.test.mjs index 04b98c0..80a3612 100644 --- a/wechat-cursor-executor-policy.test.mjs +++ b/wechat-cursor-executor-policy.test.mjs @@ -220,6 +220,26 @@ test('resolveCursorChatBridgeEligible is disabled for WeChat MP and page.generat }), true, ); + assert.equal( + resolveCursorChatBridgeEligible({ + user: { userId: 'john-uuid' }, + channel: CURSOR_EXECUTOR_CHANNEL.H5, + intentKind: '', + policy, + env: { MEMIND_CURSOR_CHAT_BRIDGE_ENABLED: '1' }, + }), + false, + ); + assert.equal( + resolveCursorChatBridgeEligible({ + user: { userId: 'john-uuid' }, + channel: CURSOR_EXECUTOR_CHANNEL.H5, + intentKind: 'rain', + policy, + env: { MEMIND_CURSOR_CHAT_BRIDGE_ENABLED: '1' }, + }), + false, + ); }); test('isChannelAllowedByCursorPolicy defaults to both channels', () => {