Skip to content

Replace local ai-agent-detection with @vercel/agent-readability#1580

Open
molebox wants to merge 3 commits intomainfrom
replace-agent-detection-with-package
Open

Replace local ai-agent-detection with @vercel/agent-readability#1580
molebox wants to merge 3 commits intomainfrom
replace-agent-detection-with-package

Conversation

@molebox
Copy link
Copy Markdown
Contributor

@molebox molebox commented Apr 1, 2026

Summary

  • Replaces local ai-agent-detection.ts with the shared @vercel/agent-readability package
  • UA pattern updates now propagate from one place via version bumps
  • Adds generateNotFoundMarkdown response for agents hitting non-existent docs URLs

Same approach as vercel/front#65649 and vercel/geistdocs#58.

Test plan

  • AI agent hitting a valid docs URL gets markdown rewrite
  • AI agent hitting a non-existent docs URL gets helpful not-found markdown
  • Accept header content negotiation still works
  • Build passes

🤖 Generated with Claude Code

@molebox molebox requested a review from a team as a code owner April 1, 2026 13:25
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 1, 2026

⚠️ No Changeset found

Latest commit: fd863ce

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Error Error Apr 1, 2026 1:26pm
example-nextjs-workflow-webpack Error Error Apr 1, 2026 1:26pm
example-workflow Error Error Apr 1, 2026 1:26pm
workbench-astro-workflow Error Error Apr 1, 2026 1:26pm
workbench-express-workflow Error Error Apr 1, 2026 1:26pm
workbench-fastify-workflow Error Error Apr 1, 2026 1:26pm
workbench-hono-workflow Error Error Apr 1, 2026 1:26pm
workbench-nitro-workflow Error Error Apr 1, 2026 1:26pm
workbench-nuxt-workflow Error Error Apr 1, 2026 1:26pm
workbench-sveltekit-workflow Error Error Apr 1, 2026 1:26pm
workbench-vite-workflow Error Error Apr 1, 2026 1:26pm
workflow-docs Error Error Apr 1, 2026 1:26pm
workflow-swc-playground Error Error Apr 1, 2026 1:26pm

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

🧪 E2E Test Results

All tests passed

Summary

Passed Failed Skipped Total
✅ 💻 Local Development 118 0 50 168
✅ 📦 Local Production 118 0 50 168
✅ 🐘 Local Postgres 118 0 50 168
Total 354 0 150 504

Details by Category

✅ 💻 Local Development
App Passed Failed Skipped
✅ nextjs-turbopack-canary 59 0 25
✅ nextjs-webpack-canary 59 0 25
✅ 📦 Local Production
App Passed Failed Skipped
✅ nextjs-turbopack-canary 59 0 25
✅ nextjs-webpack-canary 59 0 25
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ nextjs-turbopack-canary 59 0 25
✅ nextjs-webpack-canary 59 0 25

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: failure
  • Local Prod: failure
  • Local Postgres: failure
  • Windows: failure

Check the workflow run for details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

No benchmark result files found in benchmark-results

@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​vercel/​agent-readability@​0.2.17810010095100

View full report

return NextResponse.rewrite(new URL(result, request.nextUrl));
}
// Agent requested a non-existent docs URL — return helpful markdown
return new NextResponse(generateNotFoundMarkdown(pathname), {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not-found markdown response for AI agents returns HTTP 200 instead of HTTP 404, creating a soft 404 anti-pattern that misleads agents into treating "Page Not Found" content as valid page content.

Fix on Vercel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant