같은 탭 대화 전환 중에도 AX Agent 실행이 계속되도록 수정

- 실행 시작 대화를 탭별로 추적해 같은 탭에서 다른 대화로 이동하거나 새 대화를 시작해도 원래 대화에 이벤트와 완료 결과를 저장하도록 정리함
- 탭 복귀 시 진행 중인 대화를 다시 로드하고 백그라운드 실행 저장이 현재 선택 대화 ID를 덮어쓰지 않도록 세션/저장 경로를 보강함
- ChatSessionStateService와 AxAgentExecutionEngine 회귀 테스트를 추가하고 README.md, docs/DEVELOPMENT.md 이력을 갱신함
- 검증: dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\verify_conversation_background_resume\ -p:IntermediateOutputPath=obj\verify_conversation_background_resume\ (경고 0, 오류 0)
- 검증: dotnet test src/AxCopilot.Tests/AxCopilot.Tests.csproj -c Release -v minimal --filter ChatSessionStateServiceTests|AxAgentExecutionEngineTests -p:OutputPath=bin\verify_conversation_background_resume_tests\ -p:IntermediateOutputPath=obj\verify_conversation_background_resume_tests\ (통과 39)
This commit is contained in:
2026-04-15 19:24:40 +09:00
parent 913b42b2f3
commit f173e2a63b
9 changed files with 353 additions and 60 deletions

View File

@@ -129,6 +129,48 @@ public class ChatSessionStateServiceTests
session.CurrentConversation.AgentRunHistory[0].LastIteration.Should().Be(2);
}
[Fact]
public void AppendExecutionEvent_WithExplicitConversation_DoesNotReplaceVisibleConversation_WhenRememberDisabled()
{
var session = new ChatSessionStateService();
var visibleConversation = new ChatConversation
{
Id = $"visible-{Guid.NewGuid():N}",
Tab = "Code",
Title = "visible",
Messages = [new ChatMessage { Role = "user", Content = "keep me selected" }]
};
var runningConversation = new ChatConversation
{
Id = $"running-{Guid.NewGuid():N}",
Tab = "Code",
Title = "running",
Messages = [new ChatMessage { Role = "user", Content = "background run" }]
};
session.SetCurrentConversation("Code", visibleConversation);
session.RememberConversation("Code", visibleConversation.Id);
session.AppendExecutionEvent(
"Code",
runningConversation,
new AgentEvent
{
RunId = "run-background",
Type = AgentEventType.ToolResult,
ToolName = "file_read",
Summary = "background step",
Timestamp = DateTime.Now,
Success = true,
},
rememberConversation: false);
session.CurrentConversation.Should().BeSameAs(visibleConversation);
session.GetConversationId("Code").Should().Be(visibleConversation.Id);
runningConversation.ExecutionEvents.Should().ContainSingle();
runningConversation.ExecutionEvents[0].RunId.Should().Be("run-background");
}
[Fact]
public void EnqueueDraft_AndToggleExecutionHistory_UpdateConversationState()
{