Skip to content

Fix: preserve screenshot and raw-HTML settings in config clones - #2373

Open
linjiaye929 wants to merge 2 commits into
unclecode:developfrom
linjiaye929:codex/preserve-viewport-screenshot-clone
Open

linjiaye929 wants to merge 2 commits into
unclecode:developfrom
linjiaye929:codex/preserve-viewport-screenshot-clone

Conversation

@linjiaye929

@linjiaye929 linjiaye929 commented Oct 15, 2026 •

Copy link
Copy Markdown

Summary

Preserve force_viewport_screenshot and base_url in CrawlerRunConfig.to_dict(), so clone() and dictionary round-trips retain the requested screenshot and raw-HTML link-resolution settings.

Both constructor fields were omitted from to_dict():

  • Cloning force_viewport_screenshot=True silently reset it to False. Internal deep-crawl clones could then select a full-page screenshot when viewport-only was requested.
  • Cloning a configuration with base_url="https://example.test/docs/" discarded that URL. Real offline aprocess_html processing of a guide.html link then returned a relative link instead of https://example.test/docs/guide.html, in both prefetch and full Markdown paths.

The production changes add those two fields only. Explicit clone overrides, including False and None, still work. The base_url follow-up extends the same missing-field fix within this PR; it does not change class-default or serialized-snapshot semantics.

Validation

  • Original viewport change: 6 regression failures / 5 passing controls before; 11 focused cases passed after. Its original related suite had 98 passing tests.
  • Base-URL follow-up on previous PR head 280043ee0ec241b7d950f278df0056c104883af8: 6 regression failures / 6 passing controls before; all 12 pass after.
  • Combined related offline suite on the current tree: 192 passed. Independently repeated the two focused files: 23 passed.
  • Covers default/explicit settings, dictionary round-trips, clone preservation, explicit overrides, and the original config remaining unchanged.
  • Base-URL tests run the real HTML/link/Markdown processing through aprocess_html; only the unused crawler strategy is mocked. Viewport routing uses the existing mocked-strategy style. No browser launched, real screenshot captured, or live network test performed.
  • Network/DNS/datagram audit recorded zero attempts. Class defaults were unchanged before/after; existing dependencies only, no installation.
  • Black passes for the new tests; git diff --check passes. Production-file Black drift exists equally in the baseline and patch. The Black-normalized follow-up difference is only the base_url field; unrelated formatting was left untouched.
  • Full repository and browser integration suites were not run.

The original change is based on develop 6192d5e5b59cb21f9ca418fd6b798de47c0741d3. Before the follow-up, develop 2efcccc5d1838da1f7718813e9be5177ce579b49 differed only in an unrelated HTML documentation template. No rebase or unrelated changes are included. This is separate from #1791 (screenshot routing) and #2030 (URL-joining algorithm).

Hosted checks

On current head 36c564821bb09fe294bf10d63f49affcd433eb9e, the Security workflow is completed with action_required. Hosted tests have not been shown to run; no hosted CI pass is claimed. The earlier head's Security and Discord notification results do not establish coverage of this update.

AI assistance

This change and its tests were developed with AI assistance, including independent diff review. Validation scope and limitations are listed above. No human full-diff review is claimed.

@linjiaye929
linjiaye929 marked this pull request as ready for review October 15, 2026 00:51
@linjiaye929 linjiaye929 changed the title Fix: preserve viewport screenshot preference in config clones Fix: preserve screenshot and raw-HTML settings in config clones Oct 15, 2026
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.

1 participant