Skip to content

Commit 3b3fc8c

Browse files
committed
fix(server): trim selections in recovered question messages
Normalize each multi-select value when formatting the answer message, while preserving the original submitted values in the stored request and answer. Implemented and verified with GPT-6-Astra through the Codex harness.
1 parent 34ac145 commit 3b3fc8c

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎apps/server/src/orchestration-v2/Orchestrator.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7409,7 +7409,7 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
74097409
: question.multiSelect &&
74107410
Array.isArray(answer) &&
74117411
answer.every((value) => typeof value === "string" && value.trim().length > 0)
7412-
? answer.join(", ")
7412+
? answer.map((value) => value.trim()).join(", ")
74137413
: "";
74147414
if (text.length === 0) {
74157415
if (question.required === false) continue;

‎apps/server/src/orchestration-v2/runtimeLayer.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,8 +1124,8 @@ it.layer(layerTest)("OrchestrationV2LayerLive", (it) => {
11241124
question: "Which extras?",
11251125
multiSelect: true,
11261126
options: [
1127-
{ label: "Logging", description: "Record events" },
1128-
{ label: "Metrics", description: "Measure activity" },
1127+
{ label: "Logging", value: " Logging ", description: "Record events" },
1128+
{ label: "Metrics", value: " Metrics ", description: "Measure activity" },
11291129
],
11301130
},
11311131
],
@@ -1190,7 +1190,7 @@ it.layer(layerTest)("OrchestrationV2LayerLive", (it) => {
11901190
commandId: CommandId.make(`runtime-async-question-answer-${scenario}`),
11911191
threadId,
11921192
requestId,
1193-
answers: { color: " Blue ", extras: ["Logging", "Metrics"] },
1193+
answers: { color: " Blue ", extras: [" Logging ", " Metrics "] },
11941194
};
11951195
const accepted = yield* orchestrator.dispatch(command);
11961196
const repeated = yield* orchestrator.dispatch(command);

0 commit comments

Comments
 (0)