From a6189fce6bcd084fed8c3f26d28d9c31f2da2d3b Mon Sep 17 00:00:00 2001 From: Celes Renata Date: Fri, 17 Apr 2026 19:29:41 +0000 Subject: [PATCH] fix: skip LLM thesis rewrite for informational/suppressed recs to prevent queue buildup --- services/recommendation/worker.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/recommendation/worker.py b/services/recommendation/worker.py index 070707a..9c1c14c 100644 --- a/services/recommendation/worker.py +++ b/services/recommendation/worker.py @@ -808,9 +808,10 @@ async def generate_recommendation( invalidation_conditions=result.invalidation_conditions, ) - # 5. Optional LLM thesis rewrite + # 5. Optional LLM thesis rewrite — only for trading-eligible recommendations + # to avoid the LLM bottleneck on informational/suppressed recs. llm_thesis: str | None = None - if ollama_config is not None: + if ollama_config is not None and result.eligible and not suppression.suppressed: deterministic_thesis = build_thesis(summary, result, projection=effective_projection) llm_thesis = await rewrite_thesis_with_llm( deterministic_thesis=deterministic_thesis,