Hi,
The function `org-babel-comint-with-output' (o-b-c-w-o) may not detect prompts correctly. The function o-b-c-w-o checks if the incoming arbitrary chunk of text contains whole prompts, and replace them. But the incoming text may contain an incomplete prompt at the end. When this happens, it will miss that real prompt. For example, using a haskell prompt, let say the prompt is "Prelude> ", the first incoming text is "Pre", the second incoming text is "lude> ", o-b-c-w-o will wrongly infer that "lude> " is the prompt, and that "Pre" was part of the previous value/output. This is with current main (after commit 1ef420b19d2e310d9ef67e090ef84cdb6da4744d). I'm randomly hit by this bug, when working on tests for ob-haskell. Let me know if I need to provide more information, Thanks, Bruno