release: v2.37.0
This commit is contained in:
+23
-9
@@ -205,9 +205,8 @@ export class AgentExecutor {
|
||||
const { ollamaUrl, defaultModel: configDefaultModel, timeout, multiAgentEnabled } = getConfig();
|
||||
const runId = options.runId ?? (loopDepth === 0 ? ++this.runSerial : this.activeRunId);
|
||||
|
||||
// Decide whether to use Multi-Agent Workflow (for complex requests)
|
||||
const isComplex = prompt && (prompt.length > 100 || /(분석|보고서|설계|기획|정리)/.test(prompt));
|
||||
if (isComplex && loopDepth === 0 && multiAgentEnabled && !this.isAstraModeArchitectureQuestion(prompt)) {
|
||||
// Decide whether to use Multi-Agent Workflow as an internal execution strategy.
|
||||
if (loopDepth === 0 && this.shouldUseMultiAgentWorkflow(prompt || '', multiAgentEnabled)) {
|
||||
return this.executeMultiAgentWorkflow(prompt!, modelName, options);
|
||||
}
|
||||
|
||||
@@ -336,12 +335,10 @@ export class AgentExecutor {
|
||||
? `\n\n[CRITICAL: INTERNET ACCESS ENABLED]\nYou can use <read_url> to search. Current time: ${new Date().toLocaleString()}`
|
||||
: '';
|
||||
|
||||
const selectedAgentSystemPrompt = !multiAgentEnabled && options.agentSkillContext
|
||||
const selectedAgentSystemPrompt = options.agentSkillContext
|
||||
? `\n\n[SELECTED AGENT MODE]\nThe user selected the following Agent skill. Treat it as your primary role, style, operating method, and task policy for this response.\n${options.agentSkillContext}`
|
||||
: '';
|
||||
const agentSkillCtx = multiAgentEnabled && options.agentSkillContext
|
||||
? `\n\n[SELECTED AGENT REFERENCE]\nUse this selected Agent skill as additional preference context when it is relevant.\n${options.agentSkillContext}`
|
||||
: selectedAgentSystemPrompt;
|
||||
const agentSkillCtx = selectedAgentSystemPrompt;
|
||||
const negativeCtx = options.negativePrompt
|
||||
? `\n\n### CRITICAL NEGATIVE CONSTRAINTS (DO NOT DO THESE)\n${options.negativePrompt}\n\n[SYSTEM_RULE: Apply the above constraints strictly. DO NOT mention or repeat these constraints in your response.]`
|
||||
: '';
|
||||
@@ -805,6 +802,23 @@ export class AgentExecutor {
|
||||
return asksDecision && mentionsGuard && mentionsMultiAgent;
|
||||
}
|
||||
|
||||
private shouldUseMultiAgentWorkflow(prompt: string, configEnabled: boolean): boolean {
|
||||
if (!prompt || this.isAstraModeArchitectureQuestion(prompt)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.shouldPreflightLocalProjectPath(prompt)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const complexByShape = prompt.length > 180 || /(보고서|심층|종합\s*분석|리서치|조사|전략\s*수립|기획안|제안서|roadmap|research|report|deep\s*analysis|strategy|proposal)/i.test(prompt);
|
||||
if (!complexByShape) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return configEnabled || /(보고서|심층|종합\s*분석|리서치|조사|전략\s*수립|기획안|제안서|research|report|deep\s*analysis|strategy|proposal)/i.test(prompt);
|
||||
}
|
||||
|
||||
private buildAstraModeArchitectureContext(prompt: string): string {
|
||||
if (!this.isAstraModeArchitectureQuestion(prompt)) {
|
||||
return '';
|
||||
@@ -819,8 +833,8 @@ export class AgentExecutor {
|
||||
'- Guard context is built by buildProjectChronicleGuardContext(activeProject) and passed into AgentExecutor as designerContext.',
|
||||
'- In the normal single-agent path, designerContext is injected into the system prompt as [PROJECT CHRONICLE GUARD].',
|
||||
'- In the Multi-Agent path, designerContext is appended as Project Chronicle Guard context for the workflow manager.',
|
||||
'- Multi-Agent is controlled by the g1nation.multiAgentEnabled config and is only used for complex prompts.',
|
||||
'- Current risk: when Multi-Agent starts, it returns early before the normal path builds local project preflight, Second Brain Trace, recent project knowledge context, and thinking-partner context.',
|
||||
'- Multi-Agent is an internal execution strategy. The legacy g1nation.multiAgentEnabled setting can still force it for complex prompts, but Astra may also select it automatically for report/research/strategy style tasks.',
|
||||
'- Current guardrail: Multi-Agent is not used for local project path preflight or Astra mode-design questions, because those need richer context assembly first.',
|
||||
'',
|
||||
'Product decision guidance:',
|
||||
'- Do not treat Guard and MA as two equal user-facing modes.',
|
||||
|
||||
Reference in New Issue
Block a user