[Phase 17-D] 스킬 시스템 고도화 — paths:glob 자동주입 + context:fork 격리 실행

AgentLoopService.Skills.cs (신규, 95줄):
- InjectPathBasedSkills(): 파일 도구 성공 후 filePath로 GlobMatcher 매칭
  → 매칭 스킬 시스템 프롬프트를 시스템 메시지에 in-place 주입
  → SkillActivated JSONL 이벤트 로그 기록
- RunSkillInForkAsync(): context:fork 스킬 격리 LLM 실행 (도구 없음)
  → SkillCompleted JSONL 이벤트 로그 기록

SkillManagerTool.cs:
- SetForkRunner(Func<SkillDefinition, string, CancellationToken, Task<string>>) 추가
- exec 액션 + arguments 파라미터 추가
- ExecSkillAsync(): PrepareSkillBodyAsync 인자 치환
  → IsForkContext=true: fork runner 호출 → [Fork 스킬 결과] 반환
  → 일반 스킬: 시스템 프롬프트 + 준비된 본문 반환

AgentLoopService.cs:
- 생성자: SkillManagerTool.SetForkRunner(RunSkillInForkAsync) 주입

AgentLoopService.Execution.cs:
- 도구 성공 직후 InjectPathBasedSkills(result.FilePath, messages) 호출

빌드: 경고 0, 오류 0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-04 00:39:25 +09:00
parent 0a58419c8a
commit 1313c65e5e
5 changed files with 225 additions and 9 deletions

View File

@@ -104,6 +104,9 @@ public partial class AgentLoopService
// DelegateAgentTool에 서브에이전트 실행기 주입
_delegateAgentTool = tools.Get("delegate") as DelegateAgentTool;
_delegateAgentTool?.SetSubAgentRunner(RunSubAgentAsync);
// Phase 17-D: SkillManagerTool에 fork 실행기 주입
(tools.Get("skill_manager") as SkillManagerTool)?.SetForkRunner(RunSkillInForkAsync);
}
/// <summary>