diff --git a/backend/app/services/llm/enrichment.py b/backend/app/services/llm/enrichment.py index 1605efc..17c1842 100644 --- a/backend/app/services/llm/enrichment.py +++ b/backend/app/services/llm/enrichment.py @@ -454,8 +454,12 @@ async def enrich_article(article_id: int) -> dict[str, str]: return {} # === 短新闻(API Push):跳过 format 和 image(短文不需要排版,用户明确不要配图)=== - # 短新闻入表时 format_status / image_ai_status 已置 'n/a',这里再 ensure 一次 - # 防止未来 ingest 路径忘了设 status。 + # 短新闻入表时 format_status / image_ai_status 已置 'n/a'(见 ingest), + # 这里再 ensure 一次防止未来 ingest 路径忘了设。 + # 注意:跳过某任务时要把对应 status 标 'ok'(语义 = 该任务已"完成" = 不需要做), + # 不能再用 'n/a' —— enrichment_loop 过滤集合包含 'n/a'(line 616), + # 否则短新闻会因 format_status='n/a' != 'ok' 永远进队列反复 enrich, + # 浪费 Angel/美团 LLM 配额(commit 10 之前 95% 调用是浪费)。 is_short = bool(art.is_short_news) # === 1) classify(黑名单 gate,优先执行)=== @@ -485,7 +489,8 @@ async def enrich_article(article_id: int) -> dict[str, str]: # === 2) format(短新闻跳过)=== if is_short: - art.format_status = "n/a" + # 短新闻无需排版,标 'ok' 表示该任务"已完成"(语义 = 跳过) + art.format_status = "ok" results["format"] = "skipped" else: try: @@ -498,7 +503,8 @@ async def enrich_article(article_id: int) -> dict[str, str]: # === 3) image(短新闻跳过)=== if is_short: - art.image_ai_status = "n/a" + # 短新闻无需配图,标 'ok' 表示该任务"已完成"(语义 = 跳过) + art.image_ai_status = "ok" results["image"] = "skipped" else: try: