Try to preserve literal "\n" in LLM output.
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Mon, 29 Dec 2025 23:30:51 +0000 (01:30 +0200)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Mon, 29 Dec 2025 23:30:51 +0000 (01:30 +0200)
src/main/java/eu/svjatoslav/alyverkko_cli/commands/task_processor/TaskProcessorCommand.java

index 596cb98..9fc7235 100644 (file)
@@ -220,6 +220,8 @@ public class TaskProcessorCommand implements Command {
         resultFileContent.append(task.userPrompt).append("\n");
 
         // Append the AI response block
+        aiResponse = aiResponse.replace("\r\n", "\\n").replace("\r", "\\n").replace("\n", "\\n");
+
         resultFileContent
                 .append("* ASSISTANT:\n")
                 .append(aiResponse)