{"record":{"id":"63f70bc2dd522df7","repo":"deepseek-ai/deepseek-harness","slug":"telemetry-backend-shutdown-failed-string-error","errorCode":null,"errorMessage":"telemetry: backend shutdown failed: ${String(error)}","messagePattern":"telemetry: backend shutdown failed: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/session/session-telemetry/src/coordinator.ts","lineNumber":123,"sourceCode":"          this.relayAgentError(agent, turn, step, error)\n        })\n      })\n      for (const session of ctx.sessions.list()) {\n        this.adopt(session)\n      }\n    }\n    ctx.effect(() => async () => {\n      // Sessions still adopted here are alive through whole-application\n      // teardown, so capture the marker before the backend quiesces.\n      for (const session of this.adopted) {\n        this.contain(() => {\n          this.deliver(session, { record: this.redact(shutdownRecord(session)) })\n        })\n      }\n      try {\n        await this.backend.shutdown()\n      } catch (error) {\n        this.ctx.logger.warn(`telemetry: backend shutdown failed: ${String(error)}`)\n      }\n    }, 'telemetry capture')\n  }\n\n  /**\n   * Project and hand over the canonical session-log suffix after the handoff\n   * cursor, optionally stopping at an inclusive sequence boundary. Redaction\n   * runs during this call, so an on-demand caller retains no copied records\n   * before requesting capture and uses the policy mounted at that time.\n   * Backend and policy failures remain contained per event and do not starve\n   * later events in the same replay.\n   * @param session - session whose current canonical-log prefix may be handed over.\n   * @param throughSeq - optional last sequence included in this capture.\n   */\n  captureSession(session: Session, throughSeq?: number): void {\n    const cursor = handoffCursor.get(session) ?? session.firstLiveSeq - 1\n    // Containment is PER EVENT: one rejected record is withheld fail-closed\n    // while the rest of the historical replay proceeds.","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/session/session-telemetry/src/coordinator.ts#L105-L141","documentation":"Error \"telemetry: backend shutdown failed: ${String(error)}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/session/session-telemetry/src/coordinator.ts:123 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the telemetry backend shutdown error and fix the backend's close/flush path."],"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"}