런처 워크스페이스 복원 매칭과 ~restore 명령을 보강

변경 목적:
- 런처 ~ 예약어의 창 복원 품질을 점검하고, 같은 exe의 첫 창만 반복 재사용되어 브라우저/다중 창 배치가 꼬이던 문제를 줄입니다.
- 도움말에만 있던 ~restore, ~list 명령을 실제 핸들러 동작과 맞춥니다.

핵심 수정사항:
- ContextManager가 열린 창 후보를 exe + 제목 유사도 기준으로 매칭하고, 이미 다른 스냅샷에 배정된 핸들은 재사용하지 않도록 변경했습니다.
- WorkspaceHandler에 ~restore <이름>, ~list 지원과 최근 저장 순 프로필 목록 복원 액션 정리를 추가했습니다.
- WorkspaceHandlerTests, ContextManagerTests를 추가해 명령 파싱과 창 매칭 우선순위를 회귀 검증합니다.
- README.md, docs/DEVELOPMENT.md에 검토 결과와 검증 이력을 기록했습니다.

검증 결과:
- dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify_workspace_restore_review\\ -p:IntermediateOutputPath=obj\\verify_workspace_restore_review\\
- dotnet test src/AxCopilot.Tests/AxCopilot.Tests.csproj -c Release -v minimal --filter WorkspaceHandlerTests^|ContextManagerTests -p:OutputPath=bin\\verify_workspace_restore_review_tests\\ -p:IntermediateOutputPath=obj\\verify_workspace_restore_review_tests\\
- 경고 0 / 오류 0, 테스트 6건 통과
This commit is contained in:
2026-04-15 16:54:06 +09:00
parent 78b3aa2801
commit 964e40718f
6 changed files with 347 additions and 29 deletions

View File

@@ -7,6 +7,14 @@ Windows 전용 시맨틱 런처 & 워크스페이스 매니저
개발 참고: Claw Code 동등성 작업 추적 문서
`docs/claw-code-parity-plan.md`
- 업데이트: 2026-04-15 16:49 (KST)
- 런처 `~` 워크스페이스 복원 경로를 검토하고, 여러 브라우저/앱 창이 있을 때 같은 `exe`의 첫 창 하나만 반복 재사용하던 매칭 문제를 수정했습니다. 기존 [ContextManager.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/Core/ContextManager.cs)는 저장된 스냅샷마다 `exe`만 보고 첫 HWND를 잡아 여러 Chrome/Edge 창 배치가 쉽게 꼬일 수 있었습니다.
- 이제 [ContextManager.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/Core/ContextManager.cs)는 열린 창 후보를 수집한 뒤 `exe + 제목 유사도 + 이미 배정된 창 제외` 기준으로 복원 대상을 고릅니다. 이미 다른 스냅샷에 배정된 핸들은 다시 쓰지 않아, 같은 프로세스의 다중 창이 한 창으로 덮여 이동되던 문제를 줄였습니다.
- [WorkspaceHandler.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/Handlers/WorkspaceHandler.cs)는 도움말과 실제 동작이 어긋나던 `~restore <이름>`, `~list`를 실제로 지원하도록 정리했고, 프로필 목록도 최근 저장 순으로 복원 액션을 직접 반환하도록 맞췄습니다.
- 테스트: [WorkspaceHandlerTests.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot.Tests/Handlers/WorkspaceHandlerTests.cs), [ContextManagerTests.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot.Tests/Core/ContextManagerTests.cs) 추가
- 검증: `dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify_workspace_restore_review\\ -p:IntermediateOutputPath=obj\\verify_workspace_restore_review\\` 경고 0 / 오류 0
- 검증: `dotnet test src/AxCopilot.Tests/AxCopilot.Tests.csproj -c Release -v minimal --filter "WorkspaceHandlerTests|ContextManagerTests" -p:OutputPath=bin\\verify_workspace_restore_review_tests\\ -p:IntermediateOutputPath=obj\\verify_workspace_restore_review_tests\\` 통과 6
- 업데이트: 2026-04-15 16:12 (KST)
- Code/Cowork 권한 팝업과 승인 재사용이 상대 경로에서 잘못 동작하던 문제를 수정했습니다. 상대 경로 `index.html` 같은 대상이 워크스페이스가 아닌 프로세스 현재 폴더(`dist`) 기준으로 해석되면서, 권한 팝업 미리보기와 사내 모드 외부 경로 판정이 잘못되고 `이번 실행 동안 허용`도 재사용되지 않던 상태였습니다.
- [IAgentTool.cs](/E:/AX%20Copilot%20-%20Codex/src/AxCopilot/Services/Agent/IAgentTool.cs)는 새 workspace-aware 경로 해석을 사용해 `IsPathAllowed(...)`, `IsOutsideWorkspace(...)`가 상대 경로를 항상 현재 워크스페이스 기준으로 판정하도록 바꿨습니다. 그 결과 사내 모드에서도 워크스페이스 하위 상대 경로는 외부 접근으로 오판하지 않습니다.