Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.
Python agent-contextagent-memoryagent-pluginsagentic-ragcontext-databasedsh-pluginknowledge-basememorymemory-managementself-evolvingvector-database
fix(openclaw): default peer role to assistant (#2626)
Qin Haojie794ee3ee41b1
diff --git a/examples/openclaw-plugin/INSTALL-AGENT.md b/examples/openclaw-plugin/INSTALL-AGENT.mdindex 000bb4364..881125ccf 100644--- a/examples/openclaw-plugin/INSTALL-AGENT.md+++ b/examples/openclaw-plugin/INSTALL-AGENT.md@@ -268,7 +268,7 @@ Core fields:| `mode` | Legacy compatibility field. Expected value: `remote`. || `baseUrl` | OpenViking HTTP endpoint || `apiKey` | OpenViking API key |-| `peer_role` | Peer identity mode: `none`, `assistant`, or `person`. New installs default to `none`. Session messages use body `peer_id`; data-plane recall/search uses `X-OpenViking-Actor-Peer`. |+| `peer_role` | Peer identity mode: `none`, `assistant`, or `person`. New installs default to `assistant`. Session messages use body `peer_id`; data-plane recall/search uses `X-OpenViking-Actor-Peer`. || `peer_prefix` | Optional prefix for assistant `peer_id` / actor peer values when `peer_role=assistant`. || `accountId` | Required for root API keys || `userId` | Required for root API keys |@@ -331,7 +331,7 @@ Existing config fields are preserved during migration. The new plugin reads old- `baseUrl`- `apiKey`-- `peer_role`: optional; default `none`; selects the peer identity mode+- `peer_role`: optional; default `assistant`; selects the peer identity mode- `peer_prefix`: optional assistant `peer_id` / actor peer prefix when `peer_role=assistant`## Backup Path: ov-installdiff --git a/examples/openclaw-plugin/INSTALL-ZH.md b/examples/openclaw-plugin/INSTALL-ZH.mdindex 762144dff..7486f7aa2 100644--- a/examples/openclaw-plugin/INSTALL-ZH.md+++ b/examples/openclaw-plugin/INSTALL-ZH.md@@ -200,7 +200,7 @@ openclaw openviking setup \openclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --force-slot --json```-如需给 assistant message 写入带前缀的 `peer_id`,并让数据面 recall/search 使用对应 actor peer 视图(可选;多数用户保持默认 `none` 即可):+如需给默认 assistant peer 路由增加前缀,可以额外传:```bashopenclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --peer-role assistant --peer-prefix <PREFIX> --json@@ -264,7 +264,7 @@ plugins.entries.openviking.config| `mode` | `remote` | 兼容旧配置的字段。当前只支持 remote。 || `baseUrl` | `http://127.0.0.1:1933` | OpenViking HTTP 地址 || `apiKey` | 空 | OpenViking API key |-| `peer_role` | `none` | Peer 身份模式:`none`、`assistant` 或 `person`。Session message 使用 body `peer_id`;数据面 recall/search 使用 `X-OpenViking-Actor-Peer`。 |+| `peer_role` | `assistant` | Peer 身份模式:`none`、`assistant` 或 `person`。Session message 使用 body `peer_id`;数据面 recall/search 使用 `X-OpenViking-Actor-Peer`。 || `peer_prefix` | 空 | `peer_role=assistant` 时 assistant `peer_id` / actor peer 值的可选前缀。 || `accountId` | 空 | 使用 root API key 时需要 || `userId` | 空 | 使用 root API key 时需要 |@@ -289,7 +289,7 @@ openclaw config get plugins.entries.openviking.config| --- | --- | --- || `baseUrl` | `http://127.0.0.1:1933` | 远端 OpenViking 服务地址 || `apiKey` | 空 | 远端 OpenViking API Key;服务端未开启认证时可不填 |-| `peer_role` | `none` | Peer 身份模式:`none`、`assistant` 或 `person`;session message 使用 body `peer_id`,数据面 recall/search 使用 `X-OpenViking-Actor-Peer` |+| `peer_role` | `assistant` | Peer 身份模式:`none`、`assistant` 或 `person`;session message 使用 body `peer_id`,数据面 recall/search 使用 `X-OpenViking-Actor-Peer` || `peer_prefix` | 空 | `peer_role=assistant` 时 assistant `peer_id` / actor peer 值的可选前缀 |常见设置:diff --git a/examples/openclaw-plugin/INSTALL.md b/examples/openclaw-plugin/INSTALL.mdindex 5a2744b05..19ce58889 100644--- a/examples/openclaw-plugin/INSTALL.md+++ b/examples/openclaw-plugin/INSTALL.md@@ -141,7 +141,7 @@ If another context engine already owns the slot, setup will not replace it by deopenclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --force-slot --json```-If you want assistant messages to carry a prefixed `peer_id` and data-plane recall/search requests to use the matching actor peer view (optional; most users keep the default `none`):+If you want assistant messages to carry a prefixed `peer_id` and data-plane recall/search requests to use the matching actor peer view, pass a prefix explicitly:```bashopenclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --peer-role assistant --peer-prefix <PREFIX> --json@@ -205,7 +205,7 @@ Core fields:| `mode` | `remote` | Legacy compatibility field. Only remote mode is supported. || `baseUrl` | `http://127.0.0.1:1933` | OpenViking HTTP endpoint || `apiKey` | empty | OpenViking API key |-| `peer_role` | `none` | Peer identity mode: `none`, `assistant`, or `person`. Session messages use body `peer_id`; data-plane recall/search uses `X-OpenViking-Actor-Peer`. |+| `peer_role` | `assistant` | Peer identity mode: `none`, `assistant`, or `person`. Session messages use body `peer_id`; data-plane recall/search uses `X-OpenViking-Actor-Peer`. || `peer_prefix` | empty | Optional prefix for assistant `peer_id` / actor peer values when `peer_role=assistant`. || `accountId` | empty | Required when using a root API key || `userId` | empty | Required when using a root API key |@@ -317,7 +317,7 @@ The plugin connects to an existing remote OpenViking server.| --- | --- | --- || `baseUrl` | `http://127.0.0.1:1933` | Remote OpenViking HTTP endpoint || `apiKey` | empty | Optional OpenViking API key |-| `peer_role` | `none` | Peer identity mode: `none`, `assistant`, or `person`; session messages use body `peer_id`, while data-plane recall/search uses `X-OpenViking-Actor-Peer` |+| `peer_role` | `assistant` | Peer identity mode: `none`, `assistant`, or `person`; session messages use body `peer_id`, while data-plane recall/search uses `X-OpenViking-Actor-Peer` || `peer_prefix` | empty | Optional prefix for assistant `peer_id` / actor peer values when `peer_role=assistant` |Common settings:diff --git a/examples/openclaw-plugin/README.md b/examples/openclaw-plugin/README.mdindex 4086dc1a5..34bdd2f81 100644--- a/examples/openclaw-plugin/README.md+++ b/examples/openclaw-plugin/README.md@@ -120,8 +120,8 @@ The main rules are:- reuse `sessionId` directly when it is already a UUID- prefer `sessionKey` when deriving a stable `ovSessionId`- normalize unsafe path characters, or fall back to a stable SHA-256 when needed-- `peer_role=none` is the default and does not write `peer_id` on session messages-- `peer_role=assistant` writes assistant messages with `peer_id=<sessionAgent>`; if `peer_prefix` is set, the value becomes `<peer_prefix>_<sessionAgent>`+- `peer_role=assistant` is the default and writes assistant messages with `peer_id=<sessionAgent>`; if `peer_prefix` is set, the value becomes `<peer_prefix>_<sessionAgent>`+- `peer_role=none` disables peer message attribution and actor-peer routing- `peer_role=person` writes user messages with `peer_id` derived from OpenClaw sender identity; assistant messages do not get `peer_id`- data-plane recall/search/read/import/delete sends the same resolved peer identity as `X-OpenViking-Actor-Peer` when `peer_role` is `assistant` or `person`- when OpenClaw does not provide a session agent, use its default agent `main` for local session and assistant peer metadata@@ -139,7 +139,7 @@ The recommended remote-mode configuration only needs:In this setup:- `apiKey` should usually be a user key-- new installs default to `peer_role=none`+- new installs default to `peer_role=assistant`- `accountId` / `userId` are advanced options only when the deployment needs explicit identity headers, such as root-key or trusted-server flows### User namespacediff --git a/examples/openclaw-plugin/README_CN.md b/examples/openclaw-plugin/README_CN.mdindex 18e3b7a13..d2ad32856 100644--- a/examples/openclaw-plugin/README_CN.md+++ b/examples/openclaw-plugin/README_CN.md@@ -119,8 +119,8 @@ openclaw config get plugins.slots.contextEngine # 应输出:openviking- `sessionId` 是 UUID 时直接复用。- `sessionKey` 存在时优先用它生成稳定的 `ovSessionId`。- 非安全路径字符会被规整或退化成稳定的 SHA-256。-- `peer_role=none` 是默认值,session message 不写 `peer_id`。-- `peer_role=assistant` 时,assistant message 写入 `peer_id=<sessionAgent>`;如果配置了 `peer_prefix`,则写入 `<peer_prefix>_<sessionAgent>`。+- `peer_role=assistant` 是默认值,assistant message 写入 `peer_id=<sessionAgent>`;如果配置了 `peer_prefix`,则写入 `<peer_prefix>_<sessionAgent>`。+- `peer_role=none` 会关闭 peer message 归因和 actor-peer 路由。- `peer_role=person` 时,user message 使用 OpenClaw sender 身份派生 `peer_id`;assistant message 不写 `peer_id`。- 数据面的 recall/search/read/import/delete 会在 `peer_role=assistant` 或 `peer_role=person` 时把同一个解析后的 peer 身份作为 `X-OpenViking-Actor-Peer` 发送。- OpenClaw 没有提供 session agent 时,使用其默认 agent `main` 作为本地 session 和 assistant peer metadata。@@ -138,7 +138,7 @@ openclaw config get plugins.slots.contextEngine # 应输出:openviking其中:- `apiKey` 推荐使用某个 user 的 user key-- 新安装默认 `peer_role=none`+- 新安装默认 `peer_role=assistant`- `accountId` / `userId` 仅在部署需要显式身份 header 时作为高级选项使用,例如 root key 或 trusted server 流程### User namespacediff --git a/examples/openclaw-plugin/commands/setup.ts b/examples/openclaw-plugin/commands/setup.tsindex ba5e91aaa..498c1b082 100644--- a/examples/openclaw-plugin/commands/setup.ts+++ b/examples/openclaw-plugin/commands/setup.ts@@ -79,6 +79,7 @@ const CONFIG_KEYS_TO_PRESERVE = [] as const;type PeerRole = "none" | "assistant" | "person";+const DEFAULT_SETUP_PEER_ROLE: PeerRole = "assistant";type RecallTargetType = "resource" | "user" | "agent";const ALLOWED_RECALL_TARGET_TYPES = ["resource", "user", "agent"] as const;@@ -121,7 +122,7 @@ function normalizePeerRole(value: unknown): PeerRole | undefined {function resolveExistingPeerRole(existing: Record<string, unknown> | null | undefined): PeerRole {const explicit = normalizePeerRole(existing?.peer_role);if (explicit) return explicit;- return "none";+ return DEFAULT_SETUP_PEER_ROLE;}function resolveExistingPeerPrefix(existing: Record<string, unknown> | null | undefined): string {@@ -132,7 +133,7 @@ function resolveExistingPeerPrefix(existing: Record<string, unknown> | null | un}function resolveSetupPeerRole(value: unknown): PeerRole {- if (value === undefined) return "none";+ if (value === undefined) return DEFAULT_SETUP_PEER_ROLE;const role = normalizePeerRole(value);if (role) return role;throw new Error('peer_role must be "none", "assistant", or "person"');@@ -911,7 +912,7 @@ function printSetupResult(zh: boolean, result: SetupResult): void {console.log(` mode: ${result.config.mode}`);console.log(` baseUrl: ${result.config.baseUrl}`);if (result.config.apiKey) console.log(` apiKey: ${result.config.apiKey}`);- console.log(` peer_role: ${result.config.peer_role ?? "none"}`);+ console.log(` peer_role: ${result.config.peer_role ?? DEFAULT_SETUP_PEER_ROLE}`);if (result.config.peer_prefix) console.log(` peer_prefix: ${result.config.peer_prefix}`);if (result.config.accountId) console.log(` accountId: ${result.config.accountId}`);if (result.config.userId) console.log(` userId: ${result.config.userId}`);diff --git a/examples/openclaw-plugin/config.ts b/examples/openclaw-plugin/config.tsindex 133c07f25..18b930b44 100644--- a/examples/openclaw-plugin/config.ts+++ b/examples/openclaw-plugin/config.ts@@ -110,7 +110,7 @@ const DEFAULT_COMMIT_TOKEN_THRESHOLD = 20000;const DEFAULT_COMMIT_KEEP_RECENT_COUNT = 10;const DEFAULT_BYPASS_SESSION_PATTERNS: string[] = [];const DEFAULT_EMIT_STANDARD_DIAGNOSTICS = false;-const DEFAULT_PEER_ROLE = "none" as const;+const DEFAULT_PEER_ROLE = "assistant" as const;const DEFAULT_PEER_PREFIX = "";const DEFAULT_TRACE_RECALL_DIR = "~/.openclaw/openviking/recall-traces";const DEFAULT_TRACE_RECALL_RETENTION_DAYS = 14;diff --git a/examples/openclaw-plugin/docs/openviking-openclaw-plugin-guide.md b/examples/openclaw-plugin/docs/openviking-openclaw-plugin-guide.mdindex 0d5d90fd8..34e95056c 100644--- a/examples/openclaw-plugin/docs/openviking-openclaw-plugin-guide.md+++ b/examples/openclaw-plugin/docs/openviking-openclaw-plugin-guide.md@@ -682,7 +682,7 @@ openclaw config get plugins.slots.contextEngine| `apiKey` | 环境变量或空 | OpenViking API Key || `accountId` | 空 | Root key/trusted 部署需要 || `userId` | 空 | Root key/trusted 部署需要 |-| `peer_role` | `none` | 控制哪些 session message 写 `peer_id`,并为数据面请求提供 actor peer 视图:`none`、`assistant` 或 `person` |+| `peer_role` | `assistant` | 控制哪些 session message 写 `peer_id`,并为数据面请求提供 actor peer 视图:`none`、`assistant` 或 `person` || `peer_prefix` | 空 | `peer_role=assistant` 时 assistant `peer_id` 的可选前缀 || `targetUri` | `viking://user/memories` | 默认 memory search 目标 || `timeoutMs` | `15000` | HTTP 请求超时 |@@ -729,7 +729,7 @@ openclaw config get plugins.slots.contextEngine| `apiKey` | 所有搜索/召回请求 | 空 | 是 | 是 | `OPENVIKING_API_KEY` | HTTP 认证 key;不配通常只能访问关闭认证的本地服务:`config.ts:202` || `accountId` | 多租户搜索路由 | 空 | 是 | 是 | `OPENVIKING_ACCOUNT_ID` | Root key / trusted 部署下显式指定 account,影响搜索命中空间:`config.ts:212` || `userId` | 多租户搜索路由 | 空 | 是 | 是 | `OPENVIKING_USER_ID` | Root key / trusted 部署下显式指定 user,影响 user memory 检索范围:`config.ts:216` |-| `peer_role` | session 归因和数据面 actor peer 视图 | `none` | 是 | 否 | — | `none` 不写 `peer_id`;`assistant` 使用 runtime agent;`person` 使用 OpenClaw sender 身份:`config.ts:430` |+| `peer_role` | session 归因和数据面 actor peer 视图 | `assistant` | 是 | 否 | — | `none` 不写 `peer_id`;`assistant` 使用 runtime agent;`person` 使用 OpenClaw sender 身份:`config.ts:430` || `peer_prefix` | assistant peer id 前缀 | 空 | 是 | 否 | — | `peer_role=assistant` 时可把 assistant `peer_id` 写成 `<peer_prefix>_<agentId>`:`config.ts:431` || `targetUri` | `memory_recall` / `memory_forget` 默认搜索范围 | `viking://user/memories` | 是 | 否 | — | 未显式传 `targetUri` 时的默认 memory 搜索位置:`config.ts:275`、`index.ts:1366` || `timeoutMs` | 所有搜索/读取请求超时 | `15000` | 是 | 否 | — | 控制 `find/read/grep/session` 等 HTTP 请求超时:`config.ts:276` |diff --git a/examples/openclaw-plugin/docs/openviking-plugin-reference.md b/examples/openclaw-plugin/docs/openviking-plugin-reference.mdindex c5abdba2b..36904e064 100644--- a/examples/openclaw-plugin/docs/openviking-plugin-reference.md+++ b/examples/openclaw-plugin/docs/openviking-plugin-reference.md@@ -75,7 +75,7 @@ $OPENCLAW_STATE_DIR/openclaw.json| 参数 | 类型 | 默认值 | 环境变量 | 说明 || --- | --- | --- | --- | --- |-| `peer_role` | `"none"` \| `"assistant"` \| `"person"` | `"none"` | — | 控制哪些 session message 写入 `peer_id`,并为数据面 recall/search/read/import/delete 提供 actor peer 视图。 |+| `peer_role` | `"none"` \| `"assistant"` \| `"person"` | `"assistant"` | — | 控制哪些 session message 写入 `peer_id`,并为数据面 recall/search/read/import/delete 提供 actor peer 视图。 || `peer_prefix` | string | 空 | — | `peer_role=assistant` 时 assistant `peer_id` 的可选前缀;仅允许字母、数字、`_`、`-`。 |### 3.3 自动捕获与提交diff --git a/examples/openclaw-plugin/openclaw.plugin.json b/examples/openclaw-plugin/openclaw.plugin.jsonindex 96efc8934..f7f58c103 100644--- a/examples/openclaw-plugin/openclaw.plugin.json+++ b/examples/openclaw-plugin/openclaw.plugin.json@@ -84,8 +84,8 @@},"peer_role": {"label": "Peer Role",- "placeholder": "none",- "help": "Controls which messages include peer_id: none, assistant, or person. New installs default to none."+ "placeholder": "assistant",+ "help": "Controls which messages include peer_id: none, assistant, or person. New installs default to assistant."},"peer_prefix": {"label": "Peer Prefix",@@ -273,7 +273,7 @@"assistant","person"],- "default": "none",+ "default": "assistant","description": "Controls which session messages include peer_id."},"peer_prefix": {diff --git a/examples/openclaw-plugin/setup-helper/install.js b/examples/openclaw-plugin/setup-helper/install.jsindex af23c48d8..78eecf734 100755--- a/examples/openclaw-plugin/setup-helper/install.js+++ b/examples/openclaw-plugin/setup-helper/install.js@@ -125,7 +125,7 @@ let remoteApiKey = (process.env.OPENVIKING_API_KEY || "").trim();let remotePeerRole = (process.env.OPENVIKING_PEER_ROLE || "").trim().toLowerCase();let remotePeerPrefix = (process.env.OPENVIKING_PEER_PREFIX || "").trim();let peerRoleExplicit = !!process.env.OPENVIKING_PEER_ROLE;-if (!remotePeerRole) remotePeerRole = "none";+if (!remotePeerRole) remotePeerRole = "assistant";let remoteAccountId = (process.env.OPENVIKING_ACCOUNT_ID || "").trim();let remoteUserId = (process.env.OPENVIKING_USER_ID || "").trim();let baseUrlExplicit = baseUrlFromEnv;@@ -343,7 +343,7 @@ for (let i = 0; i < argv.length; i++) {}}-remotePeerRole = normalizePeerRole(remotePeerRole) || "none";+remotePeerRole = normalizePeerRole(remotePeerRole) || "assistant";if (!isValidPeerPrefixInput(remotePeerPrefix)) {console.error("--peer-prefix may only contain letters, digits, underscores, and hyphens");process.exit(1);@@ -373,7 +373,7 @@ function printHelp() {console.log(" --uninstall, --remove Uninstall OpenViking plugin from OpenClaw (backup config, remove plugin entries)");console.log(" --base-url=URL OpenViking server URL (default: $OPENVIKING_BASE_URL or http://127.0.0.1:1933)");console.log(" --api-key=KEY OpenViking API key (default: $OPENVIKING_API_KEY)");- console.log(" --peer-role=ROLE Peer role: none, assistant, or person (default: $OPENVIKING_PEER_ROLE or none)");+ console.log(" --peer-role=ROLE Peer role: none, assistant, or person (default: $OPENVIKING_PEER_ROLE or assistant)");console.log(" --peer-prefix=PREFIX Prefix for assistant peer_id values (default: $OPENVIKING_PEER_PREFIX)");console.log(" --account-id=ID Account ID for root API key (default: $OPENVIKING_ACCOUNT_ID)");console.log(" --user-id=ID User ID for root API key (default: $OPENVIKING_USER_ID)");@@ -545,7 +545,7 @@ function parseJsonObjectFromOutput(output) {return null;}-async function questionPeerRole(defaultValue = "none") {+async function questionPeerRole(defaultValue = "assistant") {while (true) {const answer = await question(tr("Peer Role (none/assistant/person)", "Peer Role(none/assistant/person)"),@@ -1757,7 +1757,7 @@ async function prepareStrongPluginUpgrade() {);remoteBaseUrl = upgradeRuntimeConfig.baseUrl || remoteBaseUrl;remoteApiKey = upgradeRuntimeConfig.apiKey || "";- remotePeerRole = upgradeRuntimeConfig.peer_role || remotePeerRole || "none";+ remotePeerRole = upgradeRuntimeConfig.peer_role || remotePeerRole || "assistant";remotePeerPrefix = upgradeRuntimeConfig.peer_prefix || "";remoteAccountId = upgradeRuntimeConfig.accountId || "";remoteUserId = upgradeRuntimeConfig.userId || "";@@ -2532,7 +2532,7 @@ async function configureOpenClawPlugin({}} catch { /* ignore parse errors, write all fields */ }- const peerRole = normalizePeerRole(effectiveRuntimeConfig.peer_role) || "none";+ const peerRole = normalizePeerRole(effectiveRuntimeConfig.peer_role) || "assistant";const peerVal = effectiveRuntimeConfig.peer_prefix || "";const usePeerFields = !allowedProps || allowedProps.has("peer_role") || allowedProps.has("peer_prefix");const candidates = {diff --git a/examples/openclaw-plugin/skills/install-openviking-memory/SKILL.md b/examples/openclaw-plugin/skills/install-openviking-memory/SKILL.mdindex 762030392..f94a6e036 100644--- a/examples/openclaw-plugin/skills/install-openviking-memory/SKILL.md+++ b/examples/openclaw-plugin/skills/install-openviking-memory/SKILL.md@@ -147,11 +147,13 @@ Collect 3 values through natural conversation. Be flexible: if the user gives se### 4c. `PEER_ROLE` / `PEER_PREFIX` (OPTIONAL)-Default to no peer scoping: `peer_role=none` and empty `peer_prefix`.+Default to assistant peer scoping: `peer_role=assistant` and empty `peer_prefix`.Only collect peer settings when the user explicitly wants multiple OpenClaw assistants or senders to be separated:- For assistant-specific memory routing, use `--peer-role assistant`.+- To disable peer routing, use `--peer-role none`.+- For sender-specific memory routing, use `--peer-role person`.- If they provide a prefix such as `openclaw-prod`, pass it as `--peer-prefix openclaw-prod`.- `peer_prefix` may contain only letters, digits, `_`, and `-`.@@ -402,7 +404,7 @@ Expected output:"configured": true,"slotActive": true,"health": { "ok": true },- "config": { "baseUrl": "...", "peer_role": "none", "peer_prefix": "..." }+ "config": { "baseUrl": "...", "peer_role": "assistant", "peer_prefix": "..." }}```@@ -509,7 +511,7 @@ These are the keys under `plugins.entries.openviking.config` in `openclaw.json`.| `mode` | `"remote"` (forced by plugin) | Always remote in this skill. Don't set manually. || `baseUrl` | `http://127.0.0.1:1933` | OpenViking server URL. || `apiKey` | — | API key. Optional if server has no auth. |-| `peer_role` | `"none"` | Controls whether session messages include `peer_id`: `none`, `assistant`, or `person`. |+| `peer_role` | `"assistant"` | Controls whether session messages include `peer_id`: `none`, `assistant`, or `person`. || `peer_prefix` | `""` | Optional prefix for assistant `peer_id` values when `peer_role=assistant`. || `accountId` | — | Required when `apiKey` is a root key. || `userId` | — | Required when `apiKey` is a root key. |diff --git a/examples/openclaw-plugin/skills/openviking-context-database/SKILL.md b/examples/openclaw-plugin/skills/openviking-context-database/SKILL.mdindex 690af4b17..cd0c52adf 100644--- a/examples/openclaw-plugin/skills/openviking-context-database/SKILL.md+++ b/examples/openclaw-plugin/skills/openviking-context-database/SKILL.md@@ -63,7 +63,7 @@ Core config lives under `plugins.entries.openviking.config`:|---|---:|---|| `baseUrl` | `http://127.0.0.1:1933` | OpenViking HTTP endpoint. Can also come from `OPENVIKING_BASE_URL` / `OPENVIKING_URL`. || `apiKey` | empty | Optional API key. Can also come from `OPENVIKING_API_KEY`. |-| `peer_role` | `none` | Controls which speaker identity is sent as OpenViking `peer_id`: `none`, `assistant`, or `person`. |+| `peer_role` | `assistant` | Controls which speaker identity is sent as OpenViking `peer_id`: `none`, `assistant`, or `person`. || `peer_prefix` | empty | Optional prefix for assistant `peer_id` values when `peer_role=assistant`; final value is `<prefix>_<OpenClaw ctx.agentId>`, sanitized. || `accountId` / `userId` | empty | Advanced tenant identity headers for root-key or trusted deployments. || `targetUri` | `viking://user/memories` | Default search scope for legacy targeted memory search. |diff --git a/examples/openclaw-plugin/tests/ut/config.test.ts b/examples/openclaw-plugin/tests/ut/config.test.tsindex 75b12061b..385b2a470 100644--- a/examples/openclaw-plugin/tests/ut/config.test.ts+++ b/examples/openclaw-plugin/tests/ut/config.test.ts@@ -24,7 +24,7 @@ describe("memoryOpenVikingConfigSchema.parse()", () => {expect(cfg.captureMaxLength).toBe(24000);expect(cfg.autoRecallTimeoutMs).toBe(5000);expect(cfg.recallMaxContentChars).toBe(5000);- expect(cfg.peer_role).toBe("none");+ expect(cfg.peer_role).toBe("assistant");expect(cfg.peer_prefix).toBe("");expect(cfg.emitStandardDiagnostics).toBe(false);expect(cfg.traceRecall).toBe(false);@@ -293,7 +293,7 @@ describe("memoryOpenVikingConfigSchema.parse()", () => {it("resolves peer_prefix from configured value", () => {const cfg = memoryOpenVikingConfigSchema.parse({ peer_prefix: " my-agent " });- expect(cfg.peer_role).toBe("none");+ expect(cfg.peer_role).toBe("assistant");expect(cfg.peer_prefix).toBe("my-agent");});diff --git a/examples/openclaw-plugin/tests/ut/context-engine-assemble.test.ts b/examples/openclaw-plugin/tests/ut/context-engine-assemble.test.tsindex fce02c7fa..d42a7bf93 100644--- a/examples/openclaw-plugin/tests/ut/context-engine-assemble.test.ts+++ b/examples/openclaw-plugin/tests/ut/context-engine-assemble.test.ts@@ -247,7 +247,7 @@ describe("context-engine assemble()", () => {expect(client.find).toHaveBeenCalledTimes(1);expect(client.find.mock.calls[0]![1]).toMatchObject({ contextType: "memory" });expect(client.find.mock.calls[0]![1].targetUri).toBeUndefined();- expect(client.find.mock.calls[0]![1].actorPeerId).toBeUndefined();+ expect(client.find.mock.calls[0]![1].actorPeerId).toBe("agent_session-transform-default-targets");const recorded = traces.query({turn: "latest",diff --git a/examples/openclaw-plugin/tests/ut/plugin-normal-flow-real-server.test.ts b/examples/openclaw-plugin/tests/ut/plugin-normal-flow-real-server.test.tsindex 716aedb08..e400d6447 100644--- a/examples/openclaw-plugin/tests/ut/plugin-normal-flow-real-server.test.ts+++ b/examples/openclaw-plugin/tests/ut/plugin-normal-flow-real-server.test.ts@@ -113,6 +113,18 @@ describe("plugin normal flow with healthy backend", () => {return;}+ if (+ method === "POST" &&+ url.pathname === "/api/v1/sessions"+ ) {+ const parsed = JSON.parse(body ?? "{}") as Record<string, unknown>;+ json(res, 200, {+ result: { session_id: parsed.session_id ?? "session-normal" },+ status: "ok",+ });+ return;+ }+if (method === "POST" &&/^\/api\/v1\/sessions\/[^/]+\/messages$/.test(url.pathname)@@ -278,6 +290,17 @@ describe("plugin normal flow with healthy backend", () => {expect(requests.some((entry) => entry.method === "GET" && entry.path.startsWith("/api/v1/sessions/session-normal/context")),).toBe(true);+ const createSessionRequest = requests.find(+ (entry) => entry.method === "POST" && entry.path === "/api/v1/sessions",+ );+ expect(createSessionRequest).toBeTruthy();+ expect(JSON.parse(createSessionRequest!.body ?? "{}")).toMatchObject({+ session_id: "session-normal",+ memory_policy: {+ self: { enabled: true },+ peer: { enabled: true },+ },+ });expect(requests.some((entry) => entry.method === "POST" && entry.path === "/api/v1/sessions/session-normal/messages"),).toBe(true);