Skip to content

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

Merged
molebox merged 4 commits intomainfrom
add-agent-readability
Apr 7, 2026
Merged

Add AI agent detection via @vercel/agent-readability#421
molebox merged 4 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)
ai-elements Ready Ready Preview, Comment, Open in v0 Apr 7, 2026 0:12am

- Update TrackMdRequestParams to include 'agent-rewrite' requestType and detectionMethod
- Import DetectionMethod type from @vercel/agent-readability
- Include detectionMethod in tracking fetch body
- Add Vary: Accept header on agent-rewrite responses
- Add discovery options (sitemapUrl, indexUrl) to generateNotFoundMarkdown

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@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

@molebox molebox merged commit 9ab9c71 into main Apr 7, 2026
11 checks passed
@molebox molebox deleted the add-agent-readability branch April 7, 2026 12:23
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.

2 participants