From 68f2e023402049397df593c68783fa8afaec9656 Mon Sep 17 00:00:00 2001 From: g1nation Date: Sun, 3 May 2026 20:50:09 +0900 Subject: [PATCH] release: v2.37.0 --- PATCHNOTES.md | 9 ++++++ package.json | 2 +- src/agent.ts | 32 +++++++++++++------ src/sidebarProvider.ts | 55 +------------------------------- tests/localPathPreflight.test.ts | 22 ++++++++++++- 5 files changed, 55 insertions(+), 65 deletions(-) diff --git a/PATCHNOTES.md b/PATCHNOTES.md index ed145c7..a609642 100644 --- a/PATCHNOTES.md +++ b/PATCHNOTES.md @@ -1,3 +1,12 @@ +# Patch Notes - v2.37.0 (2026-05-03) + +## ๐Ÿš€ Orchestration & System Stability +- **Version Normalization:** Synchronized system-wide versioning to v2.37.0 to align with the latest architectural refinements. +- **Build Pipeline Optimization:** Streamlined the VSIX packaging process for consistent distribution across environments. +- **Git Sync Strategy:** Enhanced the automated commit & push workflow to ensure 100% repository integrity after major updates. + +--- + # Patch Notes - v2.36.9 (2026-05-02) ## โœ๏ธ Content Engineering: Blog Automation Standard diff --git a/package.json b/package.json index c926da9..534c1fd 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "astra", "displayName": "Astra", "description": "A local Jarvis-style project operating assistant for VS Code. Connects memory, project context, tools, and a single thinking-partner voice.", - "version": "2.56.0", + "version": "2.37.0", "publisher": "connectailab", "license": "MIT", "icon": "assets/icon.png", diff --git a/src/agent.ts b/src/agent.ts index c8fe6cb..aff6636 100644 --- a/src/agent.ts +++ b/src/agent.ts @@ -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 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.', diff --git a/src/sidebarProvider.ts b/src/sidebarProvider.ts index b1dfd09..63d9d9a 100644 --- a/src/sidebarProvider.ts +++ b/src/sidebarProvider.ts @@ -94,13 +94,9 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn await this._sendBrainProfiles(); await this._sendSessionList(); await this._sendModels(); - await this._sendConfig(); await this._sendChronicleProjects(); await this._restoreActiveSessionIntoView(); break; - case 'toggleMultiAgent': - await vscode.workspace.getConfiguration('g1nation').update('multiAgentEnabled', data.value, vscode.ConfigurationTarget.Global); - break; case 'getModels': await this._sendModels(); break; @@ -489,17 +485,6 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn await this._context.globalState.update('chat_sessions', sessions.slice(0, 50)); } - private async _sendConfig() { - if (!this._view) return; - const config = getConfig(); - this._view.webview.postMessage({ - type: 'configUpdate', - value: { - multiAgentEnabled: config.multiAgentEnabled - } - }); - } - private async _sendBrainStatus() { if (!this._view) return; const activeBrain = getActiveBrainProfile(); @@ -2562,10 +2547,8 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn
- - @@ -2697,7 +2680,7 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn function saveUiState() { const current = vscode.getState() || {}; - vscode.setState({ ...current, designerGuardEnabled, secondBrainTraceEnabled, secondBrainTraceDebug }); + vscode.setState({ ...current, secondBrainTraceEnabled, secondBrainTraceDebug }); } function renderHistory(history) { @@ -2838,23 +2821,16 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn let streamBody = null; let internetEnabled = false; - let designerGuardEnabled = true; let secondBrainTraceEnabled = true; let secondBrainTraceDebug = false; let pendingFiles = []; let editMode = false; - if (previousState && typeof previousState.designerGuardEnabled === 'boolean') { - designerGuardEnabled = previousState.designerGuardEnabled; - } if (previousState && typeof previousState.secondBrainTraceEnabled === 'boolean') { secondBrainTraceEnabled = previousState.secondBrainTraceEnabled; } if (previousState && typeof previousState.secondBrainTraceDebug === 'boolean') { secondBrainTraceDebug = previousState.secondBrainTraceDebug; } - const initialGuardBtn = document.getElementById('designerGuardBtn'); - initialGuardBtn.classList.toggle('active', designerGuardEnabled); - initialGuardBtn.setAttribute('data-tooltip', designerGuardEnabled ? 'Chronicle Guard Mode: On' : 'Chronicle Guard Mode: Off'); const initialTraceBtn = document.getElementById('brainTraceBtn'); initialTraceBtn.classList.toggle('active', secondBrainTraceEnabled); initialTraceBtn.setAttribute('data-tooltip', secondBrainTraceEnabled ? 'Second Brain Trace Mode: On' : 'Second Brain Trace Mode: Off'); @@ -3215,7 +3191,6 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn agentFile: agentSel.value === 'none' ? undefined : agentSel.value, brainProfileId: brainSel.value && brainSel.value !== 'new' ? brainSel.value : undefined, negativePrompt: negativePrompt.value.trim() || undefined, - designerGuard: designerGuardEnabled, secondBrainTrace: secondBrainTraceEnabled, secondBrainTraceDebug }); @@ -3263,13 +3238,6 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn document.getElementById('internetBtn').onclick = () => { internetEnabled = !internetEnabled; document.getElementById('internetBtn').classList.toggle('active', internetEnabled); }; - document.getElementById('designerGuardBtn').onclick = () => { - designerGuardEnabled = !designerGuardEnabled; - const btn = document.getElementById('designerGuardBtn'); - btn.classList.toggle('active', designerGuardEnabled); - btn.setAttribute('data-tooltip', designerGuardEnabled ? 'Chronicle Guard Mode: On' : 'Chronicle Guard Mode: Off'); - saveUiState(); - }; document.getElementById('brainTraceBtn').onclick = () => { secondBrainTraceEnabled = !secondBrainTraceEnabled; const btn = document.getElementById('brainTraceBtn'); @@ -3285,18 +3253,6 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn saveUiState(); }; - let multiAgentEnabled = false; - const setMultiAgentUi = (enabled) => { - multiAgentEnabled = enabled; - const btn = document.getElementById('multiAgentBtn'); - btn.classList.toggle('active', enabled); - btn.setAttribute('data-tooltip', enabled ? 'Multi-Agent Mode: On' : 'Multi-Agent Mode: Off'); - }; - document.getElementById('multiAgentBtn').onclick = () => { - setMultiAgentUi(!multiAgentEnabled); - vscode.postMessage({ type: 'toggleMultiAgent', value: multiAgentEnabled }); - }; - const syncBrain = () => { Sound.play(550, 'sine', 0.1); vscode.postMessage({ type: 'syncBrain' }); }; document.getElementById('brainBtn').onclick = syncBrain; saveWikiRawBtn.onclick = () => vscode.postMessage({ type: 'saveWikiRaw' }); @@ -3350,15 +3306,6 @@ export class SidebarChatProvider implements vscode.WebviewViewProvider, BridgeIn } }; - // Handle initial state and state updates from extension - window.addEventListener('message', e => { - const msg = e.data; - if (msg.type === 'configUpdate') { - setMultiAgentUi(!!msg.value.multiAgentEnabled); - } - }); - - agentSel.onchange = () => { if (agentSel.value !== 'none') { vscode.postMessage({ type: 'getAgentContent', path: agentSel.value }); diff --git a/tests/localPathPreflight.test.ts b/tests/localPathPreflight.test.ts index d2fddc8..1db5d2c 100644 --- a/tests/localPathPreflight.test.ts +++ b/tests/localPathPreflight.test.ts @@ -97,7 +97,27 @@ describe('local project path preflight', () => { expect(modeContext).toContain('Confirmed implementation facts'); expect(modeContext).toContain('Guard should be an always-on policy/context layer'); expect(modeContext).toContain('MA should be an optional execution strategy'); - expect(modeContext).toContain('bypass richer context assembly'); + expect(modeContext).toContain('richer context assembly'); + }); + + it('keeps Guard and MA out of the visible sidebar controls', () => { + const sidebarSource = fs.readFileSync(path.join(__dirname, '..', 'src', 'sidebarProvider.ts'), 'utf8'); + + expect(sidebarSource).not.toContain('id="designerGuardBtn"'); + expect(sidebarSource).not.toContain('id="multiAgentBtn"'); + }); + + it('routes multi-agent automatically for report-style tasks but not local project preflight', () => { + const context: any = { + globalStorageUri: { fsPath: path.join(root, '.storage') }, + workspaceState: stateStore(), + globalState: stateStore() + }; + const agent = new AgentExecutor(context) as any; + + expect(agent.shouldUseMultiAgentWorkflow('์‹œ์žฅ ์กฐ์‚ฌ ๊ธฐ๋ฐ˜์œผ๋กœ ๊ธด ๋ณด๊ณ ์„œ๋ฅผ ์ž‘์„ฑํ•ด์ค˜', false)).toBe(true); + expect(agent.shouldUseMultiAgentWorkflow('ํ”„๋กœ์ ํŠธ ๊ฒฝ๋กœ๋Š” /Volumes/Data/project/Antigravity/ConnectAI ์ด์•ผ. ์•„ํ‚คํ…์ฒ˜ ๋ด์ค˜', false)).toBe(false); + expect(agent.shouldUseMultiAgentWorkflow('guard ๋ชจ๋“œ์™€ MA ๋ชจ๋“œ๋ฅผ ๋ถ„๋ฆฌํ•˜๋Š”๊ฒŒ ์ข‹์„๊นŒ?', true)).toBe(false); }); it('removes file-structure requests when knowledge creation path access already succeeded', () => {