fix: unblock local news page generation
This commit is contained in:
@@ -232,6 +232,42 @@ test('coercePageGenerationSkill replaces product-campaign-page for content pages
|
||||
assert.match(coerced.reason, /static-page-publish/);
|
||||
});
|
||||
|
||||
test('coercePageGenerationSkill preserves realtime research while making the page the deliverable', () => {
|
||||
const coerced = coercePageGenerationSkill(
|
||||
{
|
||||
route: CHAT_INTENT_ROUTE.AGENT,
|
||||
suggestedSkill: 'web',
|
||||
reason: '需要搜索实时资料(实时查询强制 web)',
|
||||
agentBrief: '先搜索并核对今天的新闻来源。',
|
||||
confidence: 1,
|
||||
source: 'rule',
|
||||
},
|
||||
'帮我整理今天的新闻做成页面',
|
||||
{ grantedSkills: ['web', 'static-page-publish'] },
|
||||
);
|
||||
assert.equal(coerced.suggestedSkill, 'static-page-publish');
|
||||
assert.match(coerced.agentBrief, /先搜索并核对/);
|
||||
assert.match(coerced.agentBrief, /公开内容页面/);
|
||||
assert.match(coerced.reason, /实时资料整理后交付/);
|
||||
});
|
||||
|
||||
test('createChatIntentRouter keeps static-page-publish for forced realtime page tasks', async () => {
|
||||
const router = createChatIntentRouter();
|
||||
const result = await router.classify({
|
||||
userMessage: {
|
||||
role: 'user',
|
||||
content: [{ type: 'text', text: '帮我整理今天的新闻做成页面' }],
|
||||
metadata: { displayText: '帮我整理今天的新闻做成页面' },
|
||||
},
|
||||
forceDeepReasoning: true,
|
||||
grantedSkills: ['web', 'static-page-publish'],
|
||||
});
|
||||
assert.equal(result.route, CHAT_INTENT_ROUTE.AGENT);
|
||||
assert.equal(result.suggestedSkill, 'static-page-publish');
|
||||
assert.match(result.agentBrief, /tkmind_search/);
|
||||
assert.match(result.agentBrief, /公开内容页面/);
|
||||
});
|
||||
|
||||
test('classifyWithRules routes themed article requests to agent orchestration', () => {
|
||||
const result = classifyWithRules({
|
||||
text: '帮我写个主题文章',
|
||||
|
||||
Reference in New Issue
Block a user