Skip Cursor Chat Bridge for WeChat MP and page.generate sessions.
Memind CI / Test, build, and release guards (push) Failing after 5m45s
Memind CI / Test, build, and release guards (push) Failing after 5m45s
WeChat Goose turns always include tools, which the bridge PoC rejects with HTTP 501; keep Kimi/DeepSeek on the session while Cursor handles page execution separately. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
import {
|
||||
CURSOR_EXECUTOR_CHANNEL,
|
||||
resolveCursorChannelEligible,
|
||||
resolveCursorChatBridgeEligible,
|
||||
resolveCursorScheduledTaskEligible,
|
||||
resolveWechatCursorExecutorEligible,
|
||||
} from './wechat-cursor-executor-policy.mjs';
|
||||
@@ -178,6 +179,49 @@ test('H5 channel respects channelAllowlist', async () => {
|
||||
);
|
||||
});
|
||||
|
||||
test('resolveCursorChatBridgeEligible is disabled for WeChat MP and page.generate', async () => {
|
||||
const pool = createMemoryPool();
|
||||
const service = createWechatCursorExecutorAdminConfigService(pool);
|
||||
await service.updateAdminConfig({
|
||||
enabled: true,
|
||||
userAllowlist: ['john-uuid'],
|
||||
features: {
|
||||
pageGenerate: { enabled: true },
|
||||
chatBridge: { enabled: true },
|
||||
},
|
||||
}, { updatedBy: 'admin-1' });
|
||||
const policy = await service.getEffectivePolicy('john-uuid', { userId: 'john-uuid' });
|
||||
assert.equal(
|
||||
resolveCursorChatBridgeEligible({
|
||||
user: { userId: 'john-uuid' },
|
||||
channel: CURSOR_EXECUTOR_CHANNEL.WECHAT_MP,
|
||||
policy,
|
||||
env: { MEMIND_CURSOR_CHAT_BRIDGE_ENABLED: '1' },
|
||||
}),
|
||||
false,
|
||||
);
|
||||
assert.equal(
|
||||
resolveCursorChatBridgeEligible({
|
||||
user: { userId: 'john-uuid' },
|
||||
channel: CURSOR_EXECUTOR_CHANNEL.H5,
|
||||
intentKind: 'page.generate',
|
||||
policy,
|
||||
env: { MEMIND_CURSOR_CHAT_BRIDGE_ENABLED: '1' },
|
||||
}),
|
||||
false,
|
||||
);
|
||||
assert.equal(
|
||||
resolveCursorChatBridgeEligible({
|
||||
user: { userId: 'john-uuid' },
|
||||
channel: CURSOR_EXECUTOR_CHANNEL.H5,
|
||||
intentKind: 'chat.general',
|
||||
policy,
|
||||
env: { MEMIND_CURSOR_CHAT_BRIDGE_ENABLED: '1' },
|
||||
}),
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
test('isChannelAllowedByCursorPolicy defaults to both channels', () => {
|
||||
const policy = { channelAllowlist: ['h5', 'wechat_mp'] };
|
||||
assert.equal(isChannelAllowedByCursorPolicy('h5', policy), true);
|
||||
|
||||
Reference in New Issue
Block a user