From 5d9bb990dc40d43a80c12d9184bbb0b8d0cc57b6 Mon Sep 17 00:00:00 2001 From: Mattew <755716224@qq.com> Date: Wed, 15 Jul 2026 09:31:35 +0800 Subject: [PATCH 1/2] fix: classify non-mcp /api/* requests as 'other', not 'docs' --- src/lib/docs-request-classifier.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/docs-request-classifier.ts b/src/lib/docs-request-classifier.ts index 1a32fff6..6dbe5613 100644 --- a/src/lib/docs-request-classifier.ts +++ b/src/lib/docs-request-classifier.ts @@ -192,6 +192,10 @@ function classifySurface(path: string): DocsRequestSurface { if (pathname === '/llms.txt' || pathname === '/llms-full.txt') return 'llms' if (pathname === '/api/mcp' || pathname.startsWith('/api/mcp/')) return 'mcp' + // Every other /api/* route (og, feedback, faucet, index-supply, ...) is an + // application endpoint, not a docs surface. Without this, isDocsPage() treats + // extensionless paths like /api/og as 'docs' and mislabels their traffic. + if (pathname === '/api' || pathname.startsWith('/api/')) return 'other' if (pathname === '/skill.md') return 'skill' if (pathname.startsWith('/.well-known/')) return 'well_known' if (pathname.endsWith('.md')) return 'markdown' From 59c7b1d77cad7a78b57d97d392bb5a1baa39d16e Mon Sep 17 00:00:00 2001 From: Mattew <755716224@qq.com> Date: Wed, 15 Jul 2026 09:32:22 +0800 Subject: [PATCH 2/2] fix: classify non-mcp /api/* requests as 'other', not 'docs' --- e2e/docs-request-classifier.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/e2e/docs-request-classifier.test.ts b/e2e/docs-request-classifier.test.ts index 98aab20d..f03304bc 100644 --- a/e2e/docs-request-classifier.test.ts +++ b/e2e/docs-request-classifier.test.ts @@ -198,6 +198,16 @@ const cases: ClassificationCase[] = [ surface: 'docs', }, }, + { + name: 'non-mcp api route is not a docs surface', + input: { path: '/api/og', userAgent: 'facebookexternalhit/1.1' }, + expected: { + agent_kind: 'human', + match_source: 'none', + shouldTrack: false, + surface: 'other', + }, + }, ] for (const item of cases) {