코드탭 query/history 조립 구조를 단계형 서비스로 분리

- AgentLoopQueryAssemblyService를 추가해 session learning refresh, queued command/query window 준비, code working set supplemental context 부착을 단계형으로 정리함

- AgentLoopService는 orchestration 중심으로 단순화하고 claw-code의 staged query/history 흐름과 비슷하게 책임을 재배치함

- AgentLoopQueryAssemblyServiceTests를 추가하고 SessionLearningCollectorTests를 영어 기준으로 정리했으며 dotnet build 및 targeted dotnet test(56 통과, 경고/오류 0)로 검증함
This commit is contained in:
2026-04-16 02:07:26 +09:00
parent f0f1f76f48
commit 2e1c7be8c3
7 changed files with 255 additions and 58 deletions

View File

@@ -288,3 +288,18 @@ Updated: 2026-04-16 01:57 (KST)
- Remaining follow-up:
- measure whether `tool_trace_repair` counts keep trending down in long Code runs after this preflight normalization
- continue replacing older mojibake strings outside the active Code execution path
Updated: 2026-04-16 02:05 (KST)
- Delivered in this pass:
- structural alignment step:
- `AgentLoopQueryAssemblyService.cs` now owns the staged query/history assembly path.
- `PrepareHistory(...)` handles session-learning refresh plus queued-command/query-window preparation.
- `PrepareRequest(...)` handles Code working-set supplemental context and request-message assembly before dispatch.
- `AgentLoopService.cs` now delegates those responsibilities instead of manually stitching them together inline.
- test and encoding hygiene step:
- `AgentLoopQueryAssemblyServiceTests.cs` locks the new staged assembly behavior.
- `SessionLearningCollectorTests.cs` was rewritten to English-only comments and assertions to match the new repository rule.
- Remaining follow-up:
- keep extracting more inline AgentLoop responsibilities into smaller staged services where it improves observability or retry correctness
- continue measuring long Code runs against claw-code-style continuity scenarios

View File

@@ -1830,3 +1830,23 @@ UI ?遺우쁽????域뱀뮆???귐뗫솯?醫딆춦 ???袁る퓮 ?臾믩씜 ??疫
- 검증:
- `dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify_tool_trace_hardening\\ -p:IntermediateOutputPath=obj\\verify_tool_trace_hardening\\` 경고 0 / 오류 0
- `dotnet test src/AxCopilot.Tests/AxCopilot.Tests.csproj -c Release -v minimal --filter "AgentMessageInvariantHelperTests|AgentLoopLlmRequestPreparationServiceTests|AgentQueryContextBuilderTests|CodeTaskWorkingSetServiceTests|AgentLoopE2ETests" -p:OutputPath=bin\\verify_tool_trace_hardening_tests\\ -p:IntermediateOutputPath=obj\\verify_tool_trace_hardening_tests\\` 통과 34
업데이트: 2026-04-16 02:05 (KST)
- Code 탭 컨텍스트 조립 구조를 `claw-code`의 staged query/history 흐름에 더 가깝게 정리했습니다.
- `src/AxCopilot/Services/Agent/AgentLoopQueryAssemblyService.cs`
- 새 서비스 파일을 추가했습니다.
- 반복당 query/history 조립을 `PrepareHistory(...)``PrepareRequest(...)` 두 단계로 분리했습니다.
- 비-Code 탭에서는 session learnings block refresh를 담당하고, Code 탭에서는 working-set supplemental context를 request assembly 단계에 붙입니다.
- `src/AxCopilot/Services/Agent/AgentLoopService.cs`
- 직접 가지고 있던 session learning refresh / iteration preparation / request supplemental assembly 책임 일부를 `AgentLoopQueryAssemblyService`로 위임했습니다.
- 이제 AgentLoop는 orchestration, hook, tool execution, retry 흐름 중심으로 더 좁아졌습니다.
- `src/AxCopilot.Tests/Services/AgentLoopQueryAssemblyServiceTests.cs`
- non-Code session learning injection
- Code 탭에서 session learning skip
- Code working set supplemental message injection
를 각각 회귀 테스트로 고정했습니다.
- `src/AxCopilot.Tests/Services/SessionLearningCollectorTests.cs`
- 영어 주석/문구 기준으로 다시 정리해 새 인코딩 규칙에 맞췄습니다.
- 검증:
- `dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify_query_assembly_structure\\ -p:IntermediateOutputPath=obj\\verify_query_assembly_structure\\` 경고 0 / 오류 0
- `dotnet test src/AxCopilot.Tests/AxCopilot.Tests.csproj -c Release -v minimal --filter "AgentLoopQueryAssemblyServiceTests|AgentLoopIterationPreparationServiceTests|AgentLoopLlmRequestPreparationServiceTests|AgentMessageInvariantHelperTests|SessionLearningCollectorTests|CodeTaskWorkingSetServiceTests|AgentLoopE2ETests" -p:OutputPath=bin\\verify_query_assembly_structure_tests\\ -p:IntermediateOutputPath=obj\\verify_query_assembly_structure_tests\\` 통과 56