From e7f2e179541b773d76d66420f81b0bb280054529 Mon Sep 17 00:00:00 2001 From: Maurice Date: Wed, 14 Oct 2026 13:21:02 +0200 Subject: [PATCH] fix(ai-import): give the keeper search a starting flight --- server/src/nest/llm-parse/booking-total.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/nest/llm-parse/booking-total.ts b/server/src/nest/llm-parse/booking-total.ts index 116a3174a..68560b204 100644 --- a/server/src/nest/llm-parse/booking-total.ts +++ b/server/src/nest/llm-parse/booking-total.ts @@ -71,7 +71,7 @@ export function collapseRepeatedBookingTotal(nodes: Node[], documentText: string if (!printed.onTotal || printed.lines >= priced.length) return nodes; // The first to depart keeps it; a tie keeps the order the model gave. - const keeper = priced.reduce((first, node) => (departure(node) < departure(first) ? node : first)); + const keeper = priced.reduce((first, node) => (departure(node) < departure(first) ? node : first), priced[0]); return nodes.map((node) => { if (node === keeper || priceOf(node) == null) return node; const { price: _price, priceCurrency: _currency, ...rest } = node;