탭별 설정 해석기를 도입해 Cowork/Code 분기 동작을 단일화
Some checks failed
Release Gate / gate (push) Has been cancelled
Some checks failed
Release Gate / gate (push) Has been cancelled
- AgentTabSettingsResolver 신규 추가: 탭 판별, post-tool 검증 활성 여부, Code 전용 비활성 도구 목록 계산 - AgentLoopService.MergeDisabledTools에서 Code 전용 도구 비활성 계산을 resolver 경로로 전환 - AgentLoopTransitions.Execution에서 post-tool verification 판단 시 resolver 결과를 사용하도록 정리 - AgentTabSettingsResolverTests 신규 추가(탭 판별/검증 플래그 분기/비활성 도구 계산) - README.md 업데이트 시각(2026-04-04 13:32 KST) 및 변경 이력 항목 갱신 - docs/DEVELOPMENT.md 연속 실행 28차 이력 추가 - 검증: dotnet build(use shared compilation off) 경고 0/오류 0, 필터 테스트 49건 통과
This commit is contained in:
@@ -1589,33 +1589,13 @@ public partial class AgentLoopService
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.Equals(ActiveTab, "Code", StringComparison.OrdinalIgnoreCase))
|
||||
if (!AgentTabSettingsResolver.IsCodeTab(ActiveTab))
|
||||
return disabled;
|
||||
|
||||
var code = _settings.Settings.Llm.Code;
|
||||
if (!code.EnablePlanModeTools)
|
||||
foreach (var toolName in AgentTabSettingsResolver.EnumerateCodeTabDisabledTools(code))
|
||||
{
|
||||
disabled.Add("enter_plan_mode");
|
||||
disabled.Add("exit_plan_mode");
|
||||
}
|
||||
|
||||
if (!code.EnableWorktreeTools)
|
||||
{
|
||||
disabled.Add("enter_worktree");
|
||||
disabled.Add("exit_worktree");
|
||||
}
|
||||
|
||||
if (!code.EnableTeamTools)
|
||||
{
|
||||
disabled.Add("team_create");
|
||||
disabled.Add("team_delete");
|
||||
}
|
||||
|
||||
if (!code.EnableCronTools)
|
||||
{
|
||||
disabled.Add("cron_create");
|
||||
disabled.Add("cron_delete");
|
||||
disabled.Add("cron_list");
|
||||
disabled.Add(toolName);
|
||||
}
|
||||
|
||||
return disabled;
|
||||
|
||||
@@ -1399,12 +1399,13 @@ public partial class AgentLoopService
|
||||
if (!result.Success || !IsTerminalDocumentTool(call.ToolName) || toolCalls.Count != 1)
|
||||
return (false, false);
|
||||
|
||||
var verificationEnabled = AgentTabSettingsResolver.IsPostToolVerificationEnabled(ActiveTab, llm);
|
||||
var shouldVerify = ShouldRunPostToolVerification(
|
||||
ActiveTab,
|
||||
call.ToolName,
|
||||
result.Success,
|
||||
llm.Code.EnableCodeVerification,
|
||||
llm.EnableCoworkVerification);
|
||||
verificationEnabled,
|
||||
verificationEnabled);
|
||||
var consumedExtraIteration = false;
|
||||
if (shouldVerify)
|
||||
{
|
||||
@@ -1427,12 +1428,13 @@ public partial class AgentLoopService
|
||||
if (!result.Success)
|
||||
return false;
|
||||
|
||||
var verificationEnabled = AgentTabSettingsResolver.IsPostToolVerificationEnabled(ActiveTab, llm);
|
||||
var shouldVerify = ShouldRunPostToolVerification(
|
||||
ActiveTab,
|
||||
call.ToolName,
|
||||
result.Success,
|
||||
llm.Code.EnableCodeVerification,
|
||||
llm.EnableCoworkVerification);
|
||||
verificationEnabled,
|
||||
verificationEnabled);
|
||||
if (!shouldVerify)
|
||||
return false;
|
||||
|
||||
|
||||
49
src/AxCopilot/Services/Agent/AgentTabSettingsResolver.cs
Normal file
49
src/AxCopilot/Services/Agent/AgentTabSettingsResolver.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using AxCopilot.Models;
|
||||
|
||||
namespace AxCopilot.Services.Agent;
|
||||
|
||||
internal static class AgentTabSettingsResolver
|
||||
{
|
||||
public static bool IsCodeTab(string? activeTab)
|
||||
=> string.Equals(activeTab, "Code", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
public static bool IsCoworkTab(string? activeTab)
|
||||
=> string.Equals(activeTab, "Cowork", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
public static bool IsPostToolVerificationEnabled(string? activeTab, LlmSettings llm)
|
||||
{
|
||||
if (IsCodeTab(activeTab))
|
||||
return llm.Code.EnableCodeVerification;
|
||||
if (IsCoworkTab(activeTab))
|
||||
return llm.EnableCoworkVerification;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static IEnumerable<string> EnumerateCodeTabDisabledTools(CodeSettings code)
|
||||
{
|
||||
if (!code.EnablePlanModeTools)
|
||||
{
|
||||
yield return "enter_plan_mode";
|
||||
yield return "exit_plan_mode";
|
||||
}
|
||||
|
||||
if (!code.EnableWorktreeTools)
|
||||
{
|
||||
yield return "enter_worktree";
|
||||
yield return "exit_worktree";
|
||||
}
|
||||
|
||||
if (!code.EnableTeamTools)
|
||||
{
|
||||
yield return "team_create";
|
||||
yield return "team_delete";
|
||||
}
|
||||
|
||||
if (!code.EnableCronTools)
|
||||
{
|
||||
yield return "cron_create";
|
||||
yield return "cron_delete";
|
||||
yield return "cron_list";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user