AX Agent의 Cowork·Code 강제 로직을 claude-code 기준으로 추가 완화
Cowork·Code 프롬프트의 text-only 완료 조건을 완화하고, 실제 산출물 생성이나 코드 수정이 필요한 경우에만 도구 재강제를 걸도록 AgentLoopService를 조정했다. Code 검증 게이트는 diff 또는 최근 build/test 근거가 있으면 중복 재검증을 덜 하도록 줄였고, docs 정책은 creation tool 우선 + document_plan 선택형으로 정리했으며 folder_map 노출 우선순위를 한 단계 낮췄다. README.md와 docs/DEVELOPMENT.md에 2026-04-10 09: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:
@@ -718,7 +718,13 @@ public partial class AgentLoopService
|
||||
// 도구 호출이 없으면 루프 종료 — 단, 문서 생성 요청인데 파일이 미생성이면 자동 저장
|
||||
if (toolCalls.Count == 0)
|
||||
{
|
||||
if (totalToolCalls == 0
|
||||
var requiresConcreteArtifactOrEdit =
|
||||
string.Equals(ActiveTab, "Code", StringComparison.OrdinalIgnoreCase)
|
||||
? taskPolicy.TaskType is "bugfix" or "feature" or "refactor"
|
||||
: IsDocumentCreationRequest(userQuery);
|
||||
|
||||
if (requiresConcreteArtifactOrEdit
|
||||
&& totalToolCalls == 0
|
||||
&& consecutiveNoToolResponses >= noToolResponseThreshold
|
||||
&& runState.NoToolCallLoopRetry < noToolRecoveryMaxRetries)
|
||||
{
|
||||
@@ -763,7 +769,8 @@ public partial class AgentLoopService
|
||||
|
||||
// 계획이 있고 도구가 아직 한 번도 실행되지 않은 경우 → LLM이 도구 대신 텍스트로만 응답한 것
|
||||
// "계획이 승인됐으니 도구를 호출하라"는 메시지를 추가하여 재시도 (최대 2회)
|
||||
if (executionPolicy.ForceToolCallAfterPlan
|
||||
if (requiresConcreteArtifactOrEdit
|
||||
&& executionPolicy.ForceToolCallAfterPlan
|
||||
&& planSteps.Count > 0
|
||||
&& totalToolCalls == 0
|
||||
&& planExecutionRetry < planExecutionRetryMax)
|
||||
@@ -796,7 +803,8 @@ public partial class AgentLoopService
|
||||
}
|
||||
|
||||
// 문서 생성 우선 프로파일은 재시도보다 빠른 fallback을 우선합니다.
|
||||
if (documentPlanCalled
|
||||
if (requiresConcreteArtifactOrEdit
|
||||
&& documentPlanCalled
|
||||
&& executionPolicy.PreferAggressiveDocumentFallback
|
||||
&& !string.IsNullOrEmpty(documentPlanScaffold)
|
||||
&& !_docFallbackAttempted)
|
||||
@@ -805,7 +813,8 @@ public partial class AgentLoopService
|
||||
}
|
||||
|
||||
// document_plan은 호출됐지만 terminal 문서 도구(html_create 등)가 미호출인 경우 → 프로파일 기준 재시도
|
||||
if (documentPlanCalled && postDocumentPlanRetry < documentPlanRetryMax)
|
||||
if (requiresConcreteArtifactOrEdit
|
||||
&& documentPlanCalled && postDocumentPlanRetry < documentPlanRetryMax)
|
||||
{
|
||||
postDocumentPlanRetry++;
|
||||
if (!string.IsNullOrEmpty(textResponse))
|
||||
@@ -820,7 +829,8 @@ public partial class AgentLoopService
|
||||
}
|
||||
|
||||
// 재시도도 모두 소진 → 앱이 직접 본문 생성 후 html_create 강제 실행
|
||||
if (documentPlanCalled && !string.IsNullOrEmpty(documentPlanScaffold) && !_docFallbackAttempted)
|
||||
if (requiresConcreteArtifactOrEdit
|
||||
&& documentPlanCalled && !string.IsNullOrEmpty(documentPlanScaffold) && !_docFallbackAttempted)
|
||||
{
|
||||
_docFallbackAttempted = true;
|
||||
EmitEvent(AgentEventType.Thinking, "", "LLM이 html_create를 호출하지 않아 앱에서 직접 문서를 생성합니다...");
|
||||
|
||||
Reference in New Issue
Block a user