Files
deepseek-harness/packages/telemetry
kingwl e6a8ff2621 fix(telemetry): review fixes — flush/shutdown ordering, session retirement, whole-exporter passthrough
Three review findings, each pinned by a red test first:

- The OTel backend retains the latest turn-boundary flush promise and
  shutdown() awaits it before provider.shutdown(): the SDK's
  concurrent-flush guard makes the shutdown-internal flush return early
  while one is in flight, silently dropping everything enqueued after
  the flush snapshot (including the coordinator's dispose-time shutdown
  markers).
- The coordinator retires sessions from the adopted set on
  session/disposed (mirroring the persistence coordinator): a long-lived
  backend no longer retains closed sessions and their event logs, and
  final unload no longer stamps shutdown markers for dead sessions.
- The exporter config passes through whole to OTLPLogExporter and its
  type/JSDoc now advertise the full OTLPExporterNodeConfigBase shape:
  rebuilding url/headers only silently dropped documented SDK options
  (timeoutMillis, compression, keepAlive, ...).
2026-07-25 03:20:29 +08:00
..

telemetry/

Outbound session reporting: the telemetry seam plus its OpenTelemetry backend. The design — the boundary axiom (the harness's aspect ends at emit(); delivery is the reporting SDK's), the telemetry/redact waterfall (deployment-mounted rules; the seam ships none), the fixed chunk projection, the handoff cursor, and the operational-record channel — is pinned in the revival Agent Note.

Package Role
@deepseek-ai/dsh-session-telemetry The seam: capture points, projection, redaction, handoff cursor, ops signals, and the minimal backend contract (emit/flush?/shutdown).
@deepseek-ai/dsh-session-telemetry-otel The backend a deployment loads: the OTel JS SDK's log pipeline (LoggerProvider + BatchLogRecordProcessor + OTLP/HTTP exporter), configured verbatim through passthroughs.