Iteration 1: Move chunks handling back to the UI component

Previously, we used to have it this way - all the chunks were assembled on the component level. At some point, we moved this logic outside of the component to make the component itself simpler and to delegate the responsibility of assembling the chunks to the component's consumers.

However, this approach revealed several issues:

  • we mutate the message object too far from the rendering which makes it a bit hard to maintain
  • Duo Chat is presented in several environments (Web UI, VSCode, JetBrains, etc.). Moreover, even within the same env (like Web UI), we can have different users of this component (like Duo Chat and AI Agents, for example). The current approach means we need to duplicate/replicate the chunks handling in all of those environments. Which unnecessarily creates a maintenance burden

This Issue suggests to move the chunks handling back to the component to unify this aspect of Duo Chat across all possible environments.