diff --git a/apps/backend/internal/agent/lifecycle/manager.go b/apps/backend/internal/agent/lifecycle/manager.go index 400e0f4c6b..00c125cd96 100644 --- a/apps/backend/internal/agent/lifecycle/manager.go +++ b/apps/backend/internal/agent/lifecycle/manager.go @@ -1578,16 +1578,22 @@ func (m *Manager) flushMessageBuffer(execution *AgentExecution) string { } } - // If we have remaining content and an active streaming message, append it + // If we have remaining message content, publish it trimmedMessage := strings.TrimSpace(agentMessage) - if trimmedMessage != "" && currentMsgID != "" { - // Publish final append to the streaming message - m.publishStreamingMessageFinal(execution, currentMsgID, trimmedMessage) + if trimmedMessage != "" { + if currentMsgID != "" { + // Publish final append to the streaming message + m.publishStreamingMessageFinal(execution, currentMsgID, trimmedMessage) + } else { + // No streaming message exists yet - create one with all the content + // This happens when message content has no newlines (never triggered streaming) + m.publishStreamingMessage(execution, trimmedMessage) + } // Return empty since we've already handled it via streaming return "" } - return trimmedMessage + return "" } // publishStreamingMessageFinal publishes the final chunk of a streaming message. diff --git a/apps/web/components/diff/diff-viewer.tsx b/apps/web/components/diff/diff-viewer.tsx index c8bbfb9fef..fcc72d19cc 100644 --- a/apps/web/components/diff/diff-viewer.tsx +++ b/apps/web/components/diff/diff-viewer.tsx @@ -452,7 +452,9 @@ export const DiffViewer = memo(function DiffViewer({ lineDiffType: 'word', overflow: wordWrap ? 'wrap' : 'scroll', unsafeCSS: ` - * { + /* Make container backgrounds transparent, but NOT diff line backgrounds + * Only target the root container and specific UI elements, not the diff content itself */ + [data-diffs-root] { background: transparent !important; }