권한 모드 동등화: Plan 추가 및 claw-code 권한 별칭 정규화 반영
Some checks failed
Release Gate / gate (push) Has been cancelled
Some checks failed
Release Gate / gate (push) Has been cancelled
- 전역 권한 모드를 Ask/Plan/Auto/Deny 4단계로 확장 - claw-code 계열 권한 값(default/acceptEdits/dontAsk/bypassPermissions) 입력 시 내부 모드로 정규화 - AgentContext 권한 판정 경로(전역/도구 오버라이드/패턴 오버라이드) 정규화 적용 - Chat/Settings UI에서 Plan 모드 노출 및 인라인 순환(Ask->Plan->Auto->Deny) 반영 - AppState/SettingsViewModel/SettingsService에 권한값 정규화 및 저장 시 일관성 적용 - Permission lifecycle 이벤트 메시지에 유효 모드 표기 보강 - 빌드/테스트 검증: dotnet build 경고0 오류0, dotnet test 372/372 통과
This commit is contained in:
@@ -194,7 +194,7 @@ public sealed class AppStateService
|
||||
Skills.Enabled = llm.EnableSkillSystem;
|
||||
Skills.FolderPath = llm.SkillsFolderPath ?? "";
|
||||
|
||||
Permissions.FilePermission = llm.FilePermission ?? "Ask";
|
||||
Permissions.FilePermission = PermissionModeCatalog.NormalizeGlobalMode(llm.FilePermission);
|
||||
Permissions.AgentDecisionLevel = llm.AgentDecisionLevel ?? "detailed";
|
||||
Permissions.PlanMode = llm.PlanMode ?? "off";
|
||||
Permissions.ToolOverrideCount = llm.ToolPermissions?.Count ?? 0;
|
||||
@@ -501,27 +501,31 @@ public sealed class AppStateService
|
||||
|
||||
public PermissionSummaryState GetPermissionSummary(ChatConversation? conversation = null)
|
||||
{
|
||||
var effective = conversation?.Permission;
|
||||
if (string.IsNullOrWhiteSpace(effective))
|
||||
effective = Permissions.FilePermission;
|
||||
var effective = PermissionModeCatalog.NormalizeGlobalMode(conversation?.Permission);
|
||||
var defaultMode = PermissionModeCatalog.NormalizeGlobalMode(Permissions.FilePermission);
|
||||
if (string.IsNullOrWhiteSpace(conversation?.Permission))
|
||||
effective = defaultMode;
|
||||
|
||||
var risk = string.Equals(effective, "Auto", StringComparison.OrdinalIgnoreCase)
|
||||
var risk = string.Equals(effective, PermissionModeCatalog.Auto, StringComparison.OrdinalIgnoreCase)
|
||||
? "high"
|
||||
: string.Equals(effective, "Deny", StringComparison.OrdinalIgnoreCase)
|
||||
: string.Equals(effective, PermissionModeCatalog.Deny, StringComparison.OrdinalIgnoreCase)
|
||||
? "locked"
|
||||
: string.Equals(effective, PermissionModeCatalog.Plan, StringComparison.OrdinalIgnoreCase)
|
||||
? "guarded"
|
||||
: "normal";
|
||||
|
||||
var description = effective switch
|
||||
{
|
||||
"Auto" => "파일 작업을 자동 허용합니다.",
|
||||
"Deny" => "파일 작업을 차단합니다.",
|
||||
"Plan" => "계획/승인 흐름을 우선 적용한 뒤 파일 작업을 진행합니다.",
|
||||
_ => "파일 작업 전마다 사용자 확인을 요청합니다.",
|
||||
};
|
||||
|
||||
return new PermissionSummaryState
|
||||
{
|
||||
EffectiveMode = effective ?? "Ask",
|
||||
DefaultMode = Permissions.FilePermission,
|
||||
EffectiveMode = effective,
|
||||
DefaultMode = defaultMode,
|
||||
OverrideCount = Permissions.ToolOverrideCount,
|
||||
RiskLevel = risk,
|
||||
Description = description,
|
||||
|
||||
Reference in New Issue
Block a user