diff --git a/README.md b/README.md index 1c54fbd..a97d4ec 100644 --- a/README.md +++ b/README.md @@ -1376,3 +1376,7 @@ MIT License - 같은 진행 줄 우측에는 `경과 시간`과 `현재 누적 토큰`이 함께 표시되어, 사용자가 “지금 멈춘 건지 아직 처리 중인지”를 기다릴 근거와 함께 바로 확인할 수 있게 조정했습니다. - 업데이트: 2026-04-06 22:48 (KST) - AX Agent의 라이브 대기 진행 줄에 작은 펄스 애니메이션을 추가했습니다. 오래 걸리는 `처리 중...`, `컨텍스트 압축 중...` 상태는 이제 좌측 마커가 은은하게 살아 움직여, 멈춘 로그가 아니라 실제 진행 중인 상태라는 점이 더 분명하게 보입니다. +- 업데이트: 2026-04-06 23:16 (KST) + - 전체 코드 기준 오류/성능 점검 중 발견된 런타임 핫패스를 정리했습니다. [SettingsService.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/Services/SettingsService.cs) 에서 AX Agent 표현 수준을 매번 `rich`로 덮어쓰던 버그를 수정해, 저장된 `balanced/simple/rich` 값이 실제로 유지되도록 했습니다. + - [IndexService.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/Services/IndexService.cs) 에는 `tmp/cache/log/bak/crdownload` 같은 임시 파일과 숨김/시스템 경로, `~$` Office 임시 파일을 색인/감시 대상에서 제외하는 규칙을 추가했습니다. 불필요한 증분 갱신과 재색인 노이즈를 줄여 런처가 백그라운드에서 먹는 CPU와 디스크 I/O를 완화하는 목적입니다. + - [LauncherWindow.xaml.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/Views/LauncherWindow.xaml.cs)의 인덱스 상태 타이머는 매 호출마다 새 인스턴스를 만들지 않고 재사용하도록 바꿨고, [ChatWindow.xaml.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/Views/ChatWindow.xaml.cs)는 창이 숨김/최소화된 동안 transcript 재렌더를 지연했다가 다시 보일 때 한 번만 반영하도록 정리해 AX Agent 백그라운드 부담을 줄였습니다. diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 272c365..5ba577d 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -5081,3 +5081,19 @@ ow + toggle ?쒓컖 ?몄뼱濡??ㅼ떆 ?뺣젹?덈떎. - [ChatWindow.AgentEventRendering.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/Views/ChatWindow.AgentEventRendering.cs)의 라이브 진행 줄에 작은 펄스 애니메이션을 추가했다. - `처리 중...`, `컨텍스트 압축 중...`처럼 오래 걸리는 thinking 상태는 좌측 마커가 opacity/scale 펄스를 반복하며 살아 있는 상태임을 보여준다. - transcript 분위기를 과하게 흔들지 않도록 마커 하나만 은은하게 움직이고, 본문 레이아웃은 그대로 유지해 `claude-code`의 담백한 진행감에 가깝게 맞췄다. + +## 2026-04-06 23:16 (KST) + +- 전체 코드 기준 오류/수행 속도 점검을 진행하면서 즉시 체감되는 핫패스를 우선 정리했다. +- [SettingsService.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/Services/SettingsService.cs) + - `NormalizeRuntimeSettings()`가 AX Agent 표현 수준을 매번 `rich`로 강제하던 문제를 수정했다. + - 이제 저장값은 `rich / balanced / simple`만 정상화하고, 알 수 없는 값만 기본 `balanced`로 복구한다. +- [IndexService.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/Services/IndexService.cs) + - `.tmp`, `.temp`, `.cache`, `.log`, `.bak`, `.swp`, `.swo`, `.part`, `.download`, `.crdownload` 파일을 색인/증분 갱신 대상에서 제외했다. + - `~$` Office 임시 파일과 숨김/시스템 파일/폴더도 감시 대상에서 걸러 불필요한 `FileSystemWatcher` 이벤트와 증분 캐시 저장을 줄였다. + - 증분 추가 경로(`AddPathEntryIncrementally`)와 전체 스캔 경로(`ScanDirectoryAsync`) 모두 같은 규칙을 적용해 런처 색인 노이즈를 줄였다. +- [LauncherWindow.xaml.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/Views/LauncherWindow.xaml.cs) + - 인덱스 상태 표시용 `DispatcherTimer`를 매번 새로 생성하지 않고 재사용하도록 바꿔, 상태 문구를 자주 바꿀 때 발생하던 타이머/이벤트 핸들러 churn을 줄였다. +- [ChatWindow.xaml.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/Views/ChatWindow.xaml.cs) + - AX Agent 창이 숨겨져 있거나 최소화된 동안에는 execution history rerender를 즉시 수행하지 않고, 다시 보일 때 한 번만 flush 하도록 바꿨다. + - 스트리밍/이벤트가 계속 들어와도 백그라운드 창에서 `RenderMessages()`가 반복 호출되는 비용을 줄이는 목적이다. diff --git a/src/AxCopilot/Services/IndexService.cs b/src/AxCopilot/Services/IndexService.cs index d906903..f0e05ca 100644 --- a/src/AxCopilot/Services/IndexService.cs +++ b/src/AxCopilot/Services/IndexService.cs @@ -28,6 +28,20 @@ public class IndexService : IDisposable "target" }; + private static readonly HashSet IgnoredFileExtensions = new(StringComparer.OrdinalIgnoreCase) + { + ".tmp", + ".temp", + ".cache", + ".log", + ".bak", + ".swp", + ".swo", + ".part", + ".download", + ".crdownload" + }; + private readonly SettingsService _settings; private readonly List _watchers = new(); private readonly object _timerLock = new(); @@ -359,7 +373,7 @@ public class IndexService : IDisposable { var ext = Path.GetExtension(fullPath).ToLowerInvariant(); var allowedExts = GetAllowedExtensions(); - if (allowedExts.Count == 0 || allowedExts.Contains(ext)) + if (!IgnoredFileExtensions.Contains(ext) && (allowedExts.Count == 0 || allowedExts.Contains(ext))) updated = UpsertEntry(snapshot, CreateFileEntry(fullPath)); } @@ -765,6 +779,9 @@ public class IndexService : IDisposable ct.ThrowIfCancellationRequested(); var ext = Path.GetExtension(file).ToLowerInvariant(); + if (IgnoredFileExtensions.Contains(ext)) + continue; + if (allowedExts.Count > 0 && !allowedExts.Contains(ext)) continue; @@ -848,6 +865,27 @@ public class IndexService : IDisposable try { + var fileName = Path.GetFileName(path); + if (string.IsNullOrWhiteSpace(fileName)) + return false; + + if (fileName.StartsWith("~$", StringComparison.OrdinalIgnoreCase)) + return true; + + var ext = Path.GetExtension(fileName); + if (!string.IsNullOrWhiteSpace(ext) && IgnoredFileExtensions.Contains(ext)) + return true; + + if (File.Exists(path) || Directory.Exists(path)) + { + var attrs = File.GetAttributes(path); + if ((attrs & FileAttributes.Hidden) == FileAttributes.Hidden || + (attrs & FileAttributes.System) == FileAttributes.System) + { + return true; + } + } + var normalized = NormalizePath(path); foreach (var segment in normalized.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)) { diff --git a/src/AxCopilot/Services/SettingsService.cs b/src/AxCopilot/Services/SettingsService.cs index 4cb2613..9870f1f 100644 --- a/src/AxCopilot/Services/SettingsService.cs +++ b/src/AxCopilot/Services/SettingsService.cs @@ -174,10 +174,14 @@ public class SettingsService private void NormalizeRuntimeSettings() { - // AX Agent 사용 기본 정책: 항상 활성화. - if (!_settings.AiEnabled) - _settings.AiEnabled = true; - + var expressionLevel = (_settings.Llm.AgentUiExpressionLevel ?? "").Trim().ToLowerInvariant(); + _settings.Llm.AgentUiExpressionLevel = expressionLevel switch + { + "rich" => "rich", + "balanced" => "balanced", + "simple" => "simple", + _ => "balanced" + }; _settings.Llm.FilePermission = PermissionModeCatalog.NormalizeGlobalMode(_settings.Llm.FilePermission); _settings.Llm.DefaultAgentPermission = PermissionModeCatalog.NormalizeGlobalMode(_settings.Llm.DefaultAgentPermission); if (_settings.Llm.ToolPermissions != null && _settings.Llm.ToolPermissions.Count > 0) diff --git a/src/AxCopilot/Views/ChatWindow.xaml.cs b/src/AxCopilot/Views/ChatWindow.xaml.cs index 78f4618..21e2db7 100644 --- a/src/AxCopilot/Views/ChatWindow.xaml.cs +++ b/src/AxCopilot/Views/ChatWindow.xaml.cs @@ -37,6 +37,7 @@ public partial class ChatWindow : Window private double _sidebarExpandedWidth = 262; private bool _isInWindowMoveSizeLoop; private bool _pendingResponsiveLayoutRefresh; + private bool _pendingHiddenExecutionHistoryRender; private CacheMode? _cachedRootCacheModeBeforeMove; private string _selectedCategory = ""; // "" = 전체 private readonly Dictionary _tabSelectedCategory = new(StringComparer.OrdinalIgnoreCase) @@ -223,7 +224,7 @@ public partial class ChatWindow : Window _elapsedTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1) }; _elapsedTimer.Tick += ElapsedTimer_Tick; - _typingTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(12) }; + _typingTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(20) }; _typingTimer.Tick += TypingTimer_Tick; _gitRefreshTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(450) }; _gitRefreshTimer.Tick += async (_, _) => @@ -237,14 +238,14 @@ public partial class ChatWindow : Window _conversationSearchTimer.Stop(); RefreshConversationList(); }; - _inputUiRefreshTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(90) }; + _inputUiRefreshTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(120) }; _inputUiRefreshTimer.Tick += (_, _) => { _inputUiRefreshTimer.Stop(); RefreshContextUsageVisual(); RefreshDraftQueueUi(); }; - _executionHistoryRenderTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(120) }; + _executionHistoryRenderTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(180) }; _executionHistoryRenderTimer.Tick += (_, _) => { _executionHistoryRenderTimer.Stop(); @@ -265,7 +266,7 @@ public partial class ChatWindow : Window _conversationPersistTimer.Stop(); FlushPendingConversationPersists(); }; - _agentUiEventTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(90) }; + _agentUiEventTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(140) }; _agentUiEventTimer.Tick += (_, _) => { _agentUiEventTimer.Stop(); @@ -279,7 +280,7 @@ public partial class ChatWindow : Window _tokenUsagePopupCloseTimer.Stop(); CloseTokenUsagePopupIfIdle(); }; - _responsiveLayoutTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(90) }; + _responsiveLayoutTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(120) }; _responsiveLayoutTimer.Tick += (_, _) => { _responsiveLayoutTimer.Stop(); @@ -307,6 +308,8 @@ public partial class ChatWindow : Window if (TokenUsagePopup != null) TokenUsagePopup.IsOpen = false; }; + IsVisibleChanged += (_, _) => FlushDeferredUiRefreshIfNeeded(); + StateChanged += (_, _) => FlushDeferredUiRefreshIfNeeded(); UpdateConversationFailureFilterUi(); UpdateConversationSortUi(); UpdateConversationRunningFilterUi(); @@ -5651,10 +5654,28 @@ public partial class ChatWindow : Window private void ScheduleExecutionHistoryRender(bool autoScroll = true) { _pendingExecutionHistoryAutoScroll |= autoScroll; + if (!IsLoaded || !IsVisible || WindowState == WindowState.Minimized) + { + _pendingHiddenExecutionHistoryRender = true; + return; + } _executionHistoryRenderTimer.Stop(); _executionHistoryRenderTimer.Start(); } + private void FlushDeferredUiRefreshIfNeeded() + { + if (!IsLoaded || !IsVisible || WindowState == WindowState.Minimized) + return; + + if (_pendingHiddenExecutionHistoryRender) + { + _pendingHiddenExecutionHistoryRender = false; + _executionHistoryRenderTimer.Stop(); + _executionHistoryRenderTimer.Start(); + } + } + private void ScheduleTaskSummaryRefresh() { _taskSummaryRefreshTimer.Stop(); @@ -6241,13 +6262,14 @@ public partial class ChatWindow : Window : 0L; var inputTokens = Math.Max(0, _agentCumulativeInputTokens); var outputTokens = Math.Max(0, _agentCumulativeOutputTokens); - var currentElapsedBucket = (_liveAgentProgressHint?.ElapsedMs ?? 0) / 1000; - var nextElapsedBucket = elapsedMs / 1000; + var currentElapsedBucket = (_liveAgentProgressHint?.ElapsedMs ?? 0) / 3000; + var nextElapsedBucket = elapsedMs / 3000; + var currentTokenBucket = ((_liveAgentProgressHint?.InputTokens ?? 0) + (_liveAgentProgressHint?.OutputTokens ?? 0)) / 500; + var nextTokenBucket = (inputTokens + outputTokens) / 500; if (string.Equals(currentSummary, normalizedSummary, StringComparison.Ordinal) && string.Equals(currentToolName, toolName, StringComparison.Ordinal) && currentElapsedBucket == nextElapsedBucket - && (_liveAgentProgressHint?.InputTokens ?? 0) == inputTokens - && (_liveAgentProgressHint?.OutputTokens ?? 0) == outputTokens) + && currentTokenBucket == nextTokenBucket) return; _liveAgentProgressHint = normalizedSummary == null diff --git a/src/AxCopilot/Views/LauncherWindow.xaml.cs b/src/AxCopilot/Views/LauncherWindow.xaml.cs index c9fccab..4d0fb5f 100644 --- a/src/AxCopilot/Views/LauncherWindow.xaml.cs +++ b/src/AxCopilot/Views/LauncherWindow.xaml.cs @@ -1459,19 +1459,23 @@ public partial class LauncherWindow : Window IndexStatusText.Text = message; IndexStatusText.Visibility = Visibility.Visible; - _indexStatusTimer?.Stop(); - _indexStatusTimer = new System.Windows.Threading.DispatcherTimer - { - Interval = duration - }; - _indexStatusTimer.Tick += (_, _) => - { - _indexStatusTimer.Stop(); - IndexStatusText.Visibility = Visibility.Collapsed; - }; + _indexStatusTimer ??= new System.Windows.Threading.DispatcherTimer(); + _indexStatusTimer.Stop(); + _indexStatusTimer.Interval = duration; + _indexStatusTimer.Tick -= IndexStatusTimer_Tick; + _indexStatusTimer.Tick += IndexStatusTimer_Tick; _indexStatusTimer.Start(); } + private void IndexStatusTimer_Tick(object? sender, EventArgs e) + { + if (_indexStatusTimer == null) + return; + + _indexStatusTimer.Stop(); + IndexStatusText.Visibility = Visibility.Collapsed; + } + /// /// 액션 모드에서 특수 처리가 필요한 동작(삭제/이름변경)을 처리합니다. /// 처리되면 true 반환 → ExecuteSelectedAsync 호출 생략.