Skip to content

fix(host): producer-owned source kind for framing inject (dsh 0.1.7-rc.2) - #33

Merged
cloader merged 1 commit into
cloader:mainfrom
weibaohui:fix/v4-producer-owned-source-kind
Sep 26, 2026
Merged

cloader merged 1 commit into
cloader:mainfrom
weibaohui:fix/v4-producer-owned-source-kind

Conversation

@weibaohui

Copy link
Copy Markdown
Contributor

Problem

On dsh 0.1.7-rc.2, every scheduled/manual task execution fails its opening turn:

[dsh-taskboard] turn error detail: {"message":"format v4 message requires a producer-owned source kind","code":"UNKNOWN"}

dsh 0.1.7-rc.2 retired the generic kind: 'plugin' message source. The v4 session format's source() validator now requires every durable message to carry a producer-owned source.kind — a non-empty string that is not 'plugin'. The opening inject() framing line used source: { kind: 'plugin', plugin: 'dsh-taskboard' }, so the v4 format rejects it and the whole turn fails.

Fix

src/host/execution.ts — replace the retired kind: 'plugin' with the plugin's own kind 'dsh-taskboard', and declare it in MessageSourceMap so the taskboard owns its attribution (matching the cordis-host-runner / runtime-context convention where each producer owns its source kind):

declare module '@deepseek-ai/dsh-llm' {
  interface MessageSourceMap {
    'dsh-taskboard': { kind: 'dsh-taskboard' }
  }
}
// ...
handle.agent.inject({
  ...
  source: { kind: 'dsh-taskboard' as const },  // was: { kind: 'plugin', plugin: 'dsh-taskboard' }
})

The followup() body already used kind: 'user' and is unchanged. tests/execution.spec.ts updated to assert the new kind.

Verification (target: dsh 0.1.7-rc.2)

  • tsdown build (host + client) succeeds.
  • vitest: 346/346 tests pass (including the execution specs that exercise the inject framing path).
  • Built lib/host/execution.js carries kind: "dsh-taskboard" (no 'plugin').

The same class of bug + fix was confirmed in another scheduled-task plugin on 0.1.7-rc.2.

… 0.1.7-rc.2)

dsh 0.1.7-rc.2 retired the generic kind:'plugin' message source — the v4
session format now requires every durable message to carry a producer-owned
source kind (a non-empty string that is not 'plugin'). The opening inject()
framing line used source:{kind:'plugin',plugin:'dsh-taskboard'}, so every
scheduled/manual execution's turn failed with
'format v4 message requires a producer-owned source kind' (logged as
[dsh-taskboard] turn error detail).

Replace it with the plugin's own kind 'dsh-taskboard' (declared in
MessageSourceMap, matching the cordis-host-runner / runtime-context convention
where each producer owns its source kind). The followup() body already used
kind:'user' and is unchanged.
@cloader
cloader merged commit b89d6e6 into cloader:main Sep 26, 2026
1254087415 pushed a commit to 1254087415/dsh-taskboard that referenced this pull request Sep 26, 2026
上游 8 个 commit(v0.8.1 → v0.8.3):
- cloader#33 执行开场注入改用看板自身的 source kind(适配 DSH 0.1.7-rc.2 的 v4 会话格式)
- cloader#35 定期任务完成策略(默认「完成后新建待办」)
- cloader#37 会话跳转改走 uiWorkspace.openSession(sessions.open 在 DSH 0.1.6+ 已移除)
- cloader#38 台账写入拒绝用旧快照覆盖新文件;cloader#39/cloader#40 结算与认领超时判定修正
- devDeps 升到 0.1.7-rc.2

冲突解决(仅 2 处源码,其余 lib/* 由 npm run build 覆盖):
- src/client/index.ts:保留本 fork 的 mountSessionCardLinks 接线,同时引入上游的 UiWorkspaceFace / getUiWorkspace
- src/shared/version.ts:采用上游 0.8.3

本地 5 项增强逐项核对保留:会话自动跟踪、会话导入、会话↔卡双向跳转、
侧边栏 4 数字统计、Agent 协议纪律 9/10。
测试:360/360 通过(本机 Node 26 需 NODE_OPTIONS=--localstorage-file 才不会被 Node 自带的
localStorage 全局遮住 jsdom 实现)。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants