前言¶
在 DSH 裏,智能體經常會在一個 git 工作區裏連續修改多個文件。如果每次審查都看全量 diff,容易重複確認已經看過的改動,也會把注意力分散到尚未發生的變更上。DSH 的擴展方式強調「一切皆插件」,第三方插件可以圍繞宿主能力做增量增強;社區目錄是獨立站點,與 DeepSeek、幻方沒有官方從屬關係。
下面介紹 wuxiangru915/dsh-review-loop。它是一個面向 DeepSeek Harness 的增量 diff reviewer,用來把“審查 agent 的改動”變成一個小循環:批准當前一批改動,記錄 checkpoint;下一次審查只顯示 checkpoint 之後的變更。
插件定位¶
wuxiangru915/dsh-review-loop 是一個純 bundle 插件,使用 dsh.bundle patch layer 接入,不修改 DeepSeek Harness 的核心代碼。它提供兩個入口:Web UI 的 review panel 和 /review 命令,共享同一套 checkpoint 邏輯。
這個插件使用 MIT 許可證,倉庫由 wuxiangru915 維護。
核心能力¶
1、增量審查:批准時會快照當前工作樹爲 checkpoint;下一次審查只 diff checkpoint -> current。
2、兩個入口:Web UI review panel(2 秒輪詢)和 /review 命令。
3、反饋閉環:批准時可以攜帶 comment,並通過 agent.inject() 作爲用戶消息注入給 agent。
4、直接讀取 git:不解析工具調用,因此能反映任何 on-disk change。
5、checkpoint 持久化:寫入 $DSH_HOME/review-loop/<workspace-hash>.json,使用原子寫,不污染 workspace 的 git status。
6、零核心修改:作爲 bundle 插件運行,不改動宿主核心。
安裝與啓用¶
運行環境需要:
- DeepSeek Harness >= 0.1.0-rc.5 (Cordis 4.x)
- 一個 git 倉庫(硬前提)
- Node.js >= 22
git-source 安裝:
dsh plugin --profile web add github:wuxiangru915/dsh-review-loop
這一步會從 git 倉庫安裝插件。倉庫附帶預構建的 lib/ 產物,因此這條安裝方式不需要用戶機器執行構建。
安裝後執行一次:
1、重啓 web server。
2、硬刷新頁面。
本地開發安裝:
pnpm install && pnpm build
dsh plugin --profile web add /path/to/dsh-review-loop
本地開發要求 ../deepseek-harness 同級檢出。部分 @deepseek-ai/dsh-* 包未完全發佈到 npm,devDependencies 會鏈接到 workspace;如果檢出路徑不同,需要調整 package.json 中的鏈接路徑。
典型用法¶
Web UI¶
在一個 workspace 是 git 倉庫的 DSH 會話中,composer 上方會出現 review panel。可以在這裏打開審查、查看 diff、填寫 feedback,並點擊 Approve & checkpoint。
面板提供文件列表、可切換的 diff 展示和反饋輸入。批准後記錄 checkpoint;如果之後文件再次被修改,它會重新進入待審列表。
命令¶
/review
顯示自上次 checkpoint 起的增量變更;如果沒有 checkpoint,則顯示 vs HEAD 的完整變更。
/review all
顯示相對 HEAD 的完整工作樹變更,忽略 checkpoint。
/review approve
記錄 checkpoint。
/review approve <comment>
記錄 checkpoint,並把 comment 注入給 agent。
適用場景與注意¶
適合在 git 倉庫中使用 DSH Web 會話,並希望按批審查 agent 改動的場景。它適合把長任務拆成“審查、反饋、繼續執行”的小步循環。
注意:
- 插件依賴 git 倉庫;沒有 git 倉庫時無法作爲審查對象。
- checkpoint 文件寫在
$DSH_HOME/review-loop/<workspace-hash>.json,不會進入 workspace 的git status。 - npm 發佈(
@dsh-plugin/dsh-review-loop)在 Roadmap 中尚未完成,當前安裝以文檔給出的 git-source 和本地路徑方式爲主。 - 插件會以當前 dsh 進程權限運行。安裝前應檢查源碼與許可證,確認其讀取 git、寫入 checkpoint 和注入消息的行爲符合你的環境要求。
參考鏈接¶
- 目錄頁:https://www.skillhub.cn/plugins/wuxiangru915/dsh-review-loop
- GitHub:https://github.com/wuxiangru915/dsh-review-loop