{"record":{"id":"c421b0d705918aa9","repo":"diegosouzapw/OmniRoute","slug":"grok-error","errorCode":"GROK_ERROR","errorMessage":"chunk.error","messagePattern":"chunk\\.error","errorType":"http","errorClass":null,"httpStatus":502,"severity":"error","filePath":"open-sse/executors/grok-web.ts","lineNumber":563,"sourceCode":"  eventStream: ReadableStream<Uint8Array>,\n  model: string,\n  cid: string,\n  created: number,\n  isThinkingModel: boolean,\n  toolRegistry: GrokToolRegistry,\n  signal?: AbortSignal | null\n): Promise<Response> {\n  let fullContent = \"\";\n  let fingerprint = \"\";\n  const thinkingParts: string[] = [];\n\n  for await (const chunk of extractContent(eventStream, isThinkingModel, toolRegistry, signal)) {\n    if (chunk.fingerprint) fingerprint = chunk.fingerprint;\n\n    if (chunk.error) {\n      return new Response(\n        JSON.stringify({\n          error: { message: chunk.error, type: \"upstream_error\", code: \"GROK_ERROR\" },\n        }),\n        { status: 502, headers: { \"Content-Type\": \"application/json\" } }\n      );\n    }\n    if (chunk.thinking) {\n      thinkingParts.push(chunk.thinking);\n      continue;\n    }\n    if (chunk.toolCalls) {\n      return new Response(\n        JSON.stringify({\n          id: cid,\n          object: \"chat.completion\",\n          created,\n          model,\n          system_fingerprint: fingerprint || null,\n          choices: [\n            {","sourceCodeStart":545,"sourceCodeEnd":581,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/open-sse/executors/grok-web.ts#L545-L581","documentation":"Error \"chunk.error\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at open-sse/executors/grok-web.ts:563 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}