deepseek-ai/deepseek-harness · error

telemetry: capture step failed

Error message

telemetry: capture step failed: ${String(error)}

What it means

contain() wraps every telemetry capture step because cordis emit is stop-on-throw: an uncaught listener error would starve every subscriber registered after this plugin, so capture failures are logged instead of propagating.

Solutions

  1. Inspect the telemetry capture error and fix the failing capture step (backend write, serialization).
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at packages/session/session-telemetry/src/coordinator.ts:265 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/bd3e6883ccf88f09. Report an issue: GitHub.

Appendix: source

Thrown at packages/session/session-telemetry/src/coordinator.ts:265

  }

  /** Lazily create the per-session first-chunk tracking set. */
  private seen(session: Session): Set<string> {
    let set = this.chunkSeen.get(session)
    if (!set) this.chunkSeen.set(session, set = new Set())
    return set
  }

  /**
   * Run one capture-side step with its exception contained: cordis `emit`
   * is stop-on-throw, so a throwing listener would starve every subscriber
   * registered after this plugin — nothing from the backend may escape.
   */
  private contain(step: () => void): void {
    try {
      step()
    } catch (error) {
      this.ctx.logger.warn(`telemetry: capture step failed: ${String(error)}`)
    }
  }
}

/**
 * Build the per-session clean-exit marker: emitted at the session's own
 * disposal edge, or at coordinator dispose for sessions still alive then.
 */
function shutdownRecord(session: Session): SessionTelemetryRecord {
  return {
    channel: 'ops',
    time: Date.now(),
    severity: 'info',
    attributes: { 'telemetry.op': 'shutdown', 'session.id': String(session.id) },
    body: { op: 'shutdown' },
  }
}

View on GitHub (pinned to b150a551b8)