Preface

During the development and debugging of DeepSeek Harness, it is necessary to accurately track the complete lifecycle of a request, from initiation to completion. Traditional logging often contains large amounts of sensitive text and is not suitable for direct diagnostics. This section introduces a plugin that records the precise coordinates and structured metadata of requests without retaining prompts or response content.

What It Is

dsh-request-flight-recorder is a plugin maintained by abinzhao and belongs to the admin-security category. It is a Privacy-safe request flight recorder. By observing official Agent Loop requests, it correlates request assembly with streaming completion and maintains a bounded in-memory flight recording history.

Core Features

The plugin provides the following capabilities:

  • Precise coordinates: Records the precise coordinates of Session, Turn, Step, and request-attempt.
  • Structured metadata: Includes Provider, model, generation settings, structural message counts, and tool schema sizes.
  • Structured names: Records the names of Prompt section, context, tool, and variable, but not their concrete values.
  • Performance and status: Records Time to first chunk, total duration, token usage, finish reason, and structured failure status.
  • Process health: Provides Process health counters, retained-record queries, and deterministic content-free diffing.
  • Human commands: Provides the optional official /flight command when the Profile provides a Commands service.

Installation and Enablement

Install it using the official DSH plugin command:

dsh plugin --profile web add dsh-request-flight-recorder

After installation, the plugin automatically adds the default configuration:

- insert:
    - id: request-flight-recorder
      name: dsh-request-flight-recorder
      config:
        capacity: 128
        slowFirstChunkMs: 1000
        slowTotalMs: 2000

Note: capacity limits the number of records retained in the current process; slowFirstChunkMs and slowTotalMs are used to classify diagnostic requests and do not change request execution semantics.

Typical Usage

When the current Profile includes a Commands service, the following commands can be used:

  • View the latest record: /flight or /flight latest
  • List records: /flight list (default 10) or /flight list [limit] (1-20)
  • Filter by status:
    • Failed records: /flight list failed [limit]
    • Slow requests: /flight list slow [limit]
    • Truncated records: /flight list truncated [limit]
  • View details: /flight show <request-id-prefix>
  • Compare differences: /flight diff or /flight diff <from-prefix> <to-prefix>
  • Health check: /flight health
  • Explanation: /flight explain <request-id-prefix>
  • Statistics: /flight stats

Note: The ID is resolved to a unique prefix within the current Session. Output is plain text and limited to 4,096 UTF-16 code units.

Applicable Scenarios and Notes

  • Privacy boundary: The plugin does not retain prompt text, message content, tool arguments, tool results, or prompt variable values. It retains only structured names, counts, and timing information. Provider details in upstream exception messages are also not retained.
  • No persistence: The plugin does not write records to disk. The Ring Buffer is cleared on process exit, HMR disposal, or service disposal.
  • Runtime environment: The plugin runs in the same Node.js process as other Profile plugins and is not a security boundary.
  • No semantic changes: The plugin does not register model Tool, Skill, prompt section, or context provider, and does not change Agent Loop or prompt semantics.

Short Conclusion

The plugin helps developers locate issues using structured data while strictly adhering to privacy boundaries. For more details and source code, refer to the plugin directory or GitHub repository.