From 88d7e59a07ce2f4b5e3e93f42308cf7980b99727 Mon Sep 17 00:00:00 2001 From: Guillermo Casanova Date: Tue, 8 Sep 2026 11:40:32 -0300 Subject: [PATCH] fix(server): attribute async question replies --- .../src/orchestration/Layers/OrchestrationEngine.test.ts | 2 +- apps/server/src/orchestration/decider.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/server/src/orchestration/Layers/OrchestrationEngine.test.ts b/apps/server/src/orchestration/Layers/OrchestrationEngine.test.ts index 2cb4ed7566ad..3d99d2247d17 100644 --- a/apps/server/src/orchestration/Layers/OrchestrationEngine.test.ts +++ b/apps/server/src/orchestration/Layers/OrchestrationEngine.test.ts @@ -269,7 +269,7 @@ describe("OrchestrationEngine", () => { expect(userMessages).toHaveLength(1); expect(userMessages?.[0]?.attachments).toEqual(response.attachmentsByQuestionId["1"]); expect(userMessages?.[0]?.text).toBe( - "Which package manager?\npnpm\n\nWhat should it be named?\nExample\nAttached file: spec.txt (thread-1-00000000-0000-4000-8000-0000000000aa-txt)", + "Agent question: Which package manager?\nUser answer: pnpm\n\nAgent question: What should it be named?\nUser answer: Example\nAttached file: spec.txt (thread-1-00000000-0000-4000-8000-0000000000aa-txt)", ); expect( after.threads[0]?.activities.find((activity) => activity.kind === "user-input.resolved") diff --git a/apps/server/src/orchestration/decider.ts b/apps/server/src/orchestration/decider.ts index 304defb80c89..dad67b01feef 100644 --- a/apps/server/src/orchestration/decider.ts +++ b/apps/server/src/orchestration/decider.ts @@ -1280,7 +1280,12 @@ export const decideOrchestrationCommand = Effect.fn("decideOrchestrationCommand" .map((attachment) => `Attached file: ${attachment.name} (${attachment.id})`) .join("\n"); replies.push( - [`${question.question}\n${answer.trim()}`, attachmentLabels].filter(Boolean).join("\n"), + [ + `Agent question: ${question.question}\nUser answer: ${answer.trim()}`, + attachmentLabels, + ] + .filter(Boolean) + .join("\n"), ); } // Commit the answer and its message together. The normal turn path