fix: stop chat hang after misrouted themed article requests
Route themed page/article prompts to agent orchestration, reject them from portal direct chat, and finalize regular sessions to idle when a direct chat turn already completed. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -205,6 +205,30 @@ test('direct chat rejects page generation tasks so the execution backend can han
|
||||
}), false);
|
||||
});
|
||||
|
||||
test('direct chat rejects themed article page tasks without explicit html path', () => {
|
||||
const service = createDirectChatService({
|
||||
enabled: true,
|
||||
userAuth: {},
|
||||
llmProviderService: {},
|
||||
sessionSnapshotService: {},
|
||||
});
|
||||
|
||||
assert.equal(service.canHandle({
|
||||
toolMode: 'chat',
|
||||
userMessage: {
|
||||
role: 'user',
|
||||
content: [{ type: 'text', text: '帮我写个主题文章' }],
|
||||
},
|
||||
}), false);
|
||||
assert.equal(service.explainCanHandle({
|
||||
toolMode: 'chat',
|
||||
userMessage: {
|
||||
role: 'user',
|
||||
content: [{ type: 'text', text: '帮我写个主题文章' }],
|
||||
},
|
||||
}).reason, 'task_execution_required');
|
||||
});
|
||||
|
||||
test('direct chat allows llm-routed replies on regular agent sessions', () => {
|
||||
const service = createDirectChatService({
|
||||
enabled: true,
|
||||
|
||||
Reference in New Issue
Block a user