Back to directory

user-request-guard

Maintenance: Active

diegoshan/user-request-guard

DeepSeek Harness plugin that checks your original request before each step in a long conversation to reduce hallucinations during multi-turn work.

View on GitHub
$ dsh plugin add user-request-guard

Install

dsh has no central install command — add this plugin’s entry (documented in its README) to your profile or patch config, then restart.

How installs work

0

stars

0

forks

JavaScript

Language

2026-11-20

Created

2026-11-20

Last push

README

user-request-guard

核对「用户需求」是否真的出现在本会话的用户消息里,防止把压缩摘要或模型自述当成用户请求后直接改代码。

工具

工具 作用
user_request_verify 把一段需求文本与本会话真实用户消息比对,返回原话/时间/seq;无匹配时提示先向用户确认。
user_requests_recent 列出本会话最近的真实用户消息(默认 8 条)。

插件还会注册一段 systemPrompt 提示:只出现在摘要/笔记/任务列表里的需求,先调用核对工具,再决定是否动手。

数据来源

优先 ctx.sessionQuery.observeSession(sessionId).events;不可用时回退读取 $DSH_HOME/sessions/** 下最新的 session.vN.jsonl(.zstd) 日志。

只统计 source.kind === "user" 的消息,工具结果、插件注入与系统提醒都会被排除。

安装

在 DeepSeek Harness 的插件管理中用「安装本地插件」选择本目录(该目录位于 ~/.dsh/local-plugins/user-request-guard),或让 Agent 通过 plugin_manager 安装。

限制

  • 文本相似度匹配(LCS 比例,阈值 0.55),不是语义匹配;改写幅度大时可能判否,结果会附带最接近的几条供判断。
  • zstd 回退路径需要运行时提供 zlib.zstdDecompressSync。

DSH Plugins is an independent community directory of DeepSeek Harness plugins. Not affiliated with or endorsed by DeepSeek. Third-party plugins are not security-audited — review the source before installing.

New DeepSeek Harness plugins, weekly. No spam.