AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

AI Search Crawlers And TelegramBot Miss Streaming Metadata In Edge SSR

Next.js App Router with Edge SSR streaming defers metadata into Suspense chunks. Bots like TelegramBot, ChatGPT-User, GPTBot, and ClaudeBot terminate the response after the initial HTML chunk, causing empty social cards and missing SEO metadata.

highConfidence 92%Next.jsApp RouterTurbopackPages RouterAffected V16.4.0-Canary.32

Origin Analysis

Next.js's bot detection list in is-bot.ts does not include AI crawlers or TelegramBot, so these user agents are treated as regular browsers and receive streamed HTML where metadata appears only in later Suspense chunks. The underlying design flaw is a hardcoded, incomplete bot list without an extension mechanism.
1. Deploy an App Router page with asynchronous metadata streaming in Edge SSR runtime. 2. Send an HTTP request with User-Agent 'TelegramBot (like TwitterBot)', 'ChatGPT-User', 'GPTBot', or 'ClaudeBot'. 3. Observe that the initial HTML chunk lacks <title>, <meta name="description">, and OpenGraph tags.

Fixing Code Block

Edge Case Audit

This is a patch to internal Next.js files; it may be overwritten on upgrade. Use patch-package or wait for an official fix. The regex change could theoretically match legitimate browsers with custom user agents containing these substrings, but the risk is minimal. Rollback by removing the added user-agent tokens from the regex or restoring the original file.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state