exynos967/dsh-request-error-dump ↗★ 0
dsh-request-error-dump
DSH plugin: when an upstream model API request fails, dump the exact raw request body and the raw upstream error response to disk. 适合需要排查和定位大模型 API 报错原因,需保存完整请求与响应的开发者。
インストール
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:exynos967/dsh-request-error-dumpドキュメント
README 全文を読む ↗配置
所有配置项都有可用默认值,不配也能跑。写在 profile 的 cordis.patch.yml 里覆盖该行:
- id: request-error-dump
config:
outDir: ~/.dsh/request-error-dump
maxFiles: 50
maxCaptureBytes: 0
bodyFormat: both
redactHeaders: ['authorization', 'api-key', 'cookie']
flushDelayMs: 1500
ignoreAborted: true
modelRequestsOnly: true
excludeUrls: ['/user/balance']
log: true
| 选项 | 默认值 | 说明 |
|---|---|---|
outDir | $DSH_HOME/request-error-dump(即 ~/.dsh/request-error-dump) | 落盘目录,支持 ~ |
maxFiles | 50 | 保留最新的 N 个 dump,更早的自动清理;0 表示不清理 |
maxCaptureBytes | 0 | 单个体积上限(字节);默认 0 = 不截断,保持完整。截断时会标记 truncated: true 并跳过 json 视图 |
bodyFormat | both | raw 只留原文 / parsed 只留解析结果 / both 都留 |
redactHeaders | authorization、proxy-authorization、api-key、x-api-key、x-auth-token、x-goog-api-key、cookie、set-cookie | 要脱敏的请求头/响应头名;设为 [] 即完全原样 |
flushDelayMs | 1500 | 延迟落盘窗口,用来等 agent/request-error 补上 DSH 上下文;0 表示立即写、不等上下文 |
modelRequestsOnly | true | 只记录模型请求。true 时:被 agent/request-error 认领的,或请求结构像模型调用的(POST + body 带 model/modelId,或 URL 命中 Gemini/Bedrock 形态)才写;其余在窗口结束时丢弃。设 false 恢复"抓所有失败的 HTTP" |
excludeUrls | ['/user/balance'] | 正则列表,对 "METHOD URL" 求值,命中即不记录(在模型门禁之前生效)。设为 [] 取消默认排除 |
ignoreAborted | true | 用户主动取消(AbortError)不记录 |
log | true | 每次落盘在 host 日志里打一行提示 |