Repository navigation
Raw-text passthrough (spec #11): verbatim text/JSON/XML/YAML + README onboarding + e2e - #15
Merged
Merged
Conversation
…6, research note) Research and design for issue #11. No behavior change.
Patterns researched from high-star MCP tools (see docs/research/readme-onboarding-patterns.md): 3-step quick start and details-collapsed per-client configs (browser-tools-mcp, official fetch server), comparison table and FAQ (wigolo), go install channel (fzf). Adds Usage section showing raw-text passthrough, Troubleshooting, and Contributing. Removes em-dash punctuation throughout; fixes stale Go 1.22 requirement (go.mod is 1.26).
go test -tags=e2e ./internal/mcpserver builds the actual cmd/agent-web-fetch binary, runs it as a subprocess on the stdio transport (SDK CommandTransport), and exercises it with a real MCP client against a local httptest server: verbatim text/plain and JSON passthrough, iso-8859-1 decoding, HTML still extracted, image/png rejected as IsError, tool description surfaces passthrough. A successful session also proves stdout stays clean (any stray write would corrupt the ndjson framing). Set AWF_E2E_REAL=1 to additionally fetch a live raw.githubusercontent.com URL (issue #11's exact scenario); that case needs network and is skipped by default.
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
Fetching a raw text document no longer fails with
unsupported content type. Alltext/*types, JSON including+jsonvendor types, the XML family, the YAML family, andapplication/javascriptnow return the body verbatim, decoded to UTF-8. This is the exact case reported in #11:raw.githubusercontent.commarkdown, JSON files, and friends.HTML responses keep the extraction path byte-for-byte unchanged. Binary and other non-text types are still rejected with a clear error.
Changes
ea6aa8a)internal/fetch(ticket Ticket: raw-text passthrough core behavior #13): content-type classification, charset decoding viax/net/html/charset, verbatim result with URL-basename titleDedup body read and unify content-type parsingrefactor from code review (71b26ec)docs/research/readme-onboarding-patterns.md(cb9aaa2)-tags=e2e(7bde64c)21c86cb)Closes #13. Closes #14.
Verification
go test ./...andgo vet ./...greengo test -tags=e2e ./internal/mcpservergreen: verbatim text/plain and JSON passthrough, iso-8859-1 decoding, HTML still extracted, image/png rejected as IsError, tool description surfaces passthroughAWF_E2E_REAL=1: liveraw.githubusercontent.com/.../README.mdfetch returns the markdown source verbatim