Skip to content

fix: make link_preview_timeout configurable in AdaptiveConfig#1793

Open
Br1an67 wants to merge 1 commit intounclecode:mainfrom
Br1an67:fix/issue-1659-link-preview-timeout
Open

fix: make link_preview_timeout configurable in AdaptiveConfig#1793
Br1an67 wants to merge 1 commit intounclecode:mainfrom
Br1an67:fix/issue-1659-link-preview-timeout

Conversation

@Br1an67
Copy link

@Br1an67 Br1an67 commented Mar 1, 2026

Summary

Fixes #1659

The timeout for LinkPreviewConfig in AdaptiveCrawler._crawl_with_preview was hardcoded to 5 seconds. This adds a link_preview_timeout field to AdaptiveConfig (defaults to 5.0 for backward compatibility) and wires it through.

List of files changed and why

crawl4ai/adaptive_crawler.py — Added link_preview_timeout: float = 5.0 to AdaptiveConfig and replaced the hardcoded timeout=5 with self.config.link_preview_timeout.

How Has This Been Tested?

Verified that the default value (5.0) preserves existing behavior, and that setting a custom value (e.g. AdaptiveConfig(link_preview_timeout=15)) correctly propagates to LinkPreviewConfig.

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

The timeout for link preview extraction in _crawl_with_preview was
hardcoded to 5 seconds. Add link_preview_timeout field to AdaptiveConfig
(defaults to 5.0 for backward compatibility) and use it in the
LinkPreviewConfig.

Closes unclecode#1659
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.

[Bug]: Allow configuration of link_preview_timeout in AdaptiveCrawler

1 participant