fix(rain): keep Goose agent turns on DeepSeek, not Cursor chat bridge.
Memind CI / Test, build, and release guards (push) Failing after 13m25s
Memind CI / Test, build, and release guards (push) Failing after 13m25s
Cursor bridge PoC rejects tool calls; Rain and other agent sessions must not apply it during session provider selection. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+17
-4
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user