fix(bridge): 商机拦截话术不使用购物车

This commit is contained in:
wangliang
2026-10-23 14:25:03 +08:00
parent 9ce3120648
commit 22de20e718
2 changed files with 24 additions and 1 deletions
+14
View File
@@ -180,3 +180,17 @@ test('guard: keeps meaningful anchor text when the URL is removed', () => {
assert.doesNotMatch(r.content, /fake-guide/);
assert.match(r.content, /the product care guide/);
});
test('guard: CRM wording is replaced with a colleague follow-up, not a cart note', () => {
const r = guardReply({
content: 'Great — 500 stainless steel rings for your shops.\nI have created an opportunity for your request.',
toolResults: [{ created: true, opportunity_id: 'opp-1' }],
toolCalls: [{ name: 'create_opportunity', ok: true }],
lang: 'en',
});
assert.equal(r.blocked, true);
assert.ok(r.reasons.includes('internal_crm'));
assert.match(r.content, /stainless steel rings/i);
assert.match(r.content, /request has been noted/i);
assert.doesNotMatch(r.content, /account cart/i);
});