Skip to content

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

Open
weibaohui wants to merge 1 commit into
cloader:mainfrom
weibaohui:fix/v4-producer-owned-source-kind
Open

weibaohui wants to merge 1 commit into
cloader:mainfrom
weibaohui:fix/v4-producer-owned-source-kind

Conversation

@weibaohui

Copy link
Copy Markdown

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.
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.

1 participant