abinzhao/dsh-request-flight-recorder ↗★ 0
dsh-request-flight-recorder
Content-free request and stream diagnostics for DeepSeek Harness
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:abinzhao/dsh-request-flight-recorder说明文档
阅读完整 README ↗dsh-request-flight-recorder
面向 DeepSeek Harness 的无正文模型请求诊断插件。插件通过 Cordis 观察官方 Agent Loop 请求,关联请求组装与流式结束状态,并在有界内存中保留飞行记录, 用于定位模型请求结构和流式生命周期问题。
能力
- 精确记录 Session、Turn、Step 和请求 Attempt 坐标。
- 记录 Provider、Model、生成参数、消息结构计数和工具 Schema 大小。
- 记录 Prompt Section、Context、Tool 和变量名称,但不记录对应值。
- 记录首个 Chunk 延迟、总耗时、Token Usage、Finish Reason 和结构化失败状态。
- 提供进程健康状态、保留记录组合查询和确定性的无正文 Diff。
- 当 Profile 提供 Commands 服务时,注册可选的官方
/flight人类命令。
记录器不会注册模型 Tool、Skill、Prompt Section 或 Context Provider,也不会 改变 Agent Loop 或 Prompt 语义。
兼容性
版本 1.0.0 面向 DeepSeek Harness 0.1.0-rc.6、Cordis ^4.0.1 和
Node.js ^22.19.0 || ^24.0.0。DSH RC 版本可能修改扩展契约,请使用与目标
DSH 版本匹配的插件版本。
安装
npm
通过 npm 安装时,使用官方 DSH 插件命令将包添加到 Profile:
dsh plugin --profile web add dsh-request-flight-recorder
GitHub Commit
从公开 GitHub 仓库安装时,应固定不可变 Commit,不要依赖持续移动的分支:
dsh plugin --profile web add "github:abinzhao/dsh-request-flight-recorder#"
本地仓库
在当前仓库中运行:
dsh plugin --profile web add .
也可以安装打包产物:
pnpm pack
dsh plugin --profile web add ./dsh-request-flight-recorder-1.0.0.tgz
验证 Profile 合成结果:
dsh --profile web --dump-config
输出中应包含 request-flight-recorder 行。包内 Bundle 会添加以下默认配置:
- insert:
- id: request-flight-recorder
name: dsh-request-flight-recorder
config:
capacity: 128
capacity 必须是正安全整数,用于限制当前进程保留的记录数量。健康计数独立于
记录淘汰,不会随 Ring Buffer 淘汰而回退。
人类命令
当当前 Profile 包含官方 Commands 服务时,可以使用:
/flight
/flight latest
/flight list
/flight list 20
/flight show
/flight diff
/flight diff
/flight health
/flight 和 /flight latest 显示当前 Session 最新的保留记录;/flight list
默认返回 10 行,显式上限必须在 1 到 20 之间。无参数 Diff 比较最新两条记录。
ID 仅在当前 Session 内按唯一前缀解析;缺失或存在歧义时会拒绝查询。输出为
纯文本,最多 4,096 个 UTF-16 code unit。
示例输出:
flight abcdef12
turn 1 · step 1 · attempt 1
model deepseek/deepseek-chat
request 1 message · 10 system chars · 1 tool
tools read_file(2)
prompt sections identity · contexts workspace · variables cwd
outcome finished:stop · ttft 5ms · total 20ms · tokens 12 in / 4 out