ChatGPTClaudeGrok / X / CursorGemini

DSH plugin session telemetry: redaction and OTLP backend

Plugin DevelopmentPublished 2026-10-21Author: DeepSeek Plugin Market
DSH pluginDeepSeek HarnesstelemetrySessionTelemetryOTLP
DSH session telemetry has ledger records mirroring session events and ops records for agent-error and shutdown. emit is non-blocking; redaction is a waterfall.

Session telemetry is not “copy the log again”; it is an independent export path: the capture service turns session events into logical records, a redaction waterfall trims sensitive data, and the backend performs a non-blocking enqueue and batch export. It never enters model requests and does not guarantee no loss or no duplicates. Accept those boundaries before writing a backend, or the implementation will block the agent loop or promise reliability it cannot provide.

DeepSeek Harness: What one record looks like

A record has only two channels: ledger and ops; ledger is deduplicable, ops is an alert signal. Compare:(source)

Fieldledgerops
Sourcesession log eventsagent-error, shutdown
Identitysession.id, event.type, event.seqno seq identity
Dedupby the tripleduplicates tolerated
Usereplay, audit, countingalerting, operations

attributes is deliberately minimal: ledger carries session and event identity; ops carries the operation name and necessary agent/turn/step fields. Anything recoverable from body is not duplicated into attributes.

body is the full payload: a deep copy of the session event data for ledger, or the operation payload for ops. It must not be mutated after handoff.

DeepSeek Harness: Capture and the handoff cursor

Capture can follow live events or read the canonical log on demand; both are bounded by the handoff cursor. Key points:(source)

  1. live capture — dispatches synchronously when an event is appended. Expected: good for real-time monitoring, but emit must be fast.
  2. on-demand capture — reads the canonical log only when requested. Expected: good for feedback-style backends; the OTel backend uses this mode.
  3. includeHistory — optionally includes inherited fork history and earlier lifecycles. Expected: off by default to avoid replaying old prefixes.
  4. re-adoption — continuing after the handoff cursor. Expected: it does not replay from the beginning.

A new fork starts at the child session’s own suffix, including the inheritance marker and fork end event; a resumed session starts after the stored prefix. The cursor means “handed off”, not “delivered”.

DeepSeek Harness: The redaction waterfall

Redaction lives in listeners on session-telemetry/record, not in the seam; no listener means no redaction. Key points:(source)

  • The waterfall ships no rules — the innermost next() passes the record through unchanged. Expected: records reach the backend as captured.
  • Listeners stack — transform the value returned by next(). Expected: multiple rules compose.
  • Returning without next() replaces — your record replaces everything beneath. Expected: drop or rewrite the record entirely.
  • Throwing withholds the record — a failed listener is fail-closed and the record never reaches the loop. Expected: a bad rule does not leak sensitive data.
  • Only the export copy changes — the canonical session log is never rewritten. Expected: local audit records stay intact.

Redaction runs on the capture hot path; listeners must be synchronous, fast, and non-blocking. Do not make network calls or read large files here.

DeepSeek Harness: Backend contract

A backend has three actions: emit, optional flush, and shutdown; emit must never block. Each:(source)

  1. emit(record) — called synchronously; enqueue only. Expected: slow work goes to your own queue, and exceptions are contained by the coordinator.
  2. flush?() — an optional turn-end hint, fire-and-forget. Expected: do not block or throw meaningfully.
  3. shutdown() — drain the queue and await quiescence. Expected: records emitted before the call must still be delivered, including those enqueued while a flush is in flight.

SessionTelemetryBackend allows one implementation per context; duplicate registration throws. A backend composes a SessionTelemetryCoordinator in its constructor to install capture.

DeepSeek Harness: Three backend strategies

OTel, a custom sink, and disabled telemetry answer different needs: observability versus compliance. Three:(source)

  1. OTel backend — on-demand capture with new explicit feedback; releases the full prefix up to that feedback. Expected: standard observability platforms; the backend owns the queue and the 4,000,000-byte cap.
  2. Custom sink — implement emit/flush/shutdown and write to an internal system. Expected: reuse an existing log platform, but you own deduplication and retries.
  3. Disable telemetry — set DSH_TELEMETRY_MODE=DISABLED. Expected: no export; OTLP uses Node’s own HTTP client and does not go through the proxy anyway.

