코워크 문서 계획/생성 흐름을 claw-code 기준으로 복구

- document_plan 결과에서 body 골격과 후속 생성 도구를 안정적으로 추출하도록 AgentLoop 분기를 수정

- 코워크 문서형 작업은 planMode=off여도 계획 선행(always) 경로를 타도록 보정

- 코워크 시스템 프롬프트를 강화해 계획만 제시하고 끝나지 않고 실제 문서 파일 생성까지 이어지게 조정

- README와 DEVELOPMENT 문서에 2026-04-05 16:02 (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:
2026-04-05 14:05:18 +09:00
parent 35fbfc933d
commit 9fafcd0192
6 changed files with 98 additions and 16 deletions

View File

@@ -200,7 +200,7 @@ public partial class AgentLoopService
maxRetry = ComputeQualityAwareMaxRetry(maxRetry, recentTaskRetryQuality, taskPolicy.TaskType);
// 플랜 모드 설정
var planMode = llm.PlanMode ?? "off"; // off | always | auto
var planMode = ResolveEffectivePlanMode(llm.PlanMode, ActiveTab, taskPolicy.TaskType); // off | always | auto
var context = BuildContext();
InjectTaskTypeGuidance(messages, taskPolicy);
@@ -2096,6 +2096,24 @@ public partial class AgentLoopService
return string.Equals(activeTab, "Code", StringComparison.OrdinalIgnoreCase) ? "feature" : "general";
}
internal static string ResolveEffectivePlanMode(string? configuredPlanMode, string? activeTab, string? taskType)
{
var normalizedPlanMode = (configuredPlanMode ?? "off").Trim().ToLowerInvariant();
if (normalizedPlanMode is not ("off" or "auto" or "always"))
normalizedPlanMode = "off";
if (string.Equals(activeTab, "Cowork", StringComparison.OrdinalIgnoreCase)
&& string.Equals(taskType, "docs", StringComparison.OrdinalIgnoreCase)
&& normalizedPlanMode == "off")
{
// claw-code 레퍼런스처럼 문서형 코워크는 실행 전에 구조를 먼저 세우고,
// 그 계획을 바탕으로 실제 산출물 생성 단계까지 이어가도록 기본값을 보정합니다.
return "always";
}
return normalizedPlanMode;
}
private static void InjectTaskTypeGuidance(List<ChatMessage> messages, TaskTypePolicy taskPolicy)
{
if (messages.Any(m => m.Role == "user" && m.Content.StartsWith("[System:TaskType]", StringComparison.OrdinalIgnoreCase)))