Cache stores markdown generation errors and failed LLM extractions as successful results

オープン
#2,520 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

Start at DefaultMarkdownGenerator.generate_markdown, where an exception becomes a MarkdownGenerationResult whose raw_markdown starts with "Error in markdown generation", and at LLMExtractionStrategy as reached through aprocess_html, which writes {"error": True} blocks into extracted_content. Then read the cache-write check in arun that #2519 added. Done means these failures are not written to the cache and a later CacheMode.ENABLED run retries them; the signal design is still open, so agree on it in the thread before coding.

索引モデルが issue の本文から書いたものです。

説明

🐞 Bug 🩺 Needs Triage

Follow-up to #2519, which keeps crawls with success=False and results with no markdown out of the cache. Two kinds of failure still look like a success to that check, so they get cached.

Markdown generation errors. When DefaultMarkdownGenerator.generate_markdown hits an unexpected exception, it returns a MarkdownGenerationResult with raw_markdown="Error in markdown generation: ...". The crawl keeps success=True and the markdown is not None, so the error text is written to the cache. It replaces any good copy and replays as the page's markdown on later CacheMode.ENABLED runs. Confirmed by forcing an exception in the generator on the #2519 branch: the next crawl returned success=True, a cache hit, and the error text as markdown.

Failed LLM extractions. When an LLM call fails (rate limit, bad key), LLMExtractionStrategy returns a block like [{"error": True, "tags": ["error"], ...}]. aprocess_html serializes it into extracted_content with success=True, so it is cached and replayed without retrying the extraction. This one comes from reading the code and has not been reproduced.

Both need a failure signal the cache check in arun can see, since the crawl itself did not fail.

主要言語
Python
スター
87.2k
フォーク
9.1k
平均マージ
1日 6時間
マージ済み PR(30日)
25

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

unclecode/crawl4ai のほかの issue

unclecode/crawl4ai の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。