dsh-memory-plugin: session-start available-memories omits actor peer memories
中文正文
问题
@openviking/dsh-memory-plugin 0.5.5 的会话起手 <available-memories> 只枚举 user 根,遗漏当前 actor peer 的项目记忆。自动 recall 可以跨 peer 返回内容,但它依赖首条任务 query,不能替代起手可发现性。
最小复现证据
shared/profile-inject.mjs:371-392只构造并列举profile.md、memories/preferences、memories/entities三个 user 根 URI;没有构造peers/<actorPeerId>/memories/...URI。- 同文件
:33-59、:126-128中的resolveUserSpace/lsDir虽接收actorPeerId,但只把它传给fetchJSON(..., { actorPeerId })作为 HTTP 请求身份;它不改变枚举根路径。 - v4 会话样本
session-ea784ce3-5902-4a41-a2de-556f0104ec80/session.v4.jsonl.zstd:seq=12的 OpenViking 起手清单含 37 条 user 根项、0 条viking://user/default/peers/dsh-main/...项。 - 同环境的自动 recall 已能返回 4 条
peers/dsh-main项;另一次手工 find 能命中viking://user/default/peers/dsh-main/memories/entities/智能音箱/fanmili_speaker.md(score 0.49)。这表明 peer 内容存在且可访问,缺口在起手枚举边界。 - 最新版 0.5.8 仍未修复(2026-09-27 实证):
@openviking/[email protected]的shared/profile-inject.mjs与 0.5.5 逐字节相同(diff为 0),buildProfileBlock依然只枚举三个 user 根 URI(0.5.8 中位于:380-415)。
期望行为
在 <available-memories> 中,除现有 user 根外,追加当前 actor peer(不是所有 peer)的 preferences 和 entities。建议 URI 形态:
viking://user/<space>/peers/<encodeURIComponent(actorPeerId)>/memories/preferences
viking://user/<space>/peers/<encodeURIComponent(actorPeerId)>/memories/entities请定义以下降级行为:actor 为空、peer 目录不存在、以及起手预算不足时如何保留目录头/关键条目。不要默认枚举全部 peer,以免项目串扰和起手上下文膨胀。
环境
- DSH memory plugin:0.5.5(0.5.8 同样复现,见证据 5)
- DSH session format:v4
- actor peer:
dsh-main - 当前会话 header 可见
agentPreset: dsh-standard;该字段与本 issue 无直接因果关系。
English body
Problem
In @openviking/dsh-memory-plugin 0.5.5, the session-start <available-memories> block enumerates only the user root and omits project memories under the current actor peer. Automatic recall can return peer entries, but it depends on the first-task query and does not replace startup discoverability.
Minimal evidence
shared/profile-inject.mjs:371-392constructs and lists only three user-root locations:profile.md,memories/preferences, andmemories/entities. It never constructs apeers/<actorPeerId>/memories/...URI.- In the same file,
resolveUserSpace/lsDir(:33-59,:126-128) acceptactorPeerIdonly to pass it tofetchJSON(..., { actorPeerId })as HTTP request identity; it does not change the listing root. - In v4 session sample
session-ea784ce3-5902-4a41-a2de-556f0104ec80/session.v4.jsonl.zstd, the OpenViking startup block atseq=12contains 37 user-root entries and zeroviking://user/default/peers/dsh-main/...entries. - In the same environment, automatic recall returned four
peers/dsh-mainentries. A manual find also matchedviking://user/default/peers/dsh-main/memories/entities/智能音箱/fanmili_speaker.mdat score 0.49. The peer content therefore exists and is reachable; the gap is the startup enumeration boundary. - Latest 0.5.8 is still affected (verified 2026-09-27):
shared/profile-inject.mjsin@openviking/[email protected]is byte-identical to 0.5.5 (diffoutput is empty);buildProfileBlockstill enumerates only the three user-root URIs (at:380-415in 0.5.8).
Expected behavior
Alongside the existing user-root listings, include preferences and entities for the current actor peer (not every peer) in <available-memories>, for example:
viking://user/<space>/peers/<encodeURIComponent(actorPeerId)>/memories/preferences
viking://user/<space>/peers/<encodeURIComponent(actorPeerId)>/memories/entitiesPlease define fallback behavior when the actor is empty, the peer directories do not exist, or the session-start budget is insufficient. Enumerating every peer by default would risk cross-project leakage and startup-context growth.
Source: volcengine/OpenViking