feat(core): replace webfetch markdown renderer - #42229
Open
kitlangton wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replace V2 Core webfetch's Turndown/Domino HTML-to-Markdown conversion with a purpose-built
htmlparser2event renderer. The renderer preserves model-readable document structure without constructing a browser DOM and removes Core'sturndown,@mixmark-io/domino, and@types/turndownclosure.How
packages/core/src/tool/html-markdown.tsimplements an iterative semantic frame renderer for headings, paragraphs, inline formatting, links/images, blockquotes, nested lists, inline/fenced code, and readable tables.packages/core/test/tool-webfetch.test.tscovers the public helper and tool path with malformed/deep input, Unicode/entities, active content, whitespace, code, nested lists/tables, and output-growth regressions.packages/core/perf/html-markdown.mdrecords the autoresearch experiments and measurements.Scope
packages/opencodeis untouched.WebFetchTool.convertHTMLToMarkdownremains the public helper.Testing
bun run test tool-webfetch.test.tsfrompackages/core: 26 passed.bun typecheckfrompackages/core: passed.bun typecheckfrompackages/cli: passed.bun turbo typecheck: 29/29 package tasks passed.MODELS_DEV_API_JSON=../core/test/plugin/fixtures/models-dev.json bun run build --single --skip-installfrompackages/cli: passed..git/HEADasaddinstead of expectedchange; it reproduces in isolation.