dsh-image-count-guard

DSH PLUGIN工具与能力

仓库 macilydots/dsh-image-count-guard

工具与能力 未标注验证等级 安全审查:未标注 可信度:未标注 可安装插件

DSH 插件:当上游网关按图片张数拒绝请求时,自动把最旧的图片卸载为占位文本并重试,救回卡死的视觉模型会话。

一句话选型结论

按资料字段整理

dsh-image-count-guard 是工具与能力类的 DSH 可安装插件,未做沙盒验证,暂无安全审查结论,列出 4 项功能,没有现成安装命令,需要按仓库 README 接入。验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么;涉及密钥或系统权限的,建议先在隔离环境试装。

分类工具与能力 收录类型可安装插件 验证等级未标注验证等级 安全审查未标注
验证等级 UNKNOWN 未标注验证等级
GitHub 星标 0 复刻 0 · 未关闭 issue 0
最近更新 2026-10-10 创建于 2026-10-07
README 6.5 KB 正文体量,越大说明说明书写得越细

安装

可安装插件
在 DSH 里执行,装完用 dsh plugin list 确认已挂上;标了 L4 / L5 的命令已在沙盒里真实跑通
  1. 1
    确认版本与运行环境

    仓库没有标注兼容版本与 Node.js 要求,先确认你的 DSH 版本能装,再继续。

  2. 2
    执行安装命令

    在 DSH 里执行上面的命令;多包仓库要注意区分具体子包名,别装错包。

  3. 3
    确认已挂载

    用 dsh plugin list 查看列表里是否出现这个插件,出现即挂载成功。

  4. 4
    试跑并检查权限

    加载后跑一个最小用例,确认它能正常工作;同时看它申请了哪些文件、命令或网络权限。

兼容 DSH 版本未标注版本不匹配时安装会报错
Node.js 要求未标注来自仓库 package.json 的 engines 字段
前置依赖无需要同时安装的同级依赖
npm 包名未发布到 npm可用 npm view 查看包信息

能做什么

4 项功能
字段来自项目仓库与公开索引,中文说明由本站标注

dsh-image-count-guard:为 DeepSeek Harness 视觉会话兜底图片张数超限

  • 按图片张数触发卸载重试
  • 复用官方 image/offload 投影
  • 可配置上限与安全余量
  • 附带会话图片诊断脚本

上游标签

deepseek-harnessdsh-pluginimagevision

验证等级与安全审查

未标注验证等级
自动化流程结论,不是人工审核
验证等级未标注验证等级上游未给出验证结论,安装前请自行确认
安全审查未标注静态分析结论,未标注不代表已通过审查
仓库健康度未标注按仓库活跃度与最近更新时间给出
可信度未标注综合仓库活跃度与验证结果

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 列出了 4 项功能,能直接看出它解决什么问题。

先想清楚的地方

  • 安全审查还没结论,装之前先看仓库改了什么、要什么权限。
  • 没有现成安装命令,要按仓库 README 手动接入。
  • 验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么。

更适合

  • 需要在工具与能力场景里给 DSH 补能力的人。
  • 能接受在本地装依赖、愿意自己确认权限的人。

不太适合

  • 只使用 DSH 官方内置能力、不接受第三方插件的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
插件验证等级安全审查星标兼容版本安装命令
dsh-image-count-guard当前 未做沙盒验证 未标注 0 未标注 无
loopx 未做沙盒验证 未标注 6,233 未标注 无
dsh-startup-screen 未做沙盒验证 未标注 633 未标注 有
minara-skills L4 · 沙盒安装通过 中风险 360 未标注 有
dsh-blender-plugin 未做沙盒验证 未标注 211 未标注 无
tokenledger L5 · 运行验证通过 低风险 204 0.2.0-rc.2 等 11 个 有

仓库档案

工具与能力
字段来自项目仓库与公开索引,中文说明由本站标注
作者 / 维护方macilydots仓库 dsh-image-count-guard · 默认分支 main
分类工具与能力tools
收录类型可安装插件声明了 dsh.bundle、可用 dsh plugin add 安装的条目
开发语言JavaScript仓库主语言
许可证MIT商用或二次分发前请确认条款原文
星标 / 复刻 / issue0 / 0 / 0收录时的数值,非实时
创建 / 更新2026-10-07 · 2026-10-10最后推送 2026-10-10
本站收录2026-10-10首次进入本站目录的时间

README 全文

6.5 KB
作者原文,中文版优先;只做安全转义,不改内容

dsh-image-count-guard

English | 简体中文

A fallback plugin for DSH visual-model sessions that hit an image-count limit.

The problem it solves

An upstream gateway may enforce a hard cap on the number of images in a single request (measured on OpenCode Go: 20 images). The dsh-llm-pi-ai adapter, however, budgets images purely by base64 bytes (maxRequestImageBytes, 20 MiB by default), with no budget for image count, so:

  1. images accumulate in the session history until there are 36 of them (11.79 MiB raw / roughly 15.72 MiB as base64);
  2. after switching to a visual model (opencode-go/deepseek-v4.1-flash), 15.72 MiB < 20 MiB, so the adapter considers the request fine and sends all 36 images inline;
  3. the gateway replies 400 INVALID_REQUEST: a request may include at most 20 images;
  4. the official dsh-compaction-image-offload only recognizes IMAGE_OFFLOAD_REQUIRED, not this error code → the step fails;
  5. from then on every step of that session fails (sending "continue" again makes no difference) and the session is completely stuck.

What it does

It hooks into the agent/request-error waterfall:

  • when the failure text matches an image-count limit (at most N images / maximum of N images / no more than N images / up to N images / too many images, and the word "image" must appear);
  • it counts the total number of image occurrences on the current surface that are not yet omitted, total;
  • it records an image/offload decision, picking the oldest max(1, total - (limit - safetyMargin)) occurrences in model request order;
  • it returns { kind: &#x27;retry&#x27; }, and the step is retried (without spending the provider retry budget).

It reuses the same official image/offload projection, so placeholder text, replay, token accounting, and KV cache semantics all match official offloading. Every retry omits at least one occurrence, so recovery always terminates: either the request fits, or there is nothing left to omit and the original failure stays terminal (no infinite retries).

Relationship to the official image-offload

Case Handled by
The adapter rejects on its own byte budget (IMAGE_OFFLOAD_REQUIRED) Official dsh-compaction-image-offload
The upstream gateway rejects on image count (INVALID_REQUEST, etc.) This plugin

Both write the same kind of image/offload event, so they do not conflict. This plugin does not depend on the official handler's registration order, only on the image/offload projection being registered; if the projection is not registered (the official plugin is disabled), append throws, and the plugin catches that and hands the failure back downstream without side effects.

Installation

# run this from the cloned repository directory
pwsh -File .\install.ps1                 # install into the desktop profile (default)
pwsh -File .\install.ps1 -Profile web    # install into the given profile

The script edits three places in the profile by hand (dependencies / dsh.profile.bundles / pnpm-lock.yaml) and copies a duplicate of node_modules (without running pnpm install, to avoid incidentally upgrading other ^ dependencies); before editing, it backs everything up to .backup\\ (keeping only the 5 most recent).

All insertion points use structural anchors (&quot;dependencies&quot;: {, &quot;bundles&quot;: [, and the packages: / snapshots: section headers in the lock file), so they do not depend on whether other plugins are present, nor on any machine-specific path. The DSH home directory comes from $env:DSH_HOME, falling back to ~\.dsh.

You must restart DSH after installing.

Uninstall:

pwsh -File .\install.ps1 -Uninstall

Configuration (optional)

No configuration is needed by default. When you do need it, override by id in the profile's cordis.patch.yml:

- id: image-count-guard
config:
defaultImageLimit: 20      # assumed limit when the error text gives no number
safetyMargin: 2            # margin kept after offloading, so adding one more image does not fail again
maxOffloadPerRetry: 80     # maximum number of images omitted per retry

Verification

  1. Static: at the end, install.ps1 prints four checks: deps / bundles / node_modules / lock.
  2. Offline unit tests: node --test test/guard.test.mjs (11 cases covering matching, selection, the upper bound on convergence rounds, and the no-side-effect boundary).
  3. Assembly check (optional): mount the plugin into a temporary profile and run --dump-config to confirm the entry is assembled. Measured output contains # == dsh-image-count-guard / - id: image-count-guard, exit code 0.
  4. Live: after restarting, open the stuck session and send "continue". With the plugin active, that session records an image/offload event, and the next request succeeds.

Diagnostics tool

# single session: image count, omitted count, raw bytes, base64 estimate, average image size
node tools\session-image-report.mjs `
&quot;$env:USERPROFILE\.dsh\sessions\\session-\session.v4.jsonl.zstd&quot;

# scan recent sessions, sorted by image count
node tools\session-image-report.mjs &quot;$env:USERPROFILE\.dsh\sessions&quot; --limit 20

Measured on two kinds of session:

Session Images base64 payload Average image Would a byte-only budget stop it?
session-c312057f 36 15.72 MiB 335 KiB No (below the 20 MiB default budget; not a single image gets offloaded)
session-b15b99cb 25 1.52 MiB 47 KiB No (the bytes are too small, so even a tightened budget is hard to align with image count)

The second row is why this plugin exists: an image count over the limit has nothing to do with the byte budget, and only count-based handling stops it.

Known limits

  • Offloading cannot be undone: an omitted image appears as placeholder text from then on (including a read-only path to the attachment), which is inherent to the official image/offload semantics. If you need to see the image again, have the model call read_image once more.
  • The error text must be in English and contain both image and a quantity phrase; when a new gateway wording appears, add an entry to LIMIT_PATTERNS in src/index.js.
  • After changing src/index.js you must re-run install.ps1 to sync the node_modules copy, otherwise DSH keeps loading the old code.

常见问题

7 问
答案由本站依据条目字段整理,不引用上游原文
dsh-image-count-guard 怎么安装?

本站没有抓到该条目的安装命令,请到仓库主页确认安装方式;这类条目多数是生态应用或尚未发布安装包的项目。

dsh-image-count-guard 的验证等级是什么意思?

未标注验证等级。上游未给出验证结论,安装前请自行确认

dsh-image-count-guard 安全吗?

未标注。

dsh-image-count-guard 装之前要先确认什么?

先看它会读写哪些文件、执行哪些命令、连接哪些网络地址;验证等级只说明装得上、跑得起来,不等于安全。涉及密钥或系统权限的,建议先在隔离环境试装。

dsh-image-count-guard 用的是什么许可证?

上游标注为 MIT。商用或二次分发前请到仓库确认许可证原文。

dsh-image-count-guard 有哪些功能?

按图片张数触发卸载重试、复用官方 image/offload 投影、可配置上限与安全余量、附带会话图片诊断脚本。

这条记录的数据可靠吗?

本站按仓库名去重后合并整理,字段以作者仓库与 npm 元数据为准;安装命令、仓库地址与 README 保持原文,带 L4 / L5 标记的安装命令已在隔离沙盒里真实跑通。

工具与能力
按星标排序,可作替代方案

loopx

loopx

LoopX 是面向长周期 Agent 的本地优先控制平面,作为 DSH plugin 为 DeepSeek Harness 提供持久目标、证

未标注验证等级 6,233 星

dsh-startup-screen

dsh-startup-screen

DeepSeek Harness 的启动界面与启动动画插件。

未标注验证等级 633 星

dsh-blender-plugin

dsh-blender-plugin

让 AI 模型通过直连 TCP 通道实时驱动 Blender 的 DSH plugin:15 个工具覆盖视口取帧、任意角度渲染、内循环搜索、

未标注验证等级 211 星

tokenledger

TokenLedger

TokenLedger 为 DeepSeek Harness 提供零配置的 Token 用量记账,自动归属到实际服务请求的中转站,无需凭据即

L5 · 运行验证通过 204 星

deepseek-harness-jev

deepseek-harness-jev

把 TypeSafe Jev 接入 DeepSeek Harness 作为 System One 决策层,为技能与文件选择、任务监督、纠偏和

未标注验证等级 203 星

macilydots 的其它插件

5 个

插件的元信息来自作者仓库;分类、验证等级与安全结论的中文说明为中文整理,最近核验 —。