v2.2.292-296: 메모리·발열 최적화 + Pixel Office 완전 제거 + 소형 모델 추론 강화(calculate/run_code/지식 스코프)
- v2.2.292 메모리·발열: 헬스체크 워크스페이스 쓰기→fs.access(워처 연쇄 제거)·git 검사 비동기 30분 주기, 웹뷰 retainContextWhenHidden 정리(채팅만 유지), 브레인 인덱스 유휴 30분 TTL 해제, 채팅 DOM 200개 상한, @lmstudio/sdk 지연 로드 - v2.2.293 Pixel Office 시각화 폐기: astraOffice 모듈·사이드바 매니저 3종·스프라이트 17MB 삭제, sidebarProvider collector 섹션 통삭제 (기업 모드 판단 로직 무변경, vsix 12.2MB→1.3MB) - v2.2.294 도구 메뉴 'NotebookLM 백엔드 실행/종료' 버튼: OS 자동 감지, 프로젝트 자동 탐색+폴더 선택 저장, 포트 정리 폴백 (터미널 없이 Research 백엔드 켜고 끄기) - v2.2.295 추론 강화 1탄: [ACTION 16] <calculate> Python 계산 위임(결과 재주입·자가수정 루프), 단계별 지식 스코프(General+Specialty, 결정적 도메인 분류, 설정 지식·기억 탭 UI) - v2.2.296 추론 강화 2탄: [ACTION 17] <run_code> 실행 확인(stdout 회수→수정→재실행 루프), 문법 오류 재주입 자가수정, 도구 라우팅 힌트(dynamicBlocks), Grounding rescue 도메인 스코프 확장 - 검증: jest 818 통과(신규 29개), tsc 무오류, esbuild 정상 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+70
-42
@@ -2,8 +2,11 @@ import * as vscode from 'vscode';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import { execSync } from 'child_process';
|
||||
import { exec } from 'child_process';
|
||||
import { promisify } from 'util';
|
||||
import { getConfig } from '../config';
|
||||
|
||||
const execAsync = promisify(exec);
|
||||
import { logInfo, logWarn, logError, getActiveBrainProfile } from '../utils';
|
||||
import { getBridgeBaseUrl } from '../features/datacollect/bridgeClient';
|
||||
|
||||
@@ -24,12 +27,21 @@ export class HealthCheckMonitor {
|
||||
private static _lastReports: string[] = [];
|
||||
/** 직전 토스트 내용 — 같은 경고를 10분마다 반복 토스트하지 않기 위한 dedupe. */
|
||||
private static _lastToastKey = '';
|
||||
/** 인터벌 틱 카운터 — 느린 검사(git push·레지스트리)를 매 틱이 아니라 N틱마다 돌리기 위함. */
|
||||
private static _tick = 0;
|
||||
/** 느린 검사(git 자격증명·Antigravity 버전)의 최근 결과 캐시 — 빠른 틱에도 경고 표시가 유지되게. */
|
||||
private static _slowReports: string[] = [];
|
||||
|
||||
public static get lastReports(): string[] {
|
||||
return this._lastReports.slice();
|
||||
}
|
||||
|
||||
public static async runAllChecks(): Promise<{ ok: boolean; reports: string[] }> {
|
||||
/**
|
||||
* @param includeSlowChecks git push --dry-run(원격 네트워크)·Antigravity 레지스트리 읽기 같은
|
||||
* 비싼 검사 포함 여부. 활성화 시·수동 호출은 true(기본), 주기 인터벌은 3틱(30분)마다만 true.
|
||||
* false 틱에서는 직전 느린 검사 결과(_slowReports)를 그대로 합쳐 경고 표시가 깜빡이지 않게 한다.
|
||||
*/
|
||||
public static async runAllChecks(includeSlowChecks: boolean = true): Promise<{ ok: boolean; reports: string[] }> {
|
||||
const reports: string[] = [];
|
||||
const config = getConfig();
|
||||
|
||||
@@ -52,11 +64,12 @@ export class HealthCheckMonitor {
|
||||
}
|
||||
|
||||
// 3. Simple Disk/Permissions Check
|
||||
// [발열 개선] 예전엔 워크스페이스에 파일을 실제로 쓰고 지웠는데, 워크스페이스 파일 변경은
|
||||
// VS Code 본체와 모든 확장의 파일 워처를 주기마다 연쇄로 깨운다. fs.access(W_OK)는
|
||||
// 파일을 만들지 않고 같은 질문("여기 쓸 수 있나")에 답하므로 워처 연쇄가 없다.
|
||||
try {
|
||||
const testFile = workspaceFolders ? vscode.Uri.joinPath(workspaceFolders[0].uri, '.g1-health-check') : null;
|
||||
if (testFile) {
|
||||
await vscode.workspace.fs.writeFile(testFile, Buffer.from('ok'));
|
||||
await vscode.workspace.fs.delete(testFile);
|
||||
if (workspaceFolders && workspaceFolders[0].uri.scheme === 'file') {
|
||||
await fs.promises.access(workspaceFolders[0].uri.fsPath, fs.constants.W_OK);
|
||||
logInfo('Health Check: Write permissions OK.');
|
||||
}
|
||||
} catch {
|
||||
@@ -87,43 +100,52 @@ export class HealthCheckMonitor {
|
||||
}
|
||||
} catch { /* profile 읽기 실패 — skip */ }
|
||||
|
||||
// 6. git push 자격증명 — 원격 동기화를 *설정한* 두뇌만 검사 (secondBrainRepo
|
||||
// 비어 있으면 두뇌 동기화가 로컬 새로고침 모드라 자격증명 불필요).
|
||||
try {
|
||||
if (brain?.secondBrainRepo?.trim() && brain.localBrainPath && fs.existsSync(brain.localBrainPath)) {
|
||||
try {
|
||||
execSync('git push --dry-run', {
|
||||
cwd: brain.localBrainPath,
|
||||
env: { ...process.env, GIT_TERMINAL_PROMPT: '0' },
|
||||
timeout: 5000,
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
});
|
||||
} catch (e: any) {
|
||||
const msg = String(e?.stderr || e?.message || '');
|
||||
if (/could not read Username|Authentication failed|terminal prompts disabled/i.test(msg)) {
|
||||
reports.push(`두뇌 원격 push 자격증명이 없습니다 — 터미널에서 "cd ${brain.localBrainPath} && git push" 1회 실행으로 키체인에 저장하세요.`);
|
||||
}
|
||||
// 그 외(오프라인·upstream 없음 등)는 소음 방지 — 보고하지 않음.
|
||||
}
|
||||
}
|
||||
} catch { /* skip */ }
|
||||
// ── 느린 검사 (6·7): 원격 네트워크·프로세스 생성·레지스트리 파싱 — 매 틱 돌리기엔 비싸다.
|
||||
// includeSlowChecks 틱에서만 실행하고, 그 외 틱은 직전 결과를 그대로 합친다.
|
||||
if (includeSlowChecks) {
|
||||
const slowReports: string[] = [];
|
||||
|
||||
// 7. Antigravity 확장 버전 정합 — VS Code 와 Antigravity 양쪽에 설치된
|
||||
// 경우 버전이 갈리면 "고쳤는데 안 고쳐짐" 혼란의 단골 원인 (실사례:
|
||||
// 2.2.19 vs 2.2.232 공존). Antigravity 미사용 머신에서는 자동 skip.
|
||||
try {
|
||||
const agExtRegistry = path.join(os.homedir(), '.antigravity', 'extensions', 'extensions.json');
|
||||
if (fs.existsSync(agExtRegistry)) {
|
||||
const arr = JSON.parse(fs.readFileSync(agExtRegistry, 'utf8'));
|
||||
const mine = Array.isArray(arr)
|
||||
? arr.find((e: any) => e?.identifier?.id === 'g1nation.astra')
|
||||
: null;
|
||||
const myVersion = vscode.extensions.getExtension('g1nation.astra')?.packageJSON?.version;
|
||||
if (mine?.version && myVersion && mine.version !== myVersion) {
|
||||
reports.push(`Antigravity 에 다른 버전의 Astra(${mine.version})가 설치되어 있습니다 — 현재 실행 중 ${myVersion}. Antigravity 쪽은 수동 업데이트가 필요합니다.`);
|
||||
// 6. git push 자격증명 — 원격 동기화를 *설정한* 두뇌만 검사 (secondBrainRepo
|
||||
// 비어 있으면 두뇌 동기화가 로컬 새로고침 모드라 자격증명 불필요).
|
||||
// [발열 개선] execSync(최대 5초 확장 호스트 블로킹) → 비동기 exec.
|
||||
try {
|
||||
if (brain?.secondBrainRepo?.trim() && brain.localBrainPath && fs.existsSync(brain.localBrainPath)) {
|
||||
try {
|
||||
await execAsync('git push --dry-run', {
|
||||
cwd: brain.localBrainPath,
|
||||
env: { ...process.env, GIT_TERMINAL_PROMPT: '0' },
|
||||
timeout: 5000,
|
||||
});
|
||||
} catch (e: any) {
|
||||
const msg = String(e?.stderr || e?.message || '');
|
||||
if (/could not read Username|Authentication failed|terminal prompts disabled/i.test(msg)) {
|
||||
slowReports.push(`두뇌 원격 push 자격증명이 없습니다 — 터미널에서 "cd ${brain.localBrainPath} && git push" 1회 실행으로 키체인에 저장하세요.`);
|
||||
}
|
||||
// 그 외(오프라인·upstream 없음 등)는 소음 방지 — 보고하지 않음.
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch { /* registry 파싱 실패 — skip */ }
|
||||
} catch { /* skip */ }
|
||||
|
||||
// 7. Antigravity 확장 버전 정합 — VS Code 와 Antigravity 양쪽에 설치된
|
||||
// 경우 버전이 갈리면 "고쳤는데 안 고쳐짐" 혼란의 단골 원인 (실사례:
|
||||
// 2.2.19 vs 2.2.232 공존). Antigravity 미사용 머신에서는 자동 skip.
|
||||
try {
|
||||
const agExtRegistry = path.join(os.homedir(), '.antigravity', 'extensions', 'extensions.json');
|
||||
if (fs.existsSync(agExtRegistry)) {
|
||||
const arr = JSON.parse(fs.readFileSync(agExtRegistry, 'utf8'));
|
||||
const mine = Array.isArray(arr)
|
||||
? arr.find((e: any) => e?.identifier?.id === 'g1nation.astra')
|
||||
: null;
|
||||
const myVersion = vscode.extensions.getExtension('g1nation.astra')?.packageJSON?.version;
|
||||
if (mine?.version && myVersion && mine.version !== myVersion) {
|
||||
slowReports.push(`Antigravity 에 다른 버전의 Astra(${mine.version})가 설치되어 있습니다 — 현재 실행 중 ${myVersion}. Antigravity 쪽은 수동 업데이트가 필요합니다.`);
|
||||
}
|
||||
}
|
||||
} catch { /* registry 파싱 실패 — skip */ }
|
||||
|
||||
this._slowReports = slowReports;
|
||||
}
|
||||
reports.push(...this._slowReports);
|
||||
|
||||
this._lastReports = reports;
|
||||
|
||||
@@ -150,7 +172,13 @@ export class HealthCheckMonitor {
|
||||
if (this.intervalHandle !== null) {
|
||||
clearInterval(this.intervalHandle);
|
||||
}
|
||||
this.intervalHandle = setInterval(() => this.runAllChecks(), ms);
|
||||
// 빠른 검사(서버·권한·브리지·두뇌 경로)는 매 틱, 느린 검사(git 원격·레지스트리)는 3틱마다.
|
||||
// (기본 10분 인터벌 기준: 빠른 검사 10분, 느린 검사 30분 주기)
|
||||
this._tick = 0;
|
||||
this.intervalHandle = setInterval(() => {
|
||||
this._tick++;
|
||||
this.runAllChecks(this._tick % 3 === 0);
|
||||
}, ms);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user