If the environment forbids direct egress, OTLP export fails. DSH does not depend on it, and disabling it does not affect the main flow.

DeepSeek Harness: A minimal backend skeleton

A backend does three things: enqueue, optionally flush, and drain on shutdown. Skeleton:(source)

ts
class MyTelemetryBackend {
  private queue: SessionTelemetryRecord[] = []

  emit(record: SessionTelemetryRecord) {
    this.queue.push(record) // enqueue only, no network IO
  }

  async shutdown() {
    await this.drain(this.queue.splice(0))
  }
}

emit is called on the hot path and must not await; network work belongs to your worker. shutdown must deliver everything emitted before the call, including records enqueued while a flush is in flight.

Privacy and reliability boundaries

“Minimal identity” does not mean “minimal content”; body can still contain conversations and tool results. Three points:

  • No default redaction — without listeners there are no rules, and sensitive data is exported as captured.
  • Best-effort delivery — crash windows can lose, replay can duplicate; deduplicate ledger, tolerate ops duplicates.
  • Never in model requests — this one is certain; do not treat telemetry as model context.

Before shipping, check that the redaction listener is actually mounted, emit only enqueues, and shutdown waits for quiescence.

DeepSeek Harness FAQ

Can emit write directly to a database? Not recommended. emit is synchronous on the hot path; writing to a database slows the loop. Enqueue and let a worker persist.

Does forking a session duplicate the parent history? By default no. A new fork starts at the child’s own suffix; enable includeHistory explicitly when needed.

What happens if a redaction rule throws? The record is withheld fail-closed; unredacted data does not pass, but that record is lost.

The short version: keep emit non-blocking, redact through the waterfall, and treat delivery as best-effort; that is the only honest contract.

ChatGPTClaudeGrok / X / CursorGemini

FAQ

Does DeepSeek Harness session telemetry enter model requests?

DeepSeek Harness: no. The official docs state that reported telemetry does not enter model requests. Telemetry is a separate export path: the capture service normalizes events, redacts, and tracks a handoff cursor; the backend owns queuing and export.

What is the difference between ledger and ops records?

DeepSeek Harness: ledger records mirror session log events one-to-one and carry session.id, event.type, and event.seq identity. Ops records carry agent-error and shutdown signals with no log home and intentionally omit seq identity, so duplicates are tolerated.

If no listener is mounted on session-telemetry/record, is data redacted?

DeepSeek Harness: no. The waterfall has no rules of its own. Without a listener, records reach the backend as captured. How clean the export is depends entirely on the redaction rules the deployment mounts.

Can a backend emit implementation block or await?

DeepSeek Harness: no. emit must be a non-blocking enqueue because the coordinator calls it synchronously from the session/event hot path or on-demand capture. Thrown errors are contained and logged; they never reach the agent loop.

Does telemetry guarantee no loss and no duplicates?

DeepSeek Harness: no. Delivery is best-effort: the cursor means handed off, not delivered. Crashes or reload windows can lose records, and replay or retry can duplicate them. Deduplicate ledger records by session ID, format version, and event seq; ops duplicates are tolerated.

Related Terms

SessionTelemetryRecord
SessionTelemetryRecord is one logical record handed to a telemetry backend, containing optional source event, ledger or ops channel, time, severity, minimal identity attributes, and the full payload.— DeepSeek Harness reference - Telemetry
ledger
ledger is the telemetry channel that mirrors session log events one-to-one and carries session.id, event.type, event.seq identity so receivers can deduplicate.— DeepSeek Harness reference - Telemetry
ops
ops is the telemetry channel for operational signals such as agent-error and shutdown. It intentionally omits seq identity and tolerates duplicates.— DeepSeek Harness reference - Telemetry
handoff cursor
A handoff cursor records what the capture service has handed to the backend. It does not mean delivered; re-adopting the same object continues after the cursor, and crash windows can lose or duplicate records.— DeepSeek Harness reference - Telemetry

Sources