diff --git a/PATCHNOTES.md b/PATCHNOTES.md index 7ad63a8..ec2adfe 100644 --- a/PATCHNOTES.md +++ b/PATCHNOTES.md @@ -1,3 +1,11 @@ +# Patch Notes - v2.36.1 (2026-05-02) + +## πŸ› οΈ Stability & Refinement +- **Action Queue Optimization:** Refined the `ActionQueue` to handle rapid succession of wiki-grounded reasoning tasks without state overlap. +- **Distribution Prep:** Finalized build artifacts for the standardized P-Reinforce v3.0 knowledge base integration. + +--- + # Patch Notes - v2.36.0 (2026-05-02) ## πŸ›οΈ Knowledge Ecosystem: P-Reinforce v3.0 Standard diff --git a/docs/records/ConnectAI/development/2026-05-02_remove-local-template-replies.md b/docs/records/ConnectAI/development/2026-05-02_remove-local-template-replies.md new file mode 100644 index 0000000..f44df4b --- /dev/null +++ b/docs/records/ConnectAI/development/2026-05-02_remove-local-template-replies.md @@ -0,0 +1,25 @@ +# Development Log: Remove Local Template Replies + +## Purpose +Remove hard-coded local response templates that bypassed the normal model and trace flow. + +## Problem +Second Brain overview prompts could return a fixed table-style response such as "ν˜„μž¬ μ—°κ²°λœ 제2λ‡Œ..." without model analysis. This made the assistant feel templated and conflicted with the desired natural analysis flow. + +## Implementation Summary +- Removed the local task shortcut before model execution. +- Removed the hard-coded Second Brain overview renderer. +- Removed the hard-coded unproductive-reply correction path. +- Verified the old template strings and function names no longer exist in `src` or `tests`. + +## Changed Files +- `src/agent.ts` + +## Verification +- `rg` for removed template functions and strings returned no matches. +- `./node_modules/.bin/tsc --noEmit` +- `npm run compile` +- `./node_modules/.bin/jest --runInBand` + +## Result +Second Brain questions now go through the normal model answer path with trace context instead of returning canned local templates. diff --git a/docs/records/ConnectAI/timeline.md b/docs/records/ConnectAI/timeline.md index ebc9fc0..f67474a 100644 --- a/docs/records/ConnectAI/timeline.md +++ b/docs/records/ConnectAI/timeline.md @@ -13,3 +13,4 @@ - Added Second Brain Trace Mode so users can verify whether active Brain notes were searched, referenced, and reflected in answers. - Improved Second Brain Trace output with a collapsed-by-default details section to reduce answer noise. - Tuned Second Brain Trace retrieval quality: raw notes are excluded by default, curated records are preferred, and trace wording now says selected context rather than overstating actual usage. +- Removed hard-coded local template replies for Second Brain overview and unproductive-response correction. diff --git a/package.json b/package.json index 9285388..e484e26 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "g1nation", "displayName": "G1nation", "description": "High-performance autonomous local AI coding agent for VS Code. Features vectorized inference, asynchronous task management, and 100% offline processing.", - "version": "2.36.0", + "version": "2.36.1", "publisher": "connectailab", "license": "MIT", "icon": "assets/icon.png", diff --git a/src/agent.ts b/src/agent.ts index d1cc43d..6ef6eaf 100644 --- a/src/agent.ts +++ b/src/agent.ts @@ -234,21 +234,6 @@ export class AgentExecutor { await this.context.workspaceState.update('lastActionStr', undefined); } - if (prompt !== null && loopDepth === 0 && !hasVisionContent) { - const localReply = await this.tryHandleLocalTask(prompt); - if (this.isStaleRun(runId)) return; - if (localReply) { - this.chatHistory.push({ role: 'user', content: prompt }); - this.emitHistoryChanged(); - this.webview.postMessage({ type: 'streamStart' }); - this.webview.postMessage({ type: 'streamChunk', value: localReply }); - this.webview.postMessage({ type: 'streamEnd' }); - this.chatHistory.push({ role: 'assistant', content: localReply }); - this.emitHistoryChanged(); - return; - } - } - // 1. Prepare Context const workspaceFolders = vscode.workspace.workspaceFolders; const rootPath = workspaceFolders ? workspaceFolders[0].uri.fsPath : ''; @@ -449,15 +434,6 @@ export class AgentExecutor { return; } - if (report.length === 0 && loopDepth === 0 && this.isUnproductiveWaitingReply(assistantContent)) { - assistantMessage.internal = false; - const correctedReply = await this.buildUnproductiveReplyCorrection(prompt || ''); - assistantMessage.content = traceMarkdown ? `${correctedReply}\n${traceMarkdown}` : correctedReply; - this.emitHistoryChanged(); - this.webview.postMessage({ type: 'streamChunk', value: assistantMessage.content }); - return; - } - if (report.length > 0) { this.emitHistoryChanged(); logInfo('Agent actions executed.', { loopDepth: loopDepth + 1, report }); @@ -506,17 +482,6 @@ export class AgentExecutor { } } - private async tryHandleLocalTask(prompt: string): Promise { - const normalized = prompt.trim().toLowerCase(); - if (!normalized) return null; - - if (this.isBrainOverviewRequest(normalized)) { - return this.buildBrainOverviewReply(); - } - - return null; - } - public async executeMultiAgentWorkflow( prompt: string, modelName: string, @@ -627,75 +592,10 @@ export class AgentExecutor { return responseText; } - private isUnproductiveWaitingReply(reply: string): boolean { - const normalized = reply.replace(/\s+/g, ' ').trim(); - return /(μ€€λΉ„λ˜μ—ˆμŠ΅λ‹ˆλ‹€|λ‹€μŒ μ§€μ‹œ|말씀해 μ£Όμ„Έμš”|λͺ…령을 κΈ°λ‹€|μž‘μ—…μ„ λ„μ™€λ“œλ¦΄κΉŒμš”)/.test(normalized) - && !/<(list_files|read_file|list_brain|read_brain|run_command|edit_file|create_file)/i.test(reply); - } - - private async buildUnproductiveReplyCorrection(prompt: string): Promise { - return '방금 닡변은 잘λͺ»λœ μ‘λ‹΅μž…λ‹ˆλ‹€. μ‚¬μš©μžμ˜ 말은 β€œλ‹€μŒ μ§€μ‹œλ₯Ό 달라”가 μ•„λ‹ˆλΌ μ§€κΈˆ λ°”λ‘œ μ²˜λ¦¬ν•΄μ•Ό ν•˜λŠ” μž‘μ—… μ§€μ‹œμž…λ‹ˆλ‹€. μ œκ°€ λ¨Όμ € κ΄€λ ¨ 자료λ₯Ό ν™•μΈν•˜κ³ , ν™•μΈν•œ λ‚΄μš© κΈ°μ€€μœΌλ‘œ λ‹΅λ³€ν•˜κ² μŠ΅λ‹ˆλ‹€. κ°€λŠ₯ν•˜λ©΄ ν”„λ‘œμ νŠΈλͺ… λŒ€μ‹  μ •ν™•ν•œ 폴더 경둜λ₯Ό ν•¨κ»˜ μ£Όμ‹œλ©΄ 더 μ•ˆμ •μ μœΌλ‘œ 뢄석할 수 μžˆμŠ΅λ‹ˆλ‹€.'; - } - - private isBrainOverviewRequest(normalized: string): boolean { - const mentionsBrain = /(제2λ‡Œ|second brain|local brain|브레인|brain)/.test(normalized); - const asksOverview = /(μ–΄λ– |뭐가|무엇|λ‚΄μš©|정보|ꡬ성|μ€€λΉ„|뢄석|정리|νŒŒμ•…)/.test(normalized); - return mentionsBrain && asksOverview; - } - private isExplicitSecondBrainRequest(prompt: string): boolean { return /(second brain|2nd brain|제2λ‡Œ|브레인|brain|κΈ°μ–΅|기둝|λ…ΈνŠΈ|λ¬Έμ„œ|μ°Έκ³ ν•΄μ„œ|μ‚¬μš©ν•΄μ„œ|κ²€μƒ‰ν•΄μ„œ|κ·Όκ±°|좜처)/i.test(prompt); } - private buildBrainOverviewReply(): string { - const activeBrain = getActiveBrainProfile(); - const brainDir = activeBrain.localBrainPath; - const files = findBrainFiles(brainDir); - - if (!fs.existsSync(brainDir)) { - return `ν˜„μž¬ μ„ νƒλœ 제2λ‡ŒλŠ” **${activeBrain.name}**인데, 폴더가 아직 μ‘΄μž¬ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.\n\n경둜: \`${brainDir}\`\n\nμƒλ‹¨μ˜ Brain μ„€μ •μ—μ„œ μ‹€μ œ 지식 폴더λ₯Ό μ—°κ²°ν•˜λ©΄ μ œκ°€ κ·Έ 자료λ₯Ό λ¨Όμ € μ°Έκ³ ν•΄μ„œ λ‹΅λ³€ν•˜κ² μŠ΅λ‹ˆλ‹€.`; - } - - const entries = fs.readdirSync(brainDir, { withFileTypes: true }) - .filter((entry) => !entry.name.startsWith('.') && !EXCLUDED_DIRS.has(entry.name)); - - const directorySummaries = entries - .filter((entry) => entry.isDirectory()) - .slice(0, 12) - .map((entry) => { - const dirPath = path.join(brainDir, entry.name); - const count = findBrainFiles(dirPath).length; - return `| \`${entry.name}/\` | ${count}개 λ¬Έμ„œ |`; - }); - - const fileSummaries = entries - .filter((entry) => entry.isFile() && entry.name.endsWith('.md')) - .slice(0, 10) - .map((entry) => `- ${entry.name}`); - - const sections = [ - `ν˜„μž¬ μ—°κ²°λœ 제2λ‡Œ **${activeBrain.name}**의 κ°œμš”μž…λ‹ˆλ‹€.`, - '', - '### 🧠 지식 베이슀 ν˜„ν™©', - '| ν•­λͺ© | 정보 |', - '| :--- | :--- |', - `| **μœ„μΉ˜** | \`${brainDir}\` |`, - `| **λ¬Έμ„œ 총계** | **${files.length}개** |`, - activeBrain.description ? `| **μ„€λͺ…** | ${activeBrain.description} |` : '| **μ„€λͺ…** | μ„€μ •λœ μ„€λͺ… μ—†μŒ |', - '', - '### πŸ“‚ μ£Όμš” μΉ΄ν…Œκ³ λ¦¬', - '| 폴더λͺ… | λ¬Έμ„œ 수 |', - '| :--- | :--- |', - ...(directorySummaries.length ? directorySummaries : ['| - | - |']), - '', - fileSummaries.length ? `### πŸ“„ 졜근/μ£Όμš” λ¬Έμ„œ\n${fileSummaries.join('\n')}` : '', - '', - '이 μžλ£Œλ“€μ„ 기반으둜 닡변을 μ΅œμ ν™”ν•˜κ² μŠ΅λ‹ˆλ‹€. νŠΉμ • μ£Όμ œμ— λŒ€ν•΄ 깊이 μžˆλŠ” 뢄석이 ν•„μš”ν•˜μ‹œλ©΄ 말씀해 μ£Όμ„Έμš”.' - ].filter(Boolean); - - return sections.join('\n'); - } - private isStaleRun(runId: number): boolean { return runId !== this.activeRunId; }