Skip to content

Agent discoverability and navigation fixes#30

Merged
Tranquil-Flow merged 2 commits intomainfrom
dev
Apr 1, 2026
Merged

Agent discoverability and navigation fixes#30
Tranquil-Flow merged 2 commits intomainfrom
dev

Conversation

@Tranquil-Flow
Copy link
Copy Markdown
Collaborator

Summary

  • Fix broken homepage CTAs: <Link><Button> nested <button> inside <a>, causing headless browser agents to fail navigation. Button now supports as="span" for Link-wrapped usage (17 instances fixed)
  • Split "Manage Agents" nav into separate "Register" and "My Agents" links
  • Add robots.txt, sitemap.xml, and agent meta tags (<link rel="agent-api">, <link rel="agent-card">, <link rel="llms-txt">) in <head>
  • Add /.well-known/agent-registration redirect, /agents.json discovery, /api/health status check, and JSON 404 for unmatched API routes
  • Expand middleware content negotiation to serve llms.txt on text/plain Accept header
  • Standardize CORS headers across all discovery endpoints (separated Cache-Control from CORS constant)
  • Add programmatic path callout on /agents/register page
  • Fix pre-existing lint errors in visa page and VisaUpgradeFlow

Context

An AI agent tested app.ai.self.xyz twice and reported that all 3 homepage registration CTAs failed to navigate. Root cause was nested interactive elements (<button> inside <a>). Additional feedback drove discoverability improvements for agent crawlers.

Test plan

  • Vercel preview build passes
  • Homepage CTAs navigate to /agents/register (hero, wizard, agent operators)
  • Nav shows "Register" and "My Agents" as separate items
  • /robots.txt and /sitemap.xml return valid content
  • /agents.json returns discovery JSON
  • /api/health returns {"status":"ok"}
  • /.well-known/agent-registration redirects to /api/agent/bootstrap
  • /api/nonexistent returns JSON 404 with discovery links
  • /nonexistent shows styled 404 page
  • All 265 tests pass, zero lint errors

…on path

Add `as` prop to Button component so it renders as <span> when wrapped in
a Link, fixing the nested interactive elements anti-pattern (<button> inside
<a>) that caused headless browser agents to fail navigation on all homepage
CTAs. Updated all 17 Link-wrapped Button instances across 6 files. Add a
prominent callout on /agents/register directing agents to /api/agent/bootstrap
and /llms.txt before the manual form.
Remove Cache-Control from shared CORS_HEADERS constant — caching is not a
CORS concern and was causing 404 catch-all responses to be cached for 60s.
Each route now sets its own Cache-Control explicitly. Use environment
variable for agent-registration meta tag URL so it works in dev/staging.
Add PATCH and HEAD handlers to API catch-all route. Document as="span"
limitation on Button component. Update tests to match.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 1, 2026

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

Project Deployment Actions Updated (UTC)
self-agent-id Ready Ready Preview, Comment Apr 1, 2026 10:28pm

Request Review

@Tranquil-Flow Tranquil-Flow merged commit e7d4c20 into main Apr 1, 2026
9 checks passed
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