feat(annotate): content negotiation for Markdown for Agents#557
Merged
backnotprop merged 1 commit intomainfrom Apr 14, 2026
Merged
feat(annotate): content negotiation for Markdown for Agents#557backnotprop merged 1 commit intomainfrom
backnotprop merged 1 commit intomainfrom
Conversation
Sites that support Cloudflare's "Markdown for Agents" (or similar content negotiation) now return markdown directly, skipping the Jina Reader and Turndown conversion entirely. The negotiation attempt uses a short 5s timeout so failures fall through quickly to the existing pipeline. For provenance purposes, this commit was AI assisted.
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
Accept: text/markdown, text/html;q=0.9content-type: text/markdown(e.g. Cloudflare zones with Markdown for Agents enabled), use it directly — one fetch, no conversion"content-negotiation"source type onUrlToMarkdownResulturl-to-markdown.test.tscovering the negotiation path, fallback, local URL skip, and error handlingRef: Cloudflare Markdown for Agents
Test plan
bun test packages/shared/— all 48 tests pass (7 files)plannotator annotate https://developers.cloudflare.com/fundamentals/reference/markdown-for-agents/returns markdown via content negotiation (no Jina)plannotator annotate https://docs.stripe.com/apifalls through to Jina/Turndown as before