Ingest stores the fake LLM's echo as chunk descriptions when `llm.provider` is `fake`, and no op clears them
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 263
- Forks
- 47
- Avg merge
- 14h 21m
- Merged PRs (30d)
- 873
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ClickHouse/loom
-
Difficulty 1/5 1-3 hours Newbie friendliness 76/100
ClickHouse/loom#2014 ·
Maintainers usually reply within 1 day
-
Options of loom period-digest, reextract, reconcile-status and demote-activity-narration print no help textPossibly taken @VanshajPoonia claimed this today. Openbug good first issue help wanted up-for-grabs
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/loom#1988 · 1 comment ·
Maintainers usually reply within 1 day
-
A compiler-tier checkout fetch from a shallow mirror never records its headPossibly taken @KaloyanNaumov claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
ClickHouse/loom#2016 ·
Maintainers usually reply within 1 day
-
Delta workers fetch the compiler-tier checkout under a hard-coded 600 s limitPossibly taken @KaloyanNaumov claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 35/100
ClickHouse/loom#2012 ·
Maintainers usually reply within 1 day
-
loom participant retire cannot retire an orphaned participant after container replacement or host rebootPossibly taken @l0K1ngg claimed this today. Openbug help wanted up-for-grabs
Difficulty 4/5 3-5 days Newbie friendliness 48/100
ClickHouse/loom#2007 · 2 comments ·
Maintainers usually reply within 1 day
Similar issues
-
DMB documentation good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ubuntu/ubuntu-project-docs#921 ·
Maintainers usually reply within 1 day
-
⏳ Pending feedback 🐛 Bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
jumpserver/jumpserver#18282 · 1 comment ·
Maintainers usually reply within 1 day
-
accepted
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
future-agi/future-agi#5274 ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
GenericMappingTools/pygmt#5014 · 1 comment ·
Maintainers usually reply within 1 day