에이전트 선택적 탐색 구조 개선과 경고 정리 반영
Some checks failed
Release Gate / gate (push) Has been cancelled

- claude-code 선택적 탐색 흐름을 참고해 Cowork/Code 시스템 프롬프트에서 folder_map 상시 선행 지시를 완화하고 glob/grep 기반 좁은 탐색을 우선하도록 조정함

- FolderMapTool 기본 depth를 2로, include_files 기본값을 false로 낮추고 MultiReadTool 최대 파일 수를 8개로 줄여 초기 과탐색 폭을 보수적으로 조정함

- AgentLoopExplorationPolicy partial을 추가해 탐색 범위 분류, broad-scan corrective hint, exploration_breadth 성능 로그를 연결함

- AgentLoopService에 탐색 범위 가이드 주입과 실행 중 탐색 폭 추적을 추가하고, 좁은 질문에서 반복적인 folder_map/대량 multi_read를 교정하도록 정리함

- DocxToHtmlConverter nullable 경고를 수정해 Release 빌드 경고 0 / 오류 0 기준을 다시 충족함

- README와 docs/DEVELOPMENT.md에 2026-04-09 10:36 (KST) 기준 개발 이력을 반영함
This commit is contained in:
2026-04-09 14:27:59 +09:00
parent 7931566212
commit 33c1db4dae
119 changed files with 4453 additions and 6943 deletions

View File

@@ -54,18 +54,18 @@ public class JsonTool : IAgentTool
public Task<ToolResult> ExecuteAsync(JsonElement args, AgentContext context, CancellationToken ct = default)
{
var action = args.GetProperty("action").GetString() ?? "";
var json = args.GetProperty("json").GetString() ?? "";
var action = args.GetProperty("action").SafeGetString() ?? "";
var json = args.GetProperty("json").SafeGetString() ?? "";
try
{
return Task.FromResult(action switch
{
"validate" => Validate(json),
"format" => Format(json, args.TryGetProperty("minify", out var m) && m.GetString() == "true"),
"query" => Query(json, args.TryGetProperty("path", out var p) ? p.GetString() ?? "" : ""),
"format" => Format(json, args.SafeTryGetProperty("minify", out var m) && m.SafeGetString() == "true"),
"query" => Query(json, args.SafeTryGetProperty("path", out var p) ? p.SafeGetString() ?? "" : ""),
"keys" => Keys(json),
"convert" => Convert(json, args.TryGetProperty("target_format", out var tf) ? tf.GetString() ?? "csv" : "csv"),
"convert" => Convert(json, args.SafeTryGetProperty("target_format", out var tf) ? tf.SafeGetString() ?? "csv" : "csv"),
_ => ToolResult.Fail($"Unknown action: {action}"),
});
}
@@ -122,7 +122,7 @@ public class JsonTool : IAgentTool
}
else
{
if (current.ValueKind != JsonValueKind.Object || !current.TryGetProperty(segment.Key, out var prop))
if (current.ValueKind != JsonValueKind.Object || !current.SafeTryGetProperty(segment.Key, out var prop))
return ToolResult.Fail($"Key '{segment.Key}' not found");
current = prop;
}
@@ -130,7 +130,7 @@ public class JsonTool : IAgentTool
var value = current.ValueKind switch
{
JsonValueKind.String => current.GetString() ?? "",
JsonValueKind.String => current.SafeGetString() ?? "",
JsonValueKind.Number => current.GetRawText(),
JsonValueKind.True => "true",
JsonValueKind.False => "false",
@@ -192,9 +192,9 @@ public class JsonTool : IAgentTool
{
var values = allKeys.Select(k =>
{
if (!item.TryGetProperty(k, out var v)) return "\"\"";
if (!item.SafeTryGetProperty(k, out var v)) return "\"\"";
return v.ValueKind == JsonValueKind.String
? $"\"{v.GetString()?.Replace("\"", "\"\"") ?? ""}\""
? $"\"{v.SafeGetString()?.Replace("\"", "\"\"") ?? ""}\""
: v.GetRawText();
});
sb.AppendLine(string.Join(",", values));