fix(docs): return all valid URLs on 404 for AI agent self-correction#2698
fix(docs): return all valid URLs on 404 for AI agent self-correction#2698michaelmagan wants to merge 1 commit intomainfrom
Conversation
When agents guess a URL and get a 404, they now receive a full listing of every valid page instead of a useless error. The markdown route handler returns plain text with all URLs; a new not-found page does the same in HTML for browser visitors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Reviewed PR #2698 — no actionable issues found. Both the plain-text 404 response for agents (in the Task list (3/3 completed)
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Clean, well-scoped PR. The plain-text 404 in the .mdx route and the HTML not-found.tsx in the (docs) group cover both the agent and browser 404 paths correctly. No issues found.
Claude Opus | 𝕏
|
TL;DR — When an AI agent (or human) hits a 404 on the docs site, the response now includes a full listing of every valid page URL so the agent can self-correct and retry with the right path. This covers both the markdown/plain-text route used by LLM agents and a new browser-facing 404 page. Key changes
Summary | 2 files | 1 commit | base: Plain-text 404 for agent self-correction
The new Browser-facing 404 page with section grouping
Pages are grouped into sections via a
|

Summary
Accept: text/markdown) now returns a plain-text 404 listing every valid page plus pointers to/llms.txt,/llms-full.txt, and the.mdxsuffixnot-found.tsxfor browser visitors showing the same URL listing in HTML, grouped by section, with the docs sidebar still availableFollows up on #2697 — that PR prevented most 404s with redirects; this PR handles the ones that slip through.
Test plan
/concepts/doesnt-exist) in a browser — should see the new 404 page with all valid URLscurl -H "Accept: text/markdown" https://docs.tambo.co/concepts/doesnt-exist— should get plain-text 404 with URL listing🤖 Generated with Claude Code