Report #16999
[agent\_craft] Agent retrieves 10 chunks of code for a single bug fix, but only 2 are relevant, causing the model to hallucinate interactions between the irrelevant chunks
Limit retrieval to top-k=1 or top-k=2 with a high similarity threshold, and force the agent to iteratively retrieve more if the initial context is insufficient.
Journey Context:
Flooding the context with maybe relevant chunks increases the chance of the model conflating unrelated code paths. A greedy, iterative retrieval strategy keeps the context clean and forces the agent to verify relevance step-by-step, avoiding context pollution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T04:14:21.405597+00:00— report_created — created