compact 이후 복원 메모 계층화와 compact UI 메타 축소
- post_compact_context 메시지에 compact summary 수와 structured tool history 블록 수를 추가해 compact 뒤 첫 query turn의 복원 맥락을 더 명확히 전달함 - compact 메타 카드를 더 짧은 한 줄 요약과 파일 개수 중심으로 줄여 transcript에서 운영 메타 밀도를 낮춤 - 컨텍스트 사용 팝업의 compact 디테일을 짧은 한국어 표현으로 정리해 claw-code 스타일의 얇은 운영 표현에 가깝게 맞춤 - README.md 및 docs/DEVELOPMENT.md를 2026-04-12 23:23 (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:
@@ -153,11 +153,25 @@ public static class AgentQueryContextBuilder
|
||||
.Take(5)
|
||||
.ToList();
|
||||
var imageCount = messages.Sum(m => m.Images?.Count ?? 0);
|
||||
var compactSummaryCount = messages.Count(m =>
|
||||
string.Equals(m.MetaKind, "microcompact_boundary", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(m.MetaKind, "session_memory_compaction", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(m.MetaKind, "collapsed_boundary", StringComparison.OrdinalIgnoreCase));
|
||||
var structuredToolHistoryCount = messages.Count(m =>
|
||||
{
|
||||
var content = m.Content ?? "";
|
||||
return content.StartsWith("{\"_tool_use_blocks\"", StringComparison.Ordinal)
|
||||
|| content.StartsWith("{\"type\":\"tool_result\"", StringComparison.Ordinal);
|
||||
});
|
||||
|
||||
if (attachedFiles.Count == 0 && imageCount == 0)
|
||||
if (attachedFiles.Count == 0 && imageCount == 0 && compactSummaryCount == 0 && structuredToolHistoryCount == 0)
|
||||
return;
|
||||
|
||||
var lines = new List<string> { "[post-compact context]" };
|
||||
if (compactSummaryCount > 0)
|
||||
lines.Add($"restored compact summaries: {compactSummaryCount}");
|
||||
if (structuredToolHistoryCount > 0)
|
||||
lines.Add($"restored tool history blocks: {structuredToolHistoryCount}");
|
||||
if (attachedFiles.Count > 0)
|
||||
lines.Add("restored file refs: " + string.Join(", ", attachedFiles));
|
||||
if (imageCount > 0)
|
||||
|
||||
Reference in New Issue
Block a user