feat(md-exports): Improve soft-404 recovery for agent .md requests - #18953
feat(md-exports): Improve soft-404 recovery for agent .md requests#18953sergical wants to merge 1 commit into
Conversation
The docs.md_export.not_found metric shows agents hitting three distinct miss classes that all got the same generic not-found body. Handle each: - Add md-overrides/platform-redirect.mdx so the platform chooser (the top missed path, ~330 hits/month) exports guidance on building platform URLs directly, with platform and framework link lists. - Teach the md-exports catch-all route to consult both redirect tables (redirects.js and the middleware legacy list) and point moved pages at their destination - .md URL for internal targets, as-is for external. - Detect requested paths that exist in the doctree and serve a Markdown Export Unavailable body with a 60s cache so transient deploy-window gaps recover quickly. Tag the metric with outcome (redirected | page_exists | unknown_path) so dashboards can separate agent-invented URLs from export-pipeline gaps. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 83b7042. Configure here.
|
|
||
| ## Frameworks | ||
|
|
||
| <FrameworkGroups /> |
There was a problem hiding this comment.
Platform override is never generated
High Severity
platform-redirect.mdx has no static HTML artifact to override, so platform-redirect.md continues falling through to the generic not-found route.
Reviewed by Cursor Bugbot for commit 83b7042. Configure here.
| // export-pipeline gap). Very different signal from an invented URL. | ||
| outcome = 'page_exists'; | ||
| hasSuggestions = !!ancestor.children?.length; | ||
| body = renderExportMissingBody(requestedPath, ancestor); |
There was a problem hiding this comment.
Synthetic doctree nodes appear as pages
Medium Severity
Exact doctree matches are treated as real pages without checking node.missing, so synthetic hierarchy nodes receive a false “Markdown Export Unavailable” response and page_exists metric.
Reviewed by Cursor Bugbot for commit 83b7042. Configure here.


DESCRIBE YOUR PR
Agent-facing
.mdsoft-404s (thedocs.md_export.not_foundmetric, ~6.9k hits since July 20) fall into three classes that today all get the same generic "Page Not Found" markdown. This PR gives each class a response the agent can actually act on:platform-redirect(top missed path, ~330 hits/month): newmd-overrides/platform-redirect.mdxexplains that the page is a platform chooser with no content of its own and shows how to build/platforms/<platform>/<page>.mdURLs directly, with platform and framework link lists rendered from the doctree./product/sentry-mcp.md): the md-exports catch-all route now consults both redirect tables (redirects.jsand the middleware legacy list) and serves a "Page Moved" body pointing at the destination — the.mdURL for internal targets, the URL as-is for external ones like mcp.sentry.dev. Pattern (:path*) sources are skipped for now; the new metric attribute will show whether they matter.product.mdburst on July 30): the route detects doctree hits and serves "Markdown Export Unavailable" with the HTML link and child pages, cached for 60s so a restored export takes over quickly.The metric gains an
outcomeattribute (redirected|page_exists|unknown_path) so dashboards can separate agent-invented URLs from export-pipeline gaps. The metric name and existing attributes are unchanged.Review notes: the
middleware.tsdiff is onlyexportkeywords on the two redirect arrays and theRedirecttype —route.tsis the substantive change. Verified with 232 passing vitest tests (8 new covering redirect, external-destination, pattern-skip, and page-exists paths), cleantsc/ESLint/Prettier, and the override rendered through a mirror of thegenerate-md-exportsMDX pipeline against the real doctree. On the Vercel preview, check/platform-redirect.mdand/product/sentry-mcp.md.IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes:
🤖 Generated with Claude Code