mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-04 14:57:42 +00:00
breakCycles allocated a Set per message and re-walked the whole ancestor chain, measuring 1.06s for a single 5,000-message conversation and 5.1s at 10,000 - sizes a long real thread reaches. Colouring each node once makes it linear, and it now roots the message that actually closes the loop instead of whichever one the outer iteration started from, so a descendant of a cycle keeps its parent. enforceOrdering walked its queue with shift(), which re-indexes the whole remaining array each step and turns a single BFS quadratic on a wide tree. Conversion is synchronous, so that stalls unrelated requests. |
||
|---|---|---|
| .. | ||
| api | ||
| client | ||
| data-provider | ||
| data-schemas | ||