Repository navigation
v0.9.0-rc.1 — 适配 harness 0.1.6:adapter 侧图片 offload + 端面/档位收敛 (preview)
Pre-releasev0.9.0-rc.1 — 适配 harness 0.1.6:adapter 侧图片 offload + 端面/档位收敛
Pre-release(预览版)。本版是兼容性版本:DeepSeek Harness 0.1.6-alpha.1 把图片
卸载(image offload)的职责从 runtime 挪进了 adapter,本插件原来两边都没实现,于是
「已经为塞进请求上限而丢掉的图片」会被重新内联、超限请求也不会走 harness 的卸载回路。
同时补上两处「卡上能填、请求不生效」的缺口。下限抬到 0.1.6,见文末「升级」。
修复
- 图片 offload 契约(0.1.6 新增的硬契约):
- 已标记
offloaded的图片永远按占位文本发送,在所有读盘之前就投影好。丢图是
harness 的持久会话决定(dsh-compaction-image-offload会把它记进会话历史),
路由无权撤销——原来的行为等于把已经丢掉的字节又塞了回去。 - 超预算时抛
IMAGE_OFFLOAD_REQUIRED(带offloadImages),而不是自己丢图。
harness 据此记录选择并重试该步;自己丢图则没有任何记录,下一次请求又会把图带回来。 - 判定一定发生在发请求之前,且不读盘:账目用 durable ref 自带的
bytes。
- 已标记
- peer 区间修正:6 个
@deepseek-ai/dsh-*从^0.1.5-rc.1抬到^0.1.6-alpha.1。
旧区间在 semver 的预发布规则下根本不匹配0.1.6-alpha.1(区间只有在同一 tuple 上
才接受预发布),所以新装会把dsh-llm解析成0.1.5-rc.x,而代码现在 import 的是
0.1.6 才有的 API。 - 设置段被拒不再只有日志:被拒的段会被整段丢弃、adapter 沿用组合层默认值,于是卡片
的勾选数与实际路由各说各话且用户看不到原因。models/known/models/refresh的
成功回包现在附带configError,卡片在模型列表上方显示本地化标题 + 宿主原文。
新功能
-
maxRequestImageBytes(默认 64 MiB):单请求内联图片总量上限,按进请求体的
base64 字节计。上游没公布请求体上限,所以这是部署取值——默认远高于日常截图流量,
代理有更小的 body cap 就往下调。 -
端面与档位一起生效:宿主把
surface与efforts当成一个组合校验,所以卡片
改端面时在同一次设置写入里就把档位收敛好(新增setModelCapFields原子多字段写):- 新端面能带走的档位保留,带不走的去掉,并明确提示去掉了哪些;
- 切到 messages 这类没有档位词汇的端面 → 整体清空;
- 交回「跟随默认」→ 按该模型自身的默认档位表收敛(
defaultEfforts由宿主给出:
未归类模型跟随 chat 端面、但本身不提供任何档位,所以诚实的答案是档位列表而不是端面)。
分两次提交这两个字段,正是当初能写出
surface: responses+ chat 才有的max这种
被拒组合的原因。
验证
node test/smoke.mjs:55 项,54 pass + 1 skip(无 key 的活探针)。本版新增:
maxRequestImageBytes的默认/校验/传导;RPCconfigError的三种情形;offloaded 图片
不读盘、占位文本进请求体;超预算在 dispatch 之前抛错且offloadImages计数正确;
卡片端面收敛的三组断言(部分保留 / 无词汇清空 / 跟随默认收敛 / 完全可容纳时不动),
并逐字比对落盘的modelCaps载荷与写入次数。node test/host-compat.mjs(新增测试入口):8 项 8 pass,0 skip。它从
node_modules直接 import 真实的@deepseek-ai/dsh-llm/dsh-invariants/cordis,
起真 cordis app 走真llm服务与真流语法不变量(只打桩connection/webServer/
settings/credentials/attachments/fs)。smoke.mjs把宿主面全打桩,看不到
宿主收紧契约——0.1.6 这次搬迁正是只有这一层能发现。两条缺陷断言先以{ skip }写就,
修复后去掉 skip 即成为验收测试。npm run build:client:lib/client.js与src/client/*同步(测试里有断言守卫)。- 真机 GUI 核对(隔离 DSH_HOME,未改动用户配置):把
deepseek-flash的端面从
responses 切成 chat —— 档位由minimal/low/medium/high/xhigh自动收敛为
low/medium/high,提示「已去掉 minimal / xhigh」,落盘为合法组合,横幅不出现。 - 真机宿主核对:
/zen-go-rpc的models/known、usage/summary在 0.1.6-alpha.1 上
均为 200;models/known能回报被拒段的原文原因。
已知 / 未覆盖
- messages 端面:持久化的 tool-call
arguments不是合法 JSON 时仍抛
PROVIDER_PROTOCOL_ERROR(与 #3 同类的「一条历史打死整会话」)。它有现存测试刻意断言
(宁可响也不降级),本版未改动。 - 未实现
imageRequestPricing:图片 token 计入走 token meter 的启发式估值(不报错,
只是不够准)。上游未公布视觉计费口径。 - 本插件读的是原始图片字节,不经过
attachments.readImageRequest的请求版降采样,因此
maxRequestImageBytes是唯一的请求体保护;harness 侧imagePixelBudget那类按像素
生成的请求版本本插件不参与。 - 上游网关的请求体上限未公布,
maxRequestImageBytes的默认值是部署取值而非实测值。 - 目录里没有
.github/,没有 CI;门禁就是这两个测试入口 + 构建脚本的语法检查。
升级
dsh plugin --profile web add github xia-sc/dsh-opencode-go
# 重启 dsh web(宿主侧改动必须重启才生效)- 运行环境下限抬到 DeepSeek Harness
0.1.6-alpha.1。装在 0.1.5 系宿主上时,pnpm
会报 peer 警告(本插件 import 了 0.1.6 才有的projectOffloadedImages/
requiredImageOffload/IMAGE_OFFLOAD_REQUIRED),所以不要降级宿主。 - 想给图片留更大余量(或让代理更早拦截),在
llm-opencode-go段设
maxRequestImageBytes;默认 64 MiB。 - 如果你的
settings.yaml里modelCaps的surface与efforts不匹配(例如
surface: responses配了 chat 才有的max),该段会被整段拒绝:现在卡片会直接告诉你
原因,点开该行「参数」改一次端面即自动收敛。
v0.9.0-rc.1 — harness 0.1.6 compatibility: adapter-owned image offload + surface/level conformance
Pre-release. This is a compatibility release: DeepSeek Harness 0.1.6-alpha.1 moved
image offloading out of the runtime and into the adapter. This plugin implemented neither
half, so occurrences the harness had already dropped for size travelled as bytes again, and
an over-budget request never took the harness's offload-and-retry path. Two
"the card accepts it, the request ignores it" gaps are closed as well. The floor rises to
0.1.6 — see Upgrade at the end.
Fixes
- The image-offload contract (new in 0.1.6, and mandatory):
- Occurrences marked
offloadedalways travel as placeholder text, projected before
any read. Dropping images is the harness's durable session decision
(dsh-compaction-image-offloadrecords it in the transcript); a route has no business
reversing it by re-inlining the bytes. - An over-budget request fails with
IMAGE_OFFLOAD_REQUIRED(plusoffloadImages)
instead of dropping images locally. The harness records that selection and retries the
step; a local drop records nothing, so the next request carries the images again. - The budget is decided before dispatch and without I/O: accounting uses the durable
ref's ownbytes.
- Occurrences marked
- Peer range corrected: all six
@deepseek-ai/dsh-*peers move from^0.1.5-rc.1to
^0.1.6-alpha.1. The old range never matches0.1.6-alpha.1under semver's prerelease
rule (a range admits a prerelease only on its own tuple), so a fresh install resolved
dsh-llm0.1.5-rc.x while the code imports 0.1.6-only APIs. - A refused settings section is no longer log-only: a rejected section is dropped whole
and the adapter keeps the composition default, leaving the card's selection count and the
request path each telling their own story, with no visible reason.models/knownand
models/refreshnow carryconfigError, and the card shows it above the model rows.
Features
-
maxRequestImageBytes(64 MiB by default): the inline image budget for one request,
counted in the base64 bytes the body carries. The operator publishes no request-size
limit, so this is a deployment value — the default sits far above ordinary screenshot
traffic; lower it toward a proxy's body cap. -
Surface and levels take effect together: the host validates
surfaceandefforts
as a pair, so the card conforms the levels in the same settings write that changes
the surface (new atomic multi-fieldsetModelCapFields):- levels the new surface can carry are kept, the rest are dropped and named in a notice;
- a surface with no level vocabulary (messages) clears them;
- handing the choice back to
defaultreconciles against that model's own default level
list (defaultEfforts, supplied by the host: an unclassified id follows the chat
surface yet offers no levels, so the honest answer is the level list, not the surface).
Committing the two fields apart is exactly what allowed the refused
surface: responses+ chat-onlymaxpair in the first place.
Verification
node test/smoke.mjs: 55 tests, 54 pass + 1 skip (the key-gated live probe). New
coverage:maxRequestImageBytesdefaults/validation/plumbing; the threeconfigError
cases; offloaded occurrences never read back and their placeholder reaching the body; an
over-budget request failing before dispatch with the rightoffloadImagescount; and three
card beats for the surface/level reconciliation (partial keep / no vocabulary / follow the
default / fully compatible left untouched), comparing the persistedmodelCapspayload
byte for byte along with the write count.node test/host-compat.mjs(new test entry): 8 tests, 8 pass, 0 skip. It imports
the real@deepseek-ai/dsh-llm/dsh-invariants/cordisfromnode_modulesand drives
the realllmservice plus the real stream-grammar invariant (onlyconnection/
webServer/settings/credentials/attachments/fsare stubbed).smoke.mjs
stubs every host surface and cannot see the host tightening a contract — which is the
only way this 0.1.6 move was discoverable. Its two defect assertions were written as
{ skip }cases first and unskipped as the fix's acceptance test.npm run build:client:lib/client.jsstays in sync withsrc/client/*(asserted by the
suite).- Live GUI check (isolated DSH_HOME; the user's config was not modified): switching
deepseek-flashfrom the responses surface to chat conformed its levels from
minimal/low/medium/high/xhightolow/medium/high, reported "dropped minimal / xhigh",
persisted a valid pair, and left no refusal banner. - Live host check:
/zen-go-rpcmodels/knownandusage/summaryboth answer 200 on
0.1.6-alpha.1, andmodels/knownreports the exact reason for a refused section.
Known / not covered
- messages surface: a persisted tool-call
argumentsthat is not valid JSON still throws
PROVIDER_PROTOCOL_ERROR(the same class as #3, "one history entry kills the session").
Existing tests assert that deliberately (loudly rather than degrade); unchanged here. imageRequestPricingis not implemented: image tokens are priced by the token meter's
heuristic (no failure, just less exact). The operator publishes no vision pricing.- This plugin inlines raw image bytes rather than going through
attachments.readImageRequest's request-version downscaling, somaxRequestImageBytesis
the only request-body guard; the harness-sideimagePixelBudgetstyle request versions are
not involved. - The upstream gateway's request-body limit is not published, so
maxRequestImageBytes's default is a deployment choice, not a measured value. - There is no
.github/and no CI: the gate is these two test entries plus the build
script's syntax check.
Upgrade
dsh plugin --profile web add github xia-sc/dsh-opencode-go
# restart dsh web (host-side changes only take effect on restart)- The runtime floor rises to DeepSeek Harness
0.1.6-alpha.1. Installed beside a 0.1.5
host, pnpm will warn about the peer: this plugin importsprojectOffloadedImages/
requiredImageOffload/IMAGE_OFFLOAD_REQUIRED, which exist only from 0.1.6. Do not
downgrade the host. - To leave more headroom for images (or to let a proxy refuse earlier), set
maxRequestImageBytesin thellm-opencode-gosection; the default is 64 MiB. - If your
settings.yamlpairs amodelCapssurfacewith levels it cannot carry (say
surface: responseswith the chat-onlymax), the whole section is refused: the card now
states the reason, and changing the surface once in that row's "options" panel conforms the
levels automatically.