Repository navigation
Fix #2538: [memos-local-plugin] dsh 0.2.x session format V4 rejects plugin messages: "produ - #2541
Conversation
DSH session format V4 validates runtime writes, not just migrations, and rejects any message whose source.kind is the retired V3 wrapper "plugin". The DeepSeek Harness adapter still wrote that shape on both message paths, so the recall injected before every turn failed agent/pre-step and each turn surfaced as UNKNOWN. Both writers now emit "plugin:memos-local-memory" through a shared constant, declared in DSH's MessageSourceMap extension point. That is the same kind DSH's own V3->V4 migration derives, so live and migrated messages stay indistinguishable. The optional DSH peer range also stopped at <0.2.0, which silently skips the bundle on current hosts. It now enumerates each V4 preview line that was actually compiled and tested. JsonValue, moved out of dsh-tools after 0.2, is declared locally so the adapter builds against both lines. Verified: full plugin suite 1601 passed / 2 skipped; adapter suite 68 tests green on DSH 0.1.0-rc.6, 0.1.7-rc.2, 0.2.0-rc.2 and 0.2.1-rc.2; shipped dist accepted by the real V4 admission validator.
🤖 Open Code ReviewTarget: PR #2541 🔍 OpenCodeReview found 7 issue(s) in this PR. 1.
|
🔧 Open Code Review requested Agent fixOpen Code Review found 7 issue(s). I have resumed the development Agent to fix them.
The Agent will push a new commit to this PR branch. OCR will recheck after the commit is pushed. |
Description
Fixes #2538. The DeepSeek Harness adapter in
apps/memos-local-pluginstill wrote the retired V3 message source wrappersource: { kind: "plugin", plugin: "..." }. DSH session format V4 validates runtime writes (not only migrations), so the per-turn recall message injected atagent/pre-stepwas rejected before persistence withSessionFormatError: format v4 message requires a producer-owned source kind, failing every conversation turn with UNKNOWN. Both runtime writers — the recall message inadapters/deepseek-harness/index.tsand the host-LLM user message inhost-llm.ts— now emitkind: "plugin:memos-local-memory"through a new sharedadapters/deepseek-harness/source-kind.ts. That constant is declared in DSH'sMessageSourceMapextension point (the same pattern first-party plugins use) rather than cast, and it is exactly the value DSH's own V3→V4 migration derives formemos-local-memory, so live and migrated messages stay indistinguishable. The recall message keepsform: "recall"; host-LLM messages still omitform, since those are auxiliary MemOS calls rather than DSH conversation context.The secondary issue is also addressed: the optional DSH peer range stopped at
<0.2.0, which made DSH 0.2.x silently skip the bundle at startup. Semver prerelease rules mean<0.2.0does not admit0.1.7-rc.xand<0.3.0does not admit0.2.1-rc.x, so the range now enumerates each V4 preview line that was actually compiled and tested. Dev dependencies move to DSH0.2.1-rc.2so CI exercises the V4 surface, andJsonValue(moved out ofdsh-toolsafter 0.2) is declared locally so the adapter builds against both lines. Adapter README and CHANGELOG document the new source contract.Verification is real and reproduced the issue's exact error: calling the published
assertV4RowAdmissionfrom@deepseek-ai/dsh-session-format-v3-to-v4@0.2.1-rc.2rejects the V3 shape and admits both new shapes, including the constants exported by the compileddist.tsc --noEmitpasses and all 68 DSH adapter tests pass on DSH 0.1.0-rc.6, 0.1.7-rc.2, 0.2.0-rc.2 and 0.2.1-rc.2; the full plugin suite is 1601 passed / 2 skipped;npm run buildsucceeds. A new regression test fails if either writer or any adapter source reintroduces a code-levelkind: "plugin".Changes are committed as
1263b229onbugfix/autodev-2538-20261023114157826and pushed to the remote. The opsp task file and openspec change (proposal.md,spec.md,design.md,verification-report.md) were produced and archived to the specs repository. No PR was opened from here, per the scheduler contract.Related Issue (Required): Fixes #2538
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Automated tests are pending.
Checklist
@whipser030, @hijzy please review this PR.
Reviewer Checklist