fix: agent selection bypasses multi-agent workflow to ensure selected agent system prompt is applied
This commit is contained in:
+4
-1
@@ -230,7 +230,10 @@ export class AgentExecutor {
|
||||
const runId = options.runId ?? (loopDepth === 0 ? ++this.runSerial : this.activeRunId);
|
||||
|
||||
// Decide whether to use Multi-Agent Workflow as an internal execution strategy.
|
||||
if (loopDepth === 0 && this.shouldUseMultiAgentWorkflow(prompt || '', multiAgentEnabled)) {
|
||||
// [Critical Fix] 사용자가 에이전트를 명시적으로 선택한 경우, 해당 에이전트의 system prompt를
|
||||
// 최우선으로 적용해야 하므로 멀티에이전트 워크플로우 분기를 우회합니다.
|
||||
const hasExplicitAgentSelection = !!options.agentSkillContext;
|
||||
if (loopDepth === 0 && !hasExplicitAgentSelection && this.shouldUseMultiAgentWorkflow(prompt || '', multiAgentEnabled)) {
|
||||
return this.executeMultiAgentWorkflow(prompt!, modelName, options);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user