feat(coding-agent): clean webfetch HTML with reader mode#64
Merged
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.
Summary
pi-webfetchreader-mode implementation into senpi's vendoredwebfetchextension.@mozilla/readability+jsdombefore fallback conversion, so article content is returned without page chrome.External upstream work: code-yeongyu/pi-webfetch#1
QA
npx tsx ../../node_modules/vitest/dist/cli.js --run test/suite/webfetch-reader-mode.test.tslocal-ignore/qa-evidence/20260622-webfetch-reader-mode/senpi-webfetch-reader-test-6.txtnpm run checklocal-ignore/qa-evidence/20260622-webfetch-reader-mode/senpi-check-4.txtnode .agents/skills/senpi-qa/scripts/lib/common.mjs --self-checklocal-ignore/qa-evidence/20260622-webfetch-reader-mode/senpi-qa-common-self-check.txtnode .agents/skills/senpi-qa/scripts/mock-loop.mjs --with-toollocal-ignore/qa-evidence/20260622-webfetch-reader-mode/senpi-qa-mock-loop-with-tool.txt--permission webfetch=allow.local-ignore/qa-evidence/20260622-webfetch-reader-mode/senpi-webfetch-cli-qa-3.txt## Readable Fixture Article,Alpha fixture paragraph, andBeta fixture paragraph; excludes title/header/nav/aside/footer/script chrome.npm run check,node scripts/verify-package-managers.mjsfor npm/bun/pnpm install+build, and browser smoke.Review
npm audit --omit=devstill reports one highundiciadvisory under pre-existing@earendil-works/gondolin/node_modules/undici; the newjsdomsubtree resolvesundici@7.28.0.Summary by cubic
Run HTML through reader mode before conversion so
webfetchreturns the main article (not page chrome) when requesting markdown or text. This improves readability and consistency across sites.New Features
@mozilla/readabilitywithjsdomto extract article content before markdown/text conversion; include the title if missing and avoid duplicates.Dependencies
@mozilla/readability,jsdom, and@types/jsdom.package-lock.jsonandnpm-shrinkwrap.json.Written for commit feedcb8. Summary will update on new commits.