{"record":{"id":"27697537aaa86021","repo":"deepseek-ai/deepseek-harness","slug":"web-runtime-lineage-cycle-at-s-sessionid-emi","errorCode":null,"errorMessage":"[web-runtime] lineage cycle at ${s.sessionId}; emitting as root","messagePattern":"\\[web-runtime\\] lineage cycle at (.+?); emitting as root","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/client/runtime/src/client/sessions/lineage.ts","lineNumber":73,"sourceCode":"  for (const s of summaries) byId.set(s.sessionId, s)\n\n  const children = new Map<SessionId, TitledSessionSummary[]>()\n  const roots: TitledSessionSummary[] = []\n  for (const s of summaries) {\n    if (s.parentSessionId !== undefined && byId.has(s.parentSessionId)) {\n      const list = children.get(s.parentSessionId) ?? []\n      list.push(s)\n      children.set(s.parentSessionId, list)\n    } else {\n      roots.push(s) // root, or an orphan whose parent is absent from summaries (degrade to root, never drop)\n    }\n  }\n\n  const out: SessionListEntry[] = []\n  const visited = new Set<SessionId>()\n  const walk = (s: TitledSessionSummary, depth: number): void => {\n    if (visited.has(s.sessionId)) {\n      console.warn(`[web-runtime] lineage cycle at ${s.sessionId}; emitting as root`)\n      return\n    }\n    visited.add(s.sessionId)\n    const pendingInteraction = pendingInteractions?.get(s.sessionId)\n    out.push({\n      ...s,\n      ...(pendingInteraction === undefined ? {} : { pendingInteraction }),\n      completed: completed?.has(s.sessionId) ?? false,\n      depth,\n    })\n    const kids = children.get(s.sessionId)\n    if (kids === undefined) return\n    for (const kid of kids) walk(kid, depth + 1)\n  }\n  for (const root of roots) walk(root, 0)\n  // Cycle members (unreachable from any root): emit as roots so no entry is lost.\n  for (const s of summaries) {\n    if (!visited.has(s.sessionId)) walk(s, 0)","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/client/runtime/src/client/sessions/lineage.ts#L55-L91","documentation":"Error \"[web-runtime] lineage cycle at ${s.sessionId}; emitting as root\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/client/runtime/src/client/sessions/lineage.ts:73 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect session lineage data for a cycle at the reported sessionId and remove the circular parent reference."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}