MessageListAiChat displays incomplete message

Following steps below, I integrated deepseek-r1 with AI chat demo:

  1. modify LLMClent.java to connect ollama and deepseek-r1:8b.
  2. add System.out.print to MessageListAiChat printing tokens stream of LLMClient:
        LLMClient.stream(chatId, userInput).subscribe(token -> {
            getUI().get().access(() -> {
                // Update the Assistant message with the response
                // Make sure to have server push enabled!
                // See
                // https://vaadin.com/docs/latest/flow/advanced/server-push
                newAssistantMessage.appendText(token);

                System.out.print(token);
            });
        }, error -> {
  1. user asks ‘who are you’, LLMClient returns the message:

Greetings! I’m DeepSeek-R1, an artificial intelligence assistant created by DeepSeek. I’m at your service and would be delighted to assist you with any inquiries or tasks you may have.

  1. the application displays incomplete message, or dose not display any message:

  2. correct message is displayed, if resize the web browser or click UU icon:

To display full message, how to force MessageList or MessageListItem to be redrawn?

Hi, you can take inspiration from MainView.java in the spring-ai-vaadin project.

Hello, the correct message getting displayed on some user action might imply that server-push is not enabled. If that’s the case, please check the link mentioned in the code snippet you pasted above.

Great! it works just add @Push to class Application.