#5411·OpenViking

dsh-memory-plugin: session-start available-memories omits actor peer memories

Author: chenyilin73Created Sep 27, 2026Updated Sep 29, 2026
Labelsagent-plugins

中文正文

问题

@openviking/dsh-memory-plugin 0.5.5 的会话起手 <available-memories> 只枚举 user 根,遗漏当前 actor peer 的项目记忆。自动 recall 可以跨 peer 返回内容,但它依赖首条任务 query,不能替代起手可发现性。

最小复现证据

  1. shared/profile-inject.mjs:371-392 只构造并列举 profile.md、memories/preferences、memories/entities 三个 user 根 URI;没有构造 peers/<actorPeerId>/memories/... URI。
  2. 同文件 :33-59、:126-128 中的 resolveUserSpace / lsDir 虽接收 actorPeerId,但只把它传给 fetchJSON(..., { actorPeerId }) 作为 HTTP 请求身份;它不改变枚举根路径。
  3. v4 会话样本 session-ea784ce3-5902-4a41-a2de-556f0104ec80/session.v4.jsonl.zstd:seq=12 的 OpenViking 起手清单含 37 条 user 根项、0 条 viking://user/default/peers/dsh-main/... 项。
  4. 同环境的自动 recall 已能返回 4 条 peers/dsh-main 项;另一次手工 find 能命中 viking://user/default/peers/dsh-main/memories/entities/智能音箱/fanmili_speaker.md(score 0.49)。这表明 peer 内容存在且可访问,缺口在起手枚举边界。
  5. 最新版 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

  1. shared/profile-inject.mjs:371-392 constructs and lists only three user-root locations: profile.md, memories/preferences, and memories/entities. It never constructs a peers/<actorPeerId>/memories/... URI.
  2. In the same file, resolveUserSpace / lsDir (:33-59, :126-128) accept actorPeerId only to pass it to fetchJSON(..., { actorPeerId }) as HTTP request identity; it does not change the listing root.
  3. In v4 session sample session-ea784ce3-5902-4a41-a2de-556f0104ec80/session.v4.jsonl.zstd, the OpenViking startup block at seq=12 contains 37 user-root entries and zero viking://user/default/peers/dsh-main/... entries.
  4. In the same environment, automatic recall returned four peers/dsh-main entries. A manual find also matched viking://user/default/peers/dsh-main/memories/entities/智能音箱/fanmili_speaker.md at score 0.49. The peer content therefore exists and is reachable; the gap is the startup enumeration boundary.
  5. Latest 0.5.8 is still affected (verified 2026-09-27): shared/profile-inject.mjs in @openviking/[email protected] is byte-identical to 0.5.5 (diff output is empty); buildProfileBlock still enumerates only the three user-root URIs (at :380-415 in 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/entities

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