fix the output not being visible issue (#3491)

This commit is contained in:
Max Novich
2025-07-17 15:26:53 -07:00
committed by GitHub
parent e0b3b0fc70
commit 079a64c1f7
3 changed files with 5 additions and 45 deletions
@@ -44,29 +44,8 @@ const isUserMessage = (message: Message): boolean => {
return true;
};
// Filter messages for display (same logic as useChatEngine)
const filterMessagesForDisplay = (messages: Message[]): Message[] => {
return messages.filter((message) => {
// Only filter out when display is explicitly false
if (message.display === false) return false;
// Keep all assistant messages and user messages that aren't just tool responses
if (message.role === 'assistant') return true;
// For user messages, check if they're only tool responses
if (message.role === 'user') {
const hasOnlyToolResponses = message.content.every((c) => c.type === 'toolResponse');
const hasTextContent = message.content.some((c) => c.type === 'text');
const hasToolConfirmation = message.content.every(
(c) => c.type === 'toolConfirmationRequest'
);
// Keep the message if it has text content or tool confirmation or is not just tool responses
return hasTextContent || !hasOnlyToolResponses || hasToolConfirmation;
}
return true;
});
return messages.filter((message) => message.display);
};
interface SessionHistoryViewProps {