Repository navigation
fix(core): convert XHTML in webfetch - #63889
Closed
Wang-Zephyr wants to merge 1 commit into
Closed
Wang-Zephyr wants to merge 1 commit into
Wang-Zephyr wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Looks good. I ran the new test against the base, where it fails, and with this change all 92 tests in tool-webfetch.test.ts pass. typecheck:tsc passes for packages/core.
Because convert() now uses the lowercased media type without its parameters, this also fixes mixed-case headers like Text/HTML; Charset=UTF-8. I checked that with the reproduction from #49322: it fails on the base and passes here.
The only behaviour change is exact matching instead of a substring match, which is correct for media types. The public API is unchanged. No concerns.
Fixes #49322
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.
Issue for this PR
Fixes #63888
Type of change
What does this PR do?
Use the normalized response MIME type so
webfetchconvertsapplication/xhtml+xmlthrough the existing HTML converter. Thehtmlformat still returns the raw body.How did you verify your code works?
bun test ./test/tool-webfetch.test.tsinpackages/core(92 passed). The new registered-tool test returned raw XHTML onf0089856and now checks markdown, text, and HTML with a mocked HTTP response. Core typecheck, Prettier, and oxlint passed.Screenshots / recordings
Backend tool output.
Checklist
OpenAI Codex assisted with the fix and regression test.
Added by the opencode bot (AI-generated).
Fixes #49322