Skip to content

Add AI agent detection via @vercel/agent-readability#741

Open
molebox wants to merge 2 commits intomainfrom
add-agent-readability
Open

Add AI agent detection via @vercel/agent-readability#741
molebox wants to merge 2 commits intomainfrom
add-agent-readability

Conversation

@molebox
Copy link
Copy Markdown
Contributor

@molebox molebox commented Apr 2, 2026

Summary

  • Adds @vercel/agent-readability package for AI agent detection in middleware
  • Detected agents get markdown responses instead of HTML for better AI consumption
  • Non-existent docs URLs return helpful not-found markdown with discovery links
  • Accept header content negotiation continues to work as before

Matches the geistdocs template (vercel/geistdocs#58). Uses the same shared package as vercel/front#65649.

Test plan

  • AI agent hitting a valid docs URL gets markdown rewrite
  • AI agent hitting a non-existent docs URL gets not-found markdown
  • Normal browser requests unaffected
  • Build passes

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 2, 2026

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

Project Deployment Actions Updated (UTC)
next-forge Ready Ready Preview, Comment, Open in v0 Apr 2, 2026 11:07am
next-forge-api Error Error Open in v0 Apr 2, 2026 11:07am
next-forge-app Error Error Open in v0 Apr 2, 2026 11:07am
next-forge-storybook Ready Ready Preview, Comment, Open in v0 Apr 2, 2026 11:07am

@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
Added@​vercel/​agent-readability@​0.2.17810010095100

View full report

Comment thread docs/proxy.ts
userAgent: request.headers.get("user-agent"),
referer: request.headers.get("referer"),
acceptHeader: request.headers.get("accept"),
requestType: "agent-rewrite",
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.

The TrackMdRequestParams interface is missing the "agent-rewrite" request type and detectionMethod field, causing a TypeScript build failure.

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