- Cowork/Code 에이전트 루프 완료 후 최종 답변이 한 번에 붙지 않도록 라이브 타이핑 프리뷰를 추가함\n- 처리 중에는 기존 진행 로그를 유지하고, 최종 응답 구간만 스트리밍 컨테이너를 거쳐 자연스럽게 이어지도록 정리함\n- README와 DEVELOPMENT 문서에 2026-04-07 02:31 (KST) 기준 변경 이력 반영\n- 검증: 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:
@@ -5653,7 +5653,13 @@ public partial class ChatWindow : Window
|
||||
draftSucceeded = true;
|
||||
|
||||
if (streamingContainer != null && streamingText != null)
|
||||
{
|
||||
FinalizeStreamingContainer(streamingContainer, streamingText, assistantContent);
|
||||
}
|
||||
else if (preparedExecution.Mode.UseAgentLoop && !string.IsNullOrWhiteSpace(assistantContent))
|
||||
{
|
||||
await ShowTypedAssistantPreviewAsync(assistantContent, _streamCts.Token);
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
@@ -5699,6 +5705,33 @@ public partial class ChatWindow : Window
|
||||
return new PreparedTurnOutcome(conversation, assistantContent, draftSucceeded, draftCancelled, draftFailure);
|
||||
}
|
||||
|
||||
private async Task ShowTypedAssistantPreviewAsync(string finalContent, CancellationToken ct)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(finalContent) || MessagePanel == null)
|
||||
return;
|
||||
|
||||
var container = CreateStreamingContainer(out var streamText);
|
||||
_activeStreamText = streamText;
|
||||
_cachedStreamContent = finalContent;
|
||||
_displayedLength = 0;
|
||||
_cursorVisible = true;
|
||||
MessagePanel.Children.Add(container);
|
||||
ForceScrollToEnd();
|
||||
_cursorTimer.Start();
|
||||
_typingTimer.Start();
|
||||
streamText.Text = _cursorVisible ? "\u258c" : " ";
|
||||
|
||||
var deadline = DateTime.UtcNow.AddMilliseconds(Math.Clamp(finalContent.Length * 6, 500, 1800));
|
||||
while (_displayedLength < _cachedStreamContent.Length && DateTime.UtcNow < deadline && !ct.IsCancellationRequested)
|
||||
await Task.Delay(30, ct);
|
||||
|
||||
_displayedLength = _cachedStreamContent.Length;
|
||||
if (_activeStreamText != null)
|
||||
_activeStreamText.Text = _cachedStreamContent;
|
||||
|
||||
FinalizeStreamingContainer(container, streamText, finalContent);
|
||||
}
|
||||
|
||||
private void ScheduleExecutionHistoryRender(bool autoScroll = true)
|
||||
{
|
||||
_pendingExecutionHistoryAutoScroll |= autoScroll;
|
||||
|
||||
Reference in New Issue
Block a user