AX Agent 코워크·코드 흐름과 컨텍스트 관리를 claude-code 기준으로 대폭 정리
- 코워크·코드 프롬프트, 도구 선택, 문서 생성/검증 흐름을 claude-code 동등 품질 기준으로 재정렬함 - OpenAI/vLLM 경로의 오래된 tool history를 평탄화하고 최근 이력만 구조화해 컨텍스트 직렬화를 경량화함 - AX Agent UI를 테마 기준으로 재구성하고 플랜 승인/오버레이/이벤트 렌더링/명령 입력 상호작용을 개선함 - 파일 후보 제안, 반복 경로 정체 복구, LSP 보강, 문서·PPT 처리 개선, 설정/서비스 인터페이스 정리를 함께 반영함 - README.md 및 docs/DEVELOPMENT.md를 작업 시점별로 갱신함 - 검증: 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:
@@ -5,7 +5,7 @@ using AxCopilot.Services.Agent;
|
||||
|
||||
namespace AxCopilot.Services;
|
||||
|
||||
public class SettingsService
|
||||
public class SettingsService : ISettingsService
|
||||
{
|
||||
private static readonly string AppDataDir = InitAppDataDir();
|
||||
|
||||
@@ -186,12 +186,13 @@ public class SettingsService
|
||||
}
|
||||
catch (IOException) when (attempt < 2)
|
||||
{
|
||||
Thread.Sleep(50 * (attempt + 1));
|
||||
// SpinWait으로 짧은 지연 (Thread.Sleep보다 UI 블로킹 최소화)
|
||||
Thread.SpinWait(50_000 * (attempt + 1));
|
||||
}
|
||||
catch (Exception ex) when (attempt < 2)
|
||||
{
|
||||
LogService.Warn($"settings.dat 저장 재시도 {attempt + 1}/3: {ex.Message}");
|
||||
Thread.Sleep(50 * (attempt + 1));
|
||||
Thread.SpinWait(50_000 * (attempt + 1));
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -203,6 +204,42 @@ public class SettingsService
|
||||
SettingsChanged?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
/// <summary>비동기 설정 저장. UI 스레드에서 호출 시 블로킹 없이 저장합니다.</summary>
|
||||
public async Task SaveAsync()
|
||||
{
|
||||
EnsureDirectories();
|
||||
NormalizeRuntimeSettings();
|
||||
var json = JsonSerializer.Serialize(_settings, JsonOptions);
|
||||
var encrypted = CryptoService.PortableEncrypt(json);
|
||||
|
||||
await Task.Run(() =>
|
||||
{
|
||||
lock (_saveLock)
|
||||
{
|
||||
var tmpPath = SettingsPath + ".tmp";
|
||||
for (int attempt = 0; attempt < 3; attempt++)
|
||||
{
|
||||
try
|
||||
{
|
||||
File.WriteAllText(tmpPath, encrypted);
|
||||
File.Move(tmpPath, SettingsPath, overwrite: true);
|
||||
break;
|
||||
}
|
||||
catch (Exception ex) when (attempt < 2)
|
||||
{
|
||||
LogService.Warn($"settings.dat 비동기 저장 재시도 {attempt + 1}/3: {ex.Message}");
|
||||
Thread.Sleep(50 * (attempt + 1));
|
||||
}
|
||||
finally
|
||||
{
|
||||
try { if (File.Exists(tmpPath)) File.Delete(tmpPath); } catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
}).ConfigureAwait(false);
|
||||
SettingsChanged?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
private void NormalizeRuntimeSettings()
|
||||
{
|
||||
var expressionLevel = (_settings.Llm.AgentUiExpressionLevel ?? "").Trim().ToLowerInvariant();
|
||||
|
||||
Reference in New Issue
Block a user