compact 후행 운영 메타를 더 줄여 응답 표시를 단순화
- ResponsePresentation에서 compact 직후 꼬리표를 제거해 일반 응답과 같은 밀도로 보이도록 정리 - ContextUsagePresentation 팝업 detail에서 compact 후 첫 응답 대기 문구를 제거하고 실제 컨텍스트 정보만 남김 - README와 DEVELOPMENT 문서에 2026-04-12 22:27 (KST) 기준 작업 이력 반영 - 검증: dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\verify\ -p:IntermediateOutputPath=obj\verify\ (경고 0, 오류 0)
This commit is contained in:
@@ -52,7 +52,18 @@ public partial class ChatWindow
|
||||
|
||||
var draftText = InputBox?.Text ?? "";
|
||||
var draftTokens = string.IsNullOrWhiteSpace(draftText) ? 0 : Services.TokenEstimator.Estimate(draftText) + 4;
|
||||
var currentTokens = Math.Max(0, messageTokens + draftTokens);
|
||||
|
||||
// 시스템 프롬프트 + 도구 정의 오버헤드: 첫 메시지 전송 이후에만 포함
|
||||
// 새 대화(메시지 0개)에서는 0% 표시 — 사용자 혼동 방지
|
||||
var hasAnyMessages = messageTokens > 0 || _isStreaming;
|
||||
int baseOverhead = 0;
|
||||
if (hasAnyMessages)
|
||||
{
|
||||
var sysPromptLen = _llm?.SystemPrompt?.Length ?? 0;
|
||||
var toolCount = _toolRegistry?.GetActiveToolsForTab(_activeTab ?? "Chat")?.Count ?? 0;
|
||||
baseOverhead = Services.TokenEstimator.EstimateBaseOverhead(sysPromptLen, toolCount);
|
||||
}
|
||||
var currentTokens = Math.Max(0, messageTokens + draftTokens + baseOverhead);
|
||||
var usageRatio = Services.TokenEstimator.GetContextUsage(currentTokens, maxContextTokens);
|
||||
|
||||
var accentBrush = TryFindResource("AccentColor") as Brush ?? Brushes.DodgerBlue;
|
||||
@@ -102,14 +113,15 @@ public partial class ChatWindow
|
||||
TokenUsageHintText.Text = $"{Services.TokenEstimator.Format(currentTokens)} / {Services.TokenEstimator.Format(maxContextTokens)}";
|
||||
CompactNowLabel.Text = compactLabel;
|
||||
|
||||
ViewModel.ContextTokens = currentTokens;
|
||||
ViewModel.MaxContextTokens = maxContextTokens;
|
||||
|
||||
if (TokenUsagePopupTitle != null)
|
||||
TokenUsagePopupTitle.Text = $"컨텍스트 창 {percentText}";
|
||||
if (TokenUsagePopupUsage != null)
|
||||
TokenUsagePopupUsage.Text = $"{Services.TokenEstimator.Format(currentTokens)}/{Services.TokenEstimator.Format(maxContextTokens)}";
|
||||
if (TokenUsagePopupDetail != null)
|
||||
TokenUsagePopupDetail.Text = _pendingPostCompaction
|
||||
? $"compact 후 첫 응답 대기 중 · {detailText}"
|
||||
: detailText;
|
||||
TokenUsagePopupDetail.Text = detailText;
|
||||
if (TokenUsagePopupCompact != null)
|
||||
TokenUsagePopupCompact.Text = _sessionCompactionCount > 0
|
||||
? $"누적 압축 {_sessionCompactionCount}회 · 절감 {FormatTokenCount(_sessionCompactionSavedTokens)} tokens"
|
||||
|
||||
Reference in New Issue
Block a user