Ingest stores the fake LLM's echo as chunk descriptions when `llm.provider` is `fake`, and no op clears them
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with the named paths server/settings/catalog.py, pass_stream.py, server/llm/fake.py, describe, and ingest.py to trace how provider selection reaches chunk storage. Then read the code.index_status, health, and loom code describe entry points named in the issue. Done means fake or unavailable providers cannot store echoed text as LLM descriptions, status reports the condition, and an in-place reset can restore structural context and re-embed affected chunks.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
TL;DR: With the fake LLM provider, ingest stores the fake client's echo text as chunk descriptions and embeds it (39,506 of 1,387,613 chunks on our deployment), and there is no in-place way to clear them. This asks that the writer skip a fake provider, that status warn, and for a reset operation.
Company
Lumnus
Component
Code index
Describe the situation
Two parts, one cause.
Bug. With llm.provider = fake (the setting for a deployment without an LLM, and the test default), ingest still writes LLM context descriptions. LOOM_CODE_CONTEXT_DESCRIPTION_ENABLED defaults to true (server/settings/catalog.py:1596), and pass_stream.py:99 reads only that flag before it calls get_llm_client(), which returns the FakeLLMClient for provider fake. The fake client's default branch answers [fake-synthesis: <model>] <user[:200]> (server/llm/fake.py:267). describe._describe_new_chunks keeps that string as the chunk's description, and ingest.py:621 stores it with context_source='llm'. The description is part of context_text, which is what gets embedded, so the vector is computed from text containing the echo.
llm_is_fake() (server/llm/client.py:116) exists, but only health.py:98-105 and identity/app/namespace_inventory.py:105 read it, both informational. No writer checks it, and nothing in code.index_status or the health output says that the description writer is on while the provider is fake. The same applies when a keyed provider's API key is missing: _build_llm_client falls back to the fake client with a log line, and the writer carries on.
Measured on our deployment (loom.code_chunks FINAL, live rows, tombstoned_at IS NULL): 39,506 of 1,387,613 chunks (2.8%) have context_source='llm', and every one of those descriptions starts with the fake prefix; none has another. They sit in five namespaces: mirrors and forks of vLLM, vllm-xpu-kernels and OpenClaw, and one more repository. Only function and class chunks of commits a pass ingested are described (describe._DESCRIBE_KINDS), so the share is small. Search results show the echo as the unit's description.
Missing recovery. Once the rows exist there is no way back in place. Ingest is content-addressed (server/code/domain/extract/chunker.py:118, chunk_id from path, scope and a content hash; ingest.py:516-517 inserts only ids that are not live), so a re-index or a backfill --paths-file repair keeps the described rows unchanged, since the description is not part of the id. loom code describe only adds descriptions and skips rows that are already llm. loom code answers-purge covers code_answers only. The route that does clear them is code.repo.remove, then erasure.request with scope namespace, then re-adding the repository and a full backfill --phase index and --phase embed, which re-embeds everything.
Does it reproduce on the latest release or main?
Yes
How to reproduce
-
Settings:
llm.provider: fake(orLOOM_LLM_PROVIDER=fake), noLOOM_CODE_CONTEXT_DESCRIPTION_ENABLEDoverride, a small repository added withcode.repo.add. -
Let the worker's ingest pass index a commit of that repository (or run
code.refreshfor the namespace).loom code backfill --phase indexstores stubs throughingest_filewithout a client and describes nothing. -
Count the contaminated rows:
SELECT count() FROM loom.code_chunks FINAL WHERE context_source = 'llm' AND startsWith(context_description, '[fake-synthesis:') AND tombstoned_at IS NULLThe count is non-zero and rises with each commit a pass indexes; it counts the function and class chunks of those commits. The same query without the
startsWithline returns the same number, so nollmrow has a real description.GET /healthreportsfake_llm, andcode.index_statusreports nothing about it. -
A second ingest of the same commit, or
backfill --paths-fileover the same files, changes nothing: the rows are kept.
Expected performance
- A fake or absent provider does not run the description writer. In
pass_stream.py, adescribeflag that is true whilellm_is_fake()is true falls back tollm=None(structural context,context_source='structural') with a clear log line, or refuses the pass with a clear error. Either way the fake echo is never stored asllm. The same check fitsloom code describe, which callsget_llm_client()directly. code.index_statusand health warn when the writer is enabled while the provider is fake (or a keyed provider's key is missing), and report the number ofcontext_source='llm'rows whose description came from the fake client, if that is cheap to know.- An op to reset or re-describe descriptions in place, for example
loom code describe --resetorcode.describe_reset, with a dry run by default and--apply, likeanswers-purge. It returnscontext_source='llm'rows (optionally filtered by--llm-model fake-echo-1, namespace or path) to structural context, rebuildscontext_text, and re-embeds only the affected chunks. Recovery then needs neither erasure nor a full re-index, and the same op serves a provider or model upgrade, the wayanswers-purgeservescode.ask.
Environment
Loom 1.3.0 (Helm chart 0.3.0), ClickHouse 26.10 self-managed, Kubernetes. The code paths cited are as of upstream 8ce2640dd and match 1.3.0.
Related issues and pull requests
Related: https://github.com/ClickHouse/loom/pull/810 documents that the fake LLM returns deterministic text for development and tests. This issue is that text reaching the code index.
How this was found
Found and reproduced on our deployment with AI assistance.
Redaction
- I removed tokens, keys, passwords and personal or customer data from everything above.
- Lingua principale
- Python
- Stelle
- 263
- Fork
- 47
- Merge medio
- 14h 21m
- PR unite (30g)
- 873
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ClickHouse/loom
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 76/100
ClickHouse/loom#2014 ·
I maintainer di solito rispondono entro 1 giorno
-
Options of loom period-digest, reextract, reconcile-status and demote-activity-narration print no help textForse già presa @VanshajPoonia l’ha presa oggi. Apertabug good first issue help wanted up-for-grabs
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
ClickHouse/loom#1988 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
A compiler-tier checkout fetch from a shallow mirror never records its headForse già presa @KaloyanNaumov l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
ClickHouse/loom#2016 ·
I maintainer di solito rispondono entro 1 giorno
-
Delta workers fetch the compiler-tier checkout under a hard-coded 600 s limitForse già presa @KaloyanNaumov l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 35/100
ClickHouse/loom#2012 ·
I maintainer di solito rispondono entro 1 giorno
-
loom participant retire cannot retire an orphaned participant after container replacement or host rebootForse già presa @l0K1ngg l’ha presa oggi. Apertabug help wanted up-for-grabs
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
ClickHouse/loom#2007 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ClickHouse/loom
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
TigreGotico/orthography2ipa#2950 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Unstructured-IO/unstructured#4876 ·
I maintainer di solito rispondono entro 6 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
openfoodfacts/openfoodfacts-python#579 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
fairagro/m4.2_sql_to_arc#388 ·
I maintainer di solito rispondono entro 1 giorno