Repository navigation
Description
BODY:
Summary
@memtensor/memos-local-plugin@2.0.20 (DSH adapter) still writes messages with the legacy V3 source shape source.kind: "plugin". dsh 0.2.1-rc.2 session format V4 rejects any runtime-written message whose source.kind === "plugin":
SessionFormatError: format v4 message requires a producer-owned source kind
(@deepseek-ai/dsh-session-format-v3-to-v4/lib/index.js:126)
Result: every conversation turn fails with UNKNOWN error as soon as the plugin injects its recall message — the harness is completely unusable with this plugin installed.
Offending code (v2.0.20, dist/adapters/deepseek-harness/)
index.js(~line 301) — per-turn recall message:
createRecallMessage: (text) => createUserMessage({
content: [{ type: "text", text }],
source: {
kind: "plugin", // ← rejected by V4 validator
plugin: DEEPSEEK_HARNESS_PLUGIN,
form: "recall",
},
}),host-llm.js(~line 220) — host LLM messages:
source: { kind: "plugin", plugin: HOST_LLM_MESSAGE_SOURCE }, // ← rejectedThe V3→V4 migration rewrites historical sessions, but runtime writes are hard-rejected.
Expected fix
Use the producer-owned form that dsh itself maps unknown plugins to:
kind: "plugin:memos-local-memory" // instead of kind: "plugin", plugin: "..."We verified locally: replacing both sites with kind: "plugin:memos-local-memory" makes all turns pass again (syntax-checked, zero residual kind: "plugin" in dist, web profile back to normal).
Secondary issue: peer range pins plugin to dsh <0.2.0
The plugin's peer requirements (@deepseek-ai/dsh-agent etc. >=0.1.0-rc.5 <0.2.0) make dsh 0.2.1-rc.2 skip the bundle at startup ("incompatible ... Exact-version exemption: not active"). Users must hand-grant dsh plugin allow-version. Please widen the range (or republish) once the V4 kind fix is in, otherwise the plugin silently doesn't load on current dsh.
Environment
-
dsh 0.2.1-rc.2, plugin @memtensor/memos-local-plugin@2.0.20 (latest on npm as of 2026-10-23)
-
Reproduced on 3 machines (Linux x86_64, macOS arm64, Linux aarch64) — deterministic, 100% repro on any new turn
-
Session data on affected hosts was not corrupted (rejection happens before persistence)
Activity
Memtensor-AI commentedon Oct 23, 2026
🤖 AutoDev has picked up this issue and started working on it.
Task ID:
2e1b2262c967d90dWorking branch:
bugfix/autodev-2538-20261023114157826Target branch:
latest dev* branchWorkflow: opsp (analysis → coding → testing → PR)
I will post the PR link here once done. If I need more information, I will ask in the comments.
Memtensor-AI commentedon Oct 23, 2026
✅ AutoDev task
2e1b2262c967d90dcompleted.Summary: 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.Base branch:
mainBranch:
bugfix/autodev-2538-20261023114157826Commit:
1263b22PR: #2541
Assigned to: @XiaohuiSu
Reviewers: @whipser030, @hijzy
Poqianhu7895 commentedon Oct 24, 2026
Independent verification from a 2.0.20 + DSH 0.2.1-rc.3 deployment (Linux, node v22.23.1):
SessionFormatError: format v4 message requires a producer-owned source kind; the on-disk v4 session file stays clean (rejection happens at runtime adoption), and~/.dsh/storages/session_projcachesnapshots are also clean.adapters/deepseek-harness/index.tsrecall message,adapters/deepseek-harness/host-llm.tstoDshMessage), changingkind: "plugin"→kind: "memos-local-memory". Aftersystemctl --user restartthe same prompt that previously died instantly ran a full multi-tool turn (including amemos_gettool call) with zeroSessionFormatErrorin the journal.isUserMessage(bridge) only requiressource.kindto be a string, so any producer-owned kind works; yourplugin:memos-local-memorychoice is fine. One caveat: if the published fix lands in a new release, users on 2.0.20 who hand-patcheddist/(like us) will need to re-apply or reinstall, since a profilepnpm installwill overwrite the patch — worth a line in the release notes.MEMOS_DSH_HOST_LLM_TIMEOUT after 2000ms/fetch failedfrom the host-LLM bridge during retrieval — memory recall still works but degraded. Happy to provide journal excerpts if useful.slamdunk111 commentedon Oct 24, 2026
Thanks @Poqianhu7895 for the independent verification on 2.0.20 + DSH 0.2.1-rc.3 — the both-sites patch confirmation and the
isUserMessageconsumer check are exactly the cross-check this fix needed.Agreed on the release-notes point: users who hand-patched
dist/locally will need a re-apply/reinstall note once the fix ships, sincepnpm installoverwrites the patch.On the
MEMOS_DSH_HOST_LLM_TIMEOUT after 2000msobservation — yes, journal excerpts would be useful; if you could post a few occurrences with timestamps we can check whether it correlates with recall load or is a separate host-LLM bridge issue.shirokoterror01 commentedon Oct 27, 2026
Additional confirmation from Windows, with a different failure mode (session-fatal, delayed onset)
Same root cause, but the blast radius here was larger than "every turn fails", and the onset was
delayed — which is why this can silently sit in a long-running session and then kill it.
Environment
@deepseek-ai/dsh@0.2.1-rc.2(session format v4)@memtensor/memos-local-plugin@2.0.20(npm latest), installed as a profile bundle,recallEnabled: true,hostLlmEnabled: trueHere the session dies; it does not merely fail a turn
The affected turn never wrote
turn/end. The JSONL tail is:The queued user message is rolled back by those two removals, no
turn/end { kind: "interrupted" }is written, and the session is dead from the UI's point of view.The on-disk file stayed clean (dense seq 0..6344, zero unparsable rows, last line complete) — same
"rejected before persistence" property already reported, but here the rejection also takes the
session with it instead of just ending the turn.
Onset is delayed, so repro looks intermittent
bridge.jsonly injects when recall actually produced context:A fresh install, or any session whose corpus yields no hits, behaves perfectly. The bug only fires on
the first turn with a non-empty recall — here that was turn 121, long after this session had
already been migrated to v4 and had run many turns. That "fine until it suddenly isn't, once,
catastrophically" shape may also explain the non-100% ratio in #2437 (4 of 11 turns).
Independently reproduced with the same admission function the PR uses
That AFTER value is byte-identical to the recall rows already present in this session's migrated
history, which is why
plugin:memos-local-memory(rather than a barememos-local-memory) is theright choice: live and migrated messages stay indistinguishable.
Two things worth closing alongside the code fix
~/.dsh/profiles/web/compatibility.jsonrecorded@memtensor/memos-local-plugin@2.0.20 → 0.2.1-rc.2as compatible. A runtime source-contractchange is invisible to that gate — worth documenting that it does not cover session-format
invariants, or tightening whatever produces the verdict.
peerDependenciesstill claim<0.2.0, yet it loads on 0.2.1-rc.2 after anexemption. Gating and actual behavior disagree, which is how a broken combination reaches a
setup that looks stable.
For the release notes: users who hand-patched
dist/to unblock (several of us did) will havethat silently reverted by the next profile
pnpm install, and the crash then returns at the nextrecall hit — which is later, and therefore will not be obviously connected to the upgrade.
Happy to test the PR build on Windows if a preview pack is published.
slamdunk111 commentedon Oct 27, 2026
Thanks @shirokoterror01 — this is a valuable escalation of the blast-radius picture:
Two takeaways for the fix now in progress upstream:
Will reference your Windows trace when the release lands so the Windows path gets explicit verification in the release notes.
chichi233 commentedon Oct 29, 2026
Additional data point: DSH Desktop (Electron,
0.2.1-rc.3) on Windows — turn-fatal, session survivesSame root cause as reported, but a third blast radius: here the turn dies while the session stays usable (the next prompt works), so it reads like a transient model error rather than a plugin bug. The UI surfaces it as a turn-card error:
Environment
@deepseek-ai/dsh@0.2.1-rc.3,SESSION_FORMAT_VERSION = 4@memtensor/memos-local-plugin@2.0.20(npm latest), installed as a profile bundlerecallEnabled: trueTrace (on-disk v4 session, verbatim event tail)
No
step/start, norequest/header, noturn/endfollow. Two inbox rollbacks and then silence: the rejected insert is the pre-step recall message, and nothing about it reaches the log — which is why the session file stays clean.The file really stays clean. Swept all 60
session.v4.jsonl.zstdfiles under~/.dsh/sessions/**: zero occurrences of"kind":"plugin". Nothing to repair afterwards — consistent with admission rejecting the write, not with a corrupted log.Why the same install can run clean for a long time.
dist/adapters/deepseek-harness/bridge.js:112-118:Failure needs a non-empty recall result, so it fires on the first turn where recall actually hits — the delayed-onset pattern already described in this thread.
Sibling risk worth fixing in the same pass. The retired wrapper is not unique to this plugin, and the dangerous part is deciding the source shape from a module constant instead of the live session. In the same profile:
@nanmicoder/dsh-agent-teams/lib/harness-compat.js:90-130—agentTeamsSource(modern, observed)returns{ kind: "plugin", plugin: ... }wheneverhostSessionFormatVersion(observed) < 3, whereobservedissubject?.session?.header?.versionand the module fallback isdshSession.SESSION_FORMAT_VERSION. Its own comment documents that a profile resolving a different@deepseek-ai/dsh-sessioncopy reports the wrong generation and "makes every durable AgentTeams message fail the host's own admission check (feat: add further questions for dialogue #236)". On this Desktop/asar deployment~/.dsh/profiles/desktop/node_modules/@deepseek-ai/containsdsh-session-persistence,dsh-session-projection,dsh-util-valuesbut nodsh-session— exactly the layout where that resolution can land on the wrong copy.dsh-vision-router/lib/session-message-source-compat.js:4-6does it the robust way:Number(session?.header?.version) >= 4 ? PRODUCER_SOURCE : LEGACY_SOURCE, i.e. from the live session header.Suggestion for
apps/memos-local-plugin: derive the kind from the live session at the write site (same as vision-router) rather than from a plugin constant, and add theCHANGELOG.mdreinstall note — the hand-patch is currently the only workaround, since 2.0.20 is still npm latest (published 2026-09-21, PR #2541 opened 2026-10-23).endxxxx commentedon Oct 29, 2026
Update: the V4 message-source failure is fixed by #2519 and released in @memtensor/memos-local-plugin 2.0.21. Both recall and auxiliary host-LLM messages now use plugin:memos-local-memory; Windows Desktop automatic recall and restart persistence were verified.
However, the secondary peer-compatibility issue remains: 2.0.21 still declares the DSH peer range >=0.1.0-rc.5 <0.2.0. Upgrading the plugin therefore does not, by itself, resolve DSH 0.2.x bundle compatibility checks.
Keeping this issue open for the remaining compatibility work tracked in #2520 / #2541. The intermittent host-LLM timeout reports should also remain a separate investigation.
slamdunk111 commentedon Oct 29, 2026
Confirmed on our side:
@memtensor/memos-local-plugin2.0.21 is now published on npm (dist-tags.latest = 2.0.21, checked today), and it carries the V4 producer-owned message-source fix from #2519 — which is exactly the root cause this issue reported (recall messages using the retiredkind: "plugin"wrapper instead of a producer-owned source kind underSESSION_FORMAT_VERSION = 4).Two follow-ups from this thread we'll track on our side:
>=0.1.0-rc.5 <0.2.0in 2.0.21, so0.2.xbundle compatibility checks still fail) — noted as tracked in feat: support DeepSeek Harness 0.2.x (peer deps currently pin <0.2.0) #2520 / Fix #2538: [memos-local-plugin] dsh 0.2.x session format V4 rejects plugin messages: "produ #2541; our 0.2.x installs keep the"snapshot"-style local pin until that lands.Thanks for the fix and for keeping the issue open for the compatibility work — no further action needed from us on the original V4 rejection itself.
fix(plugin): support validated DSH 0.2 preview APIs (#2549)
endxxxx commentedon Nov 9, 2026
Thanks for the detailed reports and reproduction steps. #2519 fixed the V4 message-source error for both automatic recall and auxiliary host LLM calls. #2549 addressed the remaining issue that prevented the local plugin from loading on supported DSH 0.2 previews.
Both fixes are available in @memtensor/memos-local-plugin 2.0.21-beta.1. If you're using a patched build or a local pin, you can switch to the published beta. For a DSH CLI profile, run:
Replace
webwith your profile name and restart DSH. We verified recall injection,memos_get, and recall after restart on macOS with DSH Desktop0.2.1-rc.5and a live DeepSeek model.Closing as fixed. If you still see the V4 error with this beta, please share your DSH version, OS, and whether the failing turn had a memory hit.