전체 코드 오류와 성능 병목을 점검하고 핵심 핫패스를 정리한다
Some checks failed
Release Gate / gate (push) Has been cancelled

- 런처 색인에서 임시 파일, 숨김/시스템 경로, Office 임시 파일을 감시와 색인 대상에서 제외해 불필요한 재색인과 디스크 I/O를 줄인다

- AX Agent 표현 수준 저장값이 매번 rich로 덮어쓰이던 버그를 수정해 balanced/simple/rich 설정이 실제로 유지되게 한다

- 최소화/숨김 상태의 AX Agent 창은 transcript 재렌더를 지연했다가 다시 보일 때 한 번만 처리하고, 런처 인덱스 상태 타이머도 재사용하도록 바꿔 백그라운드 오버헤드를 줄인다

- 검증: 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:
2026-04-06 23:19:02 +09:00
parent 30e8218ba4
commit 45dfa70951
6 changed files with 112 additions and 24 deletions

View File

@@ -28,6 +28,20 @@ public class IndexService : IDisposable
"target"
};
private static readonly HashSet<string> IgnoredFileExtensions = new(StringComparer.OrdinalIgnoreCase)
{
".tmp",
".temp",
".cache",
".log",
".bak",
".swp",
".swo",
".part",
".download",
".crdownload"
};
private readonly SettingsService _settings;
private readonly List<FileSystemWatcher> _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))
{

View File

@@ -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)

View File

@@ -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<string, string> _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

View File

@@ -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;
}
/// <summary>
/// 액션 모드에서 특수 처리가 필요한 동작(삭제/이름변경)을 처리합니다.
/// 처리되면 true 반환 → ExecuteSelectedAsync 호출 생략.