Trelix v3.2.1: How a Mocked Test Suite Hid a Critical Embedding Bug for 28 Releases

Open-source project Trelix shipped a silent but severe bug across 28 tagged releases, from v2.0.0 through v3.1.6, in which its BGE code embedder used the wrong pooling method due to a mismatch between FlagEmbedding's default CLS pooling and the causal decoder architecture of BAAI/bge-code-v1. Because the model is a Qwen2 decoder rather than an encoder, CLS pooling at position 0 depended on no subsequent tokens, causing every query embedding to be bitwise identical to every other. The defect went undetected because the unit test suite replaced FlagModel with a MagicMock, which never invoked real pooling logic and therefore never exposed the failure. Version v3.1.6 inadvertently made the broken path reachable by fixing an unrelated AttributeError, and v3.1.7 publicly retracted the earlier claim that bge-code was working. The current release, v3.2.1, tagged on 2026-08-26 and available on PyPI, spans 190 commits and 324 changed files since v3.1.1, with the project now running a 4,376-test suite as part of an ongoing self-audit effort.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in