Skip to content

fix(deep-crawl): count queued next-level URLs against max_pages in BFS - #2339

Open
drakeo338 wants to merge 7 commits into
unclecode:developfrom
drakeo338:claude/2338-fix
Open

drakeo338 wants to merge 7 commits into
unclecode:developfrom
drakeo338:claude/2338-fix

Conversation

@drakeo338

Copy link
Copy Markdown

Fixes #2338.

Summary

In BFS deep crawl, link_discovery computed the remaining page budget per parent page without counting URLs already queued in next_level by sibling parents. Each parent could queue the full remaining budget, so one level overshot max_pages (14 left with 35 parents of 30 links each queued 490 URLs). The remaining capacity now subtracts len(next_level).

List of files changed and why

  • crawl4ai/deep_crawling/bfs_strategy.py - subtract already-queued URLs from remaining capacity
  • tests/deep_crawling/test_bfs_max_pages_next_level.py - regression test

How Has This Been Tested?

The new test fails before the change and passes after it.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added/updated unit tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Unticked: only the new test was run, not the full suite; no comments or docs changes were needed.

unclecode and others added 7 commits September 25, 2026 06:35
…end date

The cloud line and the banner images say "free credit to start, no card" and "prices can change while we
learn, what you buy stays yours", so a price change during the soft launch never contradicts the repo.
…e credit to start, no amount and no end date

The soft launch may change the prices and the free credit; what a customer buys stays theirs. No public line
names the gift's size or a date any more, so a price change never contradicts the docs.
…otice, with the soft-launch words

The cloud launch on main: the docs banner, the docs home, the daily notice, with the soft-launch words
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants