fix: analytics harness & identity detections#235
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
@farming-labs/astro
@farming-labs/astro-theme
@farming-labs/docs
@farming-labs/theme
@farming-labs/next
@farming-labs/nuxt
@farming-labs/nuxt-theme
@farming-labs/svelte
@farming-labs/svelte-theme
@farming-labs/tanstack-start
commit: |
There was a problem hiding this comment.
1 issue found across 2 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 7 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/docs/src/cloud-analytics.ts">
<violation number="1" location="packages/docs/src/cloud-analytics.ts:190">
P1: Agent-type events are no longer auto-classified unless `trafficType` is already set or the event is MCP, which regresses analytics tagging for existing `agent_`/`llms_request`/`markdown_request`/`skill_request` flows.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
| asString(properties.crawler) ?? | ||
| asString(asRecord(properties.bot).provider) ?? | ||
| detectedAgent ?? | ||
| (protocolAgent || explicitAgent ? inferAgentProvider(event) : undefined); |
There was a problem hiding this comment.
P1: Agent-type events are no longer auto-classified unless trafficType is already set or the event is MCP, which regresses analytics tagging for existing agent_/llms_request/markdown_request/skill_request flows.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/docs/src/cloud-analytics.ts, line 190:
<comment>Agent-type events are no longer auto-classified unless `trafficType` is already set or the event is MCP, which regresses analytics tagging for existing `agent_`/`llms_request`/`markdown_request`/`skill_request` flows.</comment>
<file context>
@@ -137,20 +132,66 @@ function inferAgentProvider(event: DocsAnalyticsEvent) {
asString(asRecord(properties.bot).provider) ??
- inferAgentProvider(event);
+ detectedAgent ??
+ (protocolAgent || explicitAgent ? inferAgentProvider(event) : undefined);
+
+ if (!explicitAgent && !protocolAgent && !detectedAgent && !agentProvider) {
</file context>
| (protocolAgent || explicitAgent ? inferAgentProvider(event) : undefined); | |
| inferAgentProvider(event); |
Summary by cubic
Improves Docs Cloud analytics to reliably tag agent/bot traffic and infer provider names from user-agent and protocol hints. Passes
userAgentthroughpackages/docsandpackages/fumadocsso events are normalized server-side without extra work.New Features
mcpormcp_*), and agent-facing types (agent_*,agents_request,llms_request,markdown_request,skill_request).trafficType="agent"and fillagentName/botProvideronly when not provided; use "MCP client", "Docs agent", or "Docs reader" as needed.getDocsRequestAnalyticsProperties(request)inpackages/docs(exported fromindexandserver); includeuserAgentacrosspackages/fumadocsendpoints (spec, markdown, llms, search, feedback) and Ask AI.Bug Fixes
ClaudeBot/1.0), and avoid false positives for normal browsers (Mozilla/5.0).Written for commit 0240048. Summary will update on new commits.