chore: v2.2.73 — ASTRA-DEBUG 로그 레벨 + webview CSP font-src 보강

- ASTRA-DEBUG 정상 흐름 로그를 console.error → logInfo/console.log 로 강등
  (chatHandlers, extension, slashRouter): DevTools에 ERR로 찍히던 오탐 제거
- sidebar webview에 명시적 CSP meta 추가 + font-src에 data: 허용
  (sidebar.html, sidebarProvider._getHtml): VS Code outer iframe이 codicon.ttf를
  data:font/ttf 로 inject하면서 기본 CSP에 막혀 매 prompt 마다 violation
  경고가 찍히던 문제 해소
- 누적된 LM Studio / agent / 컨텍스트 매니저 / 테스트 갱신 동반

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
g1nation
2026-05-23 15:52:19 +09:00
parent 36db170844
commit 0712014fcb
43 changed files with 2417 additions and 977 deletions
+7 -4
View File
@@ -118,19 +118,21 @@ export interface TrimResult<M extends BudgetMessage> {
}
/**
* 대화 기록을 토큰 예산 안에 맞춥니다.
* 대화 기록을 토큰 예산 안에 맞춥니다 (sliding window).
*
* 전략:
* 1. 항상 마지막 메시지(보통 현재 사용자 질문)는 유지.
* 2. 최근 메시지부터 역순으로 예산이 허용하는 만큼 채움.
* 3. 하나라도 잘렸으면 맨 앞에 `[이전 대화 N개 생략]` 마커를 끼워 모델이 맥락 누락을 인지하게 함.
* 3. 하나라도 잘렸으면 맨 앞에 marker 를 끼워 모델이 맥락 누락을 인지하게 함.
* v2.2.69+ — marker 콜백은 droppedCount 뿐 아니라 *잘려나간 메시지 배열* 도 받아
* 단순 count 가 아닌 진짜 요약/맥락을 작성할 수 있다.
*
* 주의: 여기서 잘라내는 것은 *요청에 보낼* 메시지 배열일 뿐, UI에 표시되는 전체 기록은 그대로 둡니다.
*/
export function trimHistoryToBudget<M extends BudgetMessage>(
messages: M[],
budgetTokens: number,
makeMarker: (droppedCount: number) => M
makeMarker: (droppedCount: number, droppedMessages: M[]) => M
): TrimResult<M> {
if (messages.length === 0) {
return { messages, droppedCount: 0, tokensAfter: 0 };
@@ -154,7 +156,8 @@ export function trimHistoryToBudget<M extends BudgetMessage>(
const droppedCount = messages.length - kept.length;
if (droppedCount > 0) {
const marker = makeMarker(droppedCount);
const droppedMessages = messages.slice(0, droppedCount);
const marker = makeMarker(droppedCount, droppedMessages);
kept.unshift(marker);
used += estimateMessageTokens(marker);
}