AX Agent: 실행 이벤트 세션 변이 경로 엔진으로 통합
- ChatWindow에 중복돼 있던 실행 이벤트/Agent run 교차 탭 복원 로직을 AxAgentExecutionEngine helper로 이동함 - AppendExecutionEvent, AppendAgentRun이 공통 session mutation 경로를 사용하도록 정리해 이후 runtime state 공통화 기반을 마련함 - README와 DEVELOPMENT 문서에 2026-04-05 15:42 (KST) 기준 변경 이력 반영 - 검증: dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify\\ -p:IntermediateOutputPath=obj\\verify\\ 경고 0 / 오류 0
This commit is contained in:
@@ -9166,48 +9166,17 @@ public partial class ChatWindow : Window
|
||||
if (session == null)
|
||||
return;
|
||||
|
||||
var normalizedTarget = NormalizeTabName(targetTab);
|
||||
var normalizedActive = NormalizeTabName(_activeTab);
|
||||
ChatConversation updatedConversation;
|
||||
if (string.Equals(normalizedTarget, normalizedActive, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
_currentConversation = updatedConversation = session.AppendAgentRun(normalizedTarget, evt, status, summary, null);
|
||||
ScheduleConversationPersist(updatedConversation);
|
||||
return;
|
||||
}
|
||||
|
||||
var activeSnapshot = _currentConversation;
|
||||
var previousSessionConversation = session.CurrentConversation;
|
||||
updatedConversation = session.AppendAgentRun(normalizedTarget, evt, status, summary, null);
|
||||
ScheduleConversationPersist(updatedConversation);
|
||||
|
||||
if (activeSnapshot != null && string.Equals(NormalizeTabName(activeSnapshot.Tab), normalizedActive, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
session.CurrentConversation = activeSnapshot;
|
||||
_currentConversation = activeSnapshot;
|
||||
}
|
||||
else if (previousSessionConversation != null
|
||||
&& string.Equals(NormalizeTabName(previousSessionConversation.Tab), normalizedActive, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
session.CurrentConversation = previousSessionConversation;
|
||||
_currentConversation = previousSessionConversation;
|
||||
}
|
||||
else
|
||||
{
|
||||
var activeId = session.GetConversationId(normalizedActive);
|
||||
var activeConv = string.IsNullOrWhiteSpace(activeId) ? null : _storage.Load(activeId);
|
||||
if (activeConv != null)
|
||||
{
|
||||
session.CurrentConversation = activeConv;
|
||||
_currentConversation = activeConv;
|
||||
}
|
||||
else
|
||||
{
|
||||
var fallback = session.LoadOrCreateConversation(normalizedActive, _storage, _settings);
|
||||
session.CurrentConversation = fallback;
|
||||
_currentConversation = fallback;
|
||||
}
|
||||
}
|
||||
var result = _chatEngine.AppendAgentRun(
|
||||
session,
|
||||
_storage,
|
||||
_currentConversation,
|
||||
_activeTab,
|
||||
targetTab,
|
||||
evt,
|
||||
status,
|
||||
summary);
|
||||
_currentConversation = result.CurrentConversation;
|
||||
ScheduleConversationPersist(result.UpdatedConversation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9219,48 +9188,15 @@ public partial class ChatWindow : Window
|
||||
if (session == null)
|
||||
return;
|
||||
|
||||
var normalizedTarget = NormalizeTabName(targetTab);
|
||||
var normalizedActive = NormalizeTabName(_activeTab);
|
||||
ChatConversation updatedConversation;
|
||||
if (string.Equals(normalizedTarget, normalizedActive, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
_currentConversation = updatedConversation = session.AppendExecutionEvent(normalizedTarget, evt, null);
|
||||
ScheduleConversationPersist(updatedConversation);
|
||||
return;
|
||||
}
|
||||
|
||||
var activeSnapshot = _currentConversation;
|
||||
var previousSessionConversation = session.CurrentConversation;
|
||||
updatedConversation = session.AppendExecutionEvent(normalizedTarget, evt, null);
|
||||
ScheduleConversationPersist(updatedConversation);
|
||||
|
||||
if (activeSnapshot != null && string.Equals(NormalizeTabName(activeSnapshot.Tab), normalizedActive, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
session.CurrentConversation = activeSnapshot;
|
||||
_currentConversation = activeSnapshot;
|
||||
}
|
||||
else if (previousSessionConversation != null
|
||||
&& string.Equals(NormalizeTabName(previousSessionConversation.Tab), normalizedActive, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
session.CurrentConversation = previousSessionConversation;
|
||||
_currentConversation = previousSessionConversation;
|
||||
}
|
||||
else
|
||||
{
|
||||
var activeId = session.GetConversationId(normalizedActive);
|
||||
var activeConv = string.IsNullOrWhiteSpace(activeId) ? null : _storage.Load(activeId);
|
||||
if (activeConv != null)
|
||||
{
|
||||
session.CurrentConversation = activeConv;
|
||||
_currentConversation = activeConv;
|
||||
}
|
||||
else
|
||||
{
|
||||
var fallback = session.LoadOrCreateConversation(normalizedActive, _storage, _settings);
|
||||
session.CurrentConversation = fallback;
|
||||
_currentConversation = fallback;
|
||||
}
|
||||
}
|
||||
var result = _chatEngine.AppendExecutionEvent(
|
||||
session,
|
||||
_storage,
|
||||
_currentConversation,
|
||||
_activeTab,
|
||||
targetTab,
|
||||
evt);
|
||||
_currentConversation = result.CurrentConversation;
|
||||
ScheduleConversationPersist(result.UpdatedConversation);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user