feat: optimize multi-agent routing and enhance intent detection

This commit is contained in:
g1nation
2026-05-01 20:02:35 +09:00
parent ac902c1841
commit 600075603f
5 changed files with 38 additions and 12 deletions
+15 -4
View File
@@ -190,7 +190,10 @@ export class AgentExecutor {
// Decide whether to use Multi-Agent Workflow (for complex requests)
const isComplex = prompt && (prompt.length > 100 || /(분석|보고서|설계|기획|정리)/.test(prompt));
if (isComplex && loopDepth === 0 && multiAgentEnabled) {
const explicitLocalProjectTask = prompt
? !!(await this.resolveProjectReference(prompt)) && this.isProjectAnalysisRequest(prompt.toLowerCase())
: false;
if (isComplex && loopDepth === 0 && multiAgentEnabled && !explicitLocalProjectTask) {
return this.executeMultiAgentWorkflow(prompt!, modelName, options);
}
@@ -401,8 +404,16 @@ export class AgentExecutor {
const report = await this.executeActions(aiResponseText, rootPath);
if (!aiResponseText.trim() && report.length === 0) {
this.chatHistory.pop();
logError('Model returned an empty response without actions.', { model: actualModel, loopDepth });
this.webview.postMessage({ type: 'error', value: 'AI model returned an empty response.' });
logError('Model returned an empty response without actions.', { model: actualModel, engine, apiUrl, loopDepth });
this.webview.postMessage({
type: 'error',
value: [
'AI engine returned an empty response.',
`Engine: ${engine}`,
`Model: ${actualModel}`,
'The request reached the local LLM server, but no usable content was returned. Try another model, restart the local server, or reduce the prompt/context size.'
].join('\n')
});
return;
}
@@ -653,7 +664,7 @@ export class AgentExecutor {
// Only trigger local analysis if the intent is strictly about a project-level overview.
// Avoid generic terms like 'analysis' or 'review' that are common in general coding chat.
const hasProjectKeyword = /(프로젝트|project|레포|repository)/.test(normalized);
const hasAnalysisIntent = /(전체 요약|제품 설명|어떤 프로그램|구조 파악|훑어보기)/.test(normalized);
const hasAnalysisIntent = /(전체 요약|제품 설명|어떤 프로그램|구조 파악|훑어보기|분석 문서|모든 코드|준비한 모든 코드|코드를 읽고|프로젝트를 이해|설계|기능|코드 품질|문제성|리뷰|평가)/.test(normalized);
return hasProjectKeyword && hasAnalysisIntent;
}