D
dsh-cache-miss
v0.1.3 · 0 天前发布
DSH web plugin: a yellow one-line cache-miss notice under the first assistant reply of each turn, when that turn's first request rebuilt the prompt cache.
README
dsh-cache-miss
DSH 网页插件:在一轮的第一条 assistant 回复正下方,以一条黄色单行提示该轮首次请求的提示缓存未命中(prompt cache miss)。
功能
一轮 Agent 对话是 assistant -> tool -> assistant -> tool ...。该轮第一次模型调用正是供应商提示缓存可能已过期、需要整段重新 prefill(重建缓存)的时机;同轮后续调用往往命中刚重建的缓存。DSH 自带的 token/缓存统计在输入框下方,产物文件行在轮尾,都无法在 miss 真正发生的位置就地提示。
本插件在轮首第一条 assistant 回复正下方,仅当该请求确为缓存未命中时渲染一条黄色单行:
Cache miss after 3m idle: 182k tokens re-billed · 0.8k cached · ttft 2.1s ↑
!缓存未命中提示
idle —— 距上一轮结束的空闲时长。re-billed —— 该请求未命中缓存的输入 token 数(缩写为 k)。cached —— 同一 prefill 中命中缓存的部分(provider 回报时显示),让“重算量 vs 命中量”一目了然。ttft —— 首 token 时延(取自 assistant timing,可用时显示);上箭头示意重建 prefill 通常更慢。纯前端展示:不写入 session log,不修改 DSH 源码,也不占用 turn-tail 链,因此不会与产物文件行冲突(例如 DSH-better-sidebar)。
miss 判定
`inputT
版本兼容矩阵
| DSH 版本 | 状态 | 说明 |
|---|---|---|
dsh@0.1.0-rc.6 | ✅ 兼容 | cordis patch ✅ |
dsh@0.1.0 | ✅ 兼容 | 标准 patch ✅ |
dsh@0.2.0 | ⚠️ 待验证 | 待实测(API 可能在变) |
dsh@0.3.0+ | ❓ 未知 | 尚未发布 |
💡 兼容矩阵每周末自动跑实测,欢迎 PR 修正
元数据
- License
- MIT
- npm
- dsh-cache-miss
- Repo
- git+https://github.com/wefio/dsh-cache-miss.git
- Engines
{"node":"^22.19.0 || >=24.0.0"}- Weekly DL
- 0
- Monthly DL
- 0
- dsh.bundle
{"bundle":{"patch":"./cordis.patch.yml"},"client":{"inject":["@deepseek-ai/dsh-client-runtime"],"platform":"web"}}