huawei-cloud-openviking-agent-integration
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHuawei Cloud Agent Integration (OpenViking Long-Term Memory)
华为云Agent集成(OpenViking长期记忆)
Overview
概述
Integrate and unbind OpenViking long-term memory with coding agents running in bwrap sandboxes under . Each agent uses its native mechanism — MCP ( tools) or the HTTP memory provider — so the integration survives agent upgrades and matches how each agent natively consumes memory.
/root/job-envs/sandboxes/mcp__openviking__*Integration writes are template-level persistent: config is injected into the agent's / config templates under , so a sandbox (which re-runs ) preserves the integration.
start.sh/root/template/<agent>/stop + startstart.sh将OpenViking长期记忆与运行在目录下bwrap沙箱中的编码Agent进行集成和解绑。每个Agent采用其原生机制——MCP(工具)或HTTP内存提供者,因此集成效果可在Agent升级后保留,且与各Agent原生的内存使用方式一致。
/root/job-envs/sandboxes/mcp__openviking__*集成写入为模板级持久化:配置会注入到目录下Agent的或配置模板中,因此沙箱的操作(会重新执行)可保留集成效果。
/root/template/<agent>/start.shstop + startstart.shWhat Good Looks Like
预期效果
- reports all 7 agents as
scripts/status.sh(template + live).✓ - passes the full MCP handshake (initialize → tools/list → health) against
scripts/verify_mcp.sh.http://127.0.0.1:1933/mcp - Restarting a sandbox does not lose the integration (template-level persistence, not live-only).
- Agents surface OpenViking tools natively: for MCP-based agents, memory provider for JiuwenSwarm.
mcp__openviking__* - Unbinding removes every trace: template blocks, live config, skills/AGENTS.md, and config backups.
- User authorization () is required for every mutation — nothing changes silently.
confirm
- 报告所有7种Agent状态为
scripts/status.sh(模板+实时)。✓ - 通过针对
scripts/verify_mcp.sh的完整MCP握手(初始化→工具/列表→健康检查)。http://127.0.0.1:1933/mcp - 重启沙箱不会丢失集成效果(模板级持久化,而非仅实时生效)。
- Agent原生展示OpenViking工具:基于MCP的Agent显示,JiuwenSwarm显示内存提供者。
mcp__openviking__* - 解绑操作会清除所有痕迹:模板块、实时配置、skills/AGENTS.md以及配置备份。
- 每次变更操作均需用户授权()——无静默变更。
confirm
Supported Agents
支持的Agent
| Agent | Native mechanism | Persistence |
|---|---|---|
| CodeArts CLI | MCP in | Template start.sh + live sandbox |
| OpenCode | Official | Template start.sh (plugin install) |
| OpenClaw | Official OpenViking plugin (npm) + | Template start.sh |
| Hermes | MCP + MCP SDK ( | Template start.sh + live sandbox |
| JiuwenSwarm | MCP + native memory provider | Template start.sh + live config.yaml |
| KimiCode | MCP via | Template start.sh + live mcp.json |
| DeepSeek Harness (dsh) | Built-in | Template start.sh |
Per-agent config files, injection blocks, and recall quotas: references/agent-configs.md.
| Agent | 原生机制 | 持久化方式 |
|---|---|---|
| CodeArts CLI | | 模板start.sh + 实时沙箱 |
| OpenCode | 官方 | 模板start.sh(插件安装) |
| OpenClaw | 官方OpenViking插件(npm) + | 模板start.sh |
| Hermes | MCP + MCP SDK( | 模板start.sh + 实时沙箱 |
| JiuwenSwarm | MCP + 原生内存提供者 | 模板start.sh + 实时config.yaml |
| KimiCode | 通过 | 模板start.sh + 实时mcp.json |
| DeepSeek Harness (dsh) | 内置 | 模板start.sh |
各Agent的配置文件、注入块和召回配额详情:references/agent-configs.md。
Prerequisites
前置条件
- OpenViking server running and accessible (default ):
http://127.0.0.1:1933bashcurl -s http://127.0.0.1:1933/health # {"status":"ok","healthy":true,"version":"0.4.x","auth_mode":"dev"} - Agent sandboxes exist under (managed by job-env-manager).
/root/job-envs/sandboxes/ - Host tools: ,
curl,python3. OpenCode/OpenClaw additionally needbash(Huawei Cloud mirror configured by the skill).npm - This skill operates on local bwrap sandboxes only — no Huawei Cloud IAM policies required (see references/iam-policies.md).
- OpenViking服务器已运行且可访问(默认地址):
http://127.0.0.1:1933bashcurl -s http://127.0.0.1:1933/health # {"status":"ok","healthy":true,"version":"0.4.x","auth_mode":"dev"} - Agent沙箱存在于目录下(由job-env-manager管理)。
/root/job-envs/sandboxes/ - 主机工具:、
curl、python3。OpenCode/OpenClaw额外需要bash(本技能会配置华为云镜像)。npm - 本技能仅针对本地bwrap沙箱操作——无需华为云IAM策略(详见references/iam-policies.md)。
参数确认 (Required Inputs)
参数确认(必填输入)
| Parameter | Required | Description | Example |
|---|---|---|---|
| Yes (unless | Target agent: | |
| Yes (unless | Operate on all 7 agents | |
| No | OpenViking server URL (default | |
| No | OpenViking API key (dev mode needs none). Never echo in chat or logs | |
| No | Show changes without applying them | |
| No | Skip authorization prompt (automation only) | |
| No | | |
| 参数 | 是否必填 | 描述 | 示例 |
|---|---|---|---|
| 是(除非使用 | 目标Agent: | |
| 是(除非使用 | 对所有7种Agent执行操作 | |
| 否 | OpenViking服务器URL(默认 | |
| 否 | OpenViking API密钥(开发模式无需密钥)。禁止在聊天或日志中回显 | |
| 否 | 显示变更内容但不实际执行 | |
| 否 | 跳过授权提示(仅用于自动化场景) | |
| 否 | | |
Dependencies
依赖项
- OpenViking server ≥ 0.4.x on (MCP endpoint
127.0.0.1:1933, streamable HTTP)./mcp - npm + Huawei Cloud mirror (or equivalent) for OpenCode / OpenClaw plugin installs.
registry.npmmirror.com - Python MCP SDK () injected by the skill for Hermes — not in the base template image.
mcp==1.29.0 - dsh CLI () for DeepSeek Harness profile patches (
/root/runtime/deepseek-harness/bin/dshverification).--dump-config - API script conventions are Bash + +
curlonly.python3
- OpenViking服务器 ≥ 0.4.x,运行在(MCP端点
127.0.0.1:1933,支持流式HTTP)。/mcp - npm + 华为云镜像(或等效镜像),用于OpenCode / OpenClaw插件安装。
registry.npmmirror.com - Python MCP SDK(),由本技能注入到Hermes中——基础模板镜像未包含该依赖。
mcp==1.29.0 - dsh CLI(),用于DeepSeek Harness配置文件补丁的验证(
/root/runtime/deepseek-harness/bin/dsh)。--dump-config - API脚本遵循Bash + +
curl的约定。python3
核心命令
核心命令
| 功能 | 命令 |
|---|---|
| 查看集成状态 | |
| 验证 MCP 端点 | |
| 集成单个 Agent | |
| 集成全部 Agent | |
| 解绑单个 Agent | |
| 解绑全部 Agent | |
| 功能 | 命令 |
|---|---|
| 查看集成状态 | |
| 验证MCP端点 | |
| 集成单个Agent | |
| 集成全部Agent | |
| 解绑单个Agent | |
| 解绑全部Agent | |
Workflow
工作流程
Task 1: Check Integration Status
任务1:检查集成状态
bash
SKILL_DIR=/root/.agents/skills/huawei-cloud-openviking-agent-integration
$SKILL_DIR/scripts/status.sh # human-readable
$SKILL_DIR/scripts/status.sh --json # machine-readableStatus values per agent:
- — fully integrated and active
template + live - — will activate on next restart
template only - — will be lost on restart (needs template fix)
live only
bash
SKILL_DIR=/root/.agents/skills/huawei-cloud-openviking-agent-integration
$SKILL_DIR/scripts/status.sh # 人类可读格式
$SKILL_DIR/scripts/status.sh --json # 机器可读格式各Agent的状态值:
- — 完全集成且处于活跃状态
template + live - — 下次重启后将激活
template only - — 重启后会丢失(需修复模板)
live only
Task 2: Verify MCP Endpoint
任务2:验证MCP端点
bash
$SKILL_DIR/scripts/verify_mcp.shPerforms the full MCP protocol handshake (initialize → notifications/initialized → tools/list → tools/call health) and lists the OpenViking tools (find, search, recall, read, list, remember, add_resource, …).
bash
$SKILL_DIR/scripts/verify_mcp.sh执行完整的MCP协议握手(初始化→notifications/initialized→工具/列表→工具/call health),并列出OpenViking工具(find、search、recall、read、list、remember、add_resource等)。
Task 3: Integrate a Single Agent
任务3:集成单个Agent
bash
$SKILL_DIR/scripts/integrate.sh --agent opencode # interactive (asks for confirmation)
$SKILL_DIR/scripts/integrate.sh --agent opencode --endpoint URL --api-key KEY
$SKILL_DIR/scripts/integrate.sh --agent opencode --dry-run # preview only
$SKILL_DIR/scripts/integrate.sh --agent opencode --yes # automation onlybash
$SKILL_DIR/scripts/integrate.sh --agent opencode # 交互式(需确认)
$SKILL_DIR/scripts/integrate.sh --agent opencode --endpoint URL --api-key KEY
$SKILL_DIR/scripts/integrate.sh --agent opencode --dry-run # 仅预览
$SKILL_DIR/scripts/integrate.sh --agent opencode --yes # 仅自动化场景Task 4: Integrate All Agents
任务4:集成全部Agent
bash
$SKILL_DIR/scripts/integrate.sh --allbash
$SKILL_DIR/scripts/integrate.sh --allTask 5: Unbind a Single Agent
任务5:解绑单个Agent
bash
$SKILL_DIR/scripts/unbind.sh --agent opencode
$SKILL_DIR/scripts/unbind.sh --agent opencode --dry-run
$SKILL_DIR/scripts/unbind.sh --agent opencode --yesbash
$SKILL_DIR/scripts/unbind.sh --agent opencode
$SKILL_DIR/scripts/unbind.sh --agent opencode --dry-run
$SKILL_DIR/scripts/unbind.sh --agent opencode --yesTask 6: Unbind All Agents
任务6:解绑全部Agent
bash
$SKILL_DIR/scripts/unbind.sh --allbash
$SKILL_DIR/scripts/unbind.sh --allTask 7: Rebuild OpenClaw Sandbox (Apply Template Changes)
任务7:重建OpenClaw沙箱(应用模板变更)
OpenClaw's gateway runs in an ephemeral bwrap; re-runs , which reinstalls the plugin and applies endpoint config. Do:
stop + startstart.sh- (poll until
curl -s -X POST $BASE/envs/openclaw/stop)stopped - (poll until
curl -s -X POST $BASE/envs/openclaw/start)running - Verify: reports endpoint configured
scripts/integrate.sh --agent openclaw --dry-run
Full restart/rebuild scripts (including the fallback) and live-config verification from outside bwrap: references/related-commands.md.
stop → delete → create → deployOpenClaw的网关运行在临时bwrap沙箱中;会重新执行,从而重新安装插件并应用端点配置。操作步骤:
stop + startstart.sh- (轮询直到状态为
curl -s -X POST $BASE/envs/openclaw/stop)stopped - (轮询直到状态为
curl -s -X POST $BASE/envs/openclaw/start)running - 验证:报告端点已配置
scripts/integrate.sh --agent openclaw --dry-run
完整的重启/重建脚本(包括备选方案)以及沙箱外的实时配置验证方法:references/related-commands.md。
stop → delete → create → deployAuthorization Model
授权模型
Both and require explicit user confirmation before modifying any agent configuration:
integrate.shunbind.sh━━━ Authorization Required ━━━
Action: Integrate OpenViking MCP
Agent: opencode
Details: Add OpenViking MCP to OpenCode template start.sh (persistent across restarts)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Type 'confirm' to proceed:- The user must type exactly ; any other input aborts.
confirm - /
--yesskips the prompt (for automation only).-y - shows what would happen without requiring authorization.
--dry-run - Never integrate or unbind without explicit user confirmation — see references/guardrails.md for the full rules.
integrate.shunbind.sh━━━ 需要授权 ━━━
操作: 集成OpenViking MCP
Agent: opencode
详情: 将OpenViking MCP添加到OpenCode模板start.sh中(重启后仍保留)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
输入'confirm'以继续:- 用户必须准确输入;其他输入将终止操作。
confirm - /
--yes可跳过提示(仅用于自动化场景)。-y - 会展示预期变更,无需授权。
--dry-run - 未经用户明确确认,不得执行集成或解绑操作——完整规则详见references/guardrails.md。
Safety Rules
安全规则
- Authorization is mandatory — never integrate or unbind without explicit user confirmation.
- Do not fabricate integration state — always run to verify before reporting.
status.sh - Never edit agent configs directly on the host — all changes go through the skill scripts.
- No API keys in logs — values must never appear in output or logs.
--api-key - Dry-run first for unfamiliar targets.
- Slow responses are not an integration bug — check model API TTFB before blaming MCP (see references/troubleshooting.md).
- 授权是强制性的——未经用户明确确认,不得执行集成或解绑操作。
- 不得伪造集成状态——报告前必须运行进行验证。
status.sh - 不得直接在主机上编辑Agent配置——所有变更必须通过本技能脚本执行。
- 日志中不得包含API密钥——的值不得出现在输出或日志中。
--api-key - 针对不熟悉的目标,先执行dry-run。
- 响应缓慢并非集成问题——在归咎于MCP前,先检查模型API的TTFB(详见references/troubleshooting.md)。
Validation Rules
验证规则
Quick verification after any integration or unbinding:
bash
$SKILL_DIR/scripts/status.sh # all agents green
$SKILL_DIR/scripts/verify_mcp.sh # MCP handshake passesAcceptance criteria for each workflow (integrate/unbind per agent): references/acceptance-criteria.md.
Step-by-step verification methods: references/verification-method.md.
集成或解绑操作后的快速验证:
bash
$SKILL_DIR/scripts/status.sh # 所有Agent状态为绿色
$SKILL_DIR/scripts/verify_mcp.sh # MCP握手通过各工作流程(集成/解绑单个Agent)的验收标准:references/acceptance-criteria.md。
分步验证方法:references/verification-method.md。
References
参考文档
| Document | Description |
|---|---|
| agent-configs.md | Per-agent config files, injection blocks, persistence patterns, recall quotas, MCP tools |
| guardrails.md | Safety and authorization rules |
| troubleshooting.md | Common failure scenarios, slow-response diagnostics (model TTFB vs network vs MCP), and fixed unbind cleanup issues |
| iam-policies.md | Equivalent access controls (no Huawei Cloud IAM needed) |
| verification-method.md | Step-by-step verification for each workflow |
| related-commands.md | Restart/rebuild scripts, inspection commands, live-config verification |
| acceptance-criteria.md | Acceptance criteria for integration/unbinding |
| demo/example-input.json | Example input for the integration workflow |
| 文档 | 描述 |
|---|---|
| agent-configs.md | 各Agent的配置文件、注入块、持久化模式、召回配额、MCP工具 |
| guardrails.md | 安全与授权规则 |
| troubleshooting.md | 常见故障场景、响应缓慢诊断(模型TTFB vs 网络 vs MCP)、已修复的解绑清理问题 |
| iam-policies.md | 等效访问控制(无需华为云IAM) |
| verification-method.md | 各工作流程的分步验证方法 |
| related-commands.md | 重启/重建脚本、检查命令、实时配置验证 |
| acceptance-criteria.md | 集成/解绑操作的验收标准 |
| demo/example-input.json | 集成工作流程的示例输入 |
Scripts
脚本说明
scripts/status.sh Check integration status for all agents (--agent, --json)
scripts/verify_mcp.sh Verify MCP endpoint via full protocol handshake
scripts/integrate.sh Integrate single agent or all agents (--agent/--all, --dry-run, --yes)
scripts/unbind.sh Unbind single agent or all agents (--agent/--all, --dry-run, --yes)
scripts/unset.sh Alias for unbind.sh (backward-compatibility wrapper)
scripts/common.sh Shared helpers (logging, confirmation, backups) — sourced by the othersAll scripts are idempotent and create backups before each modification.
.bak.<timestamp>scripts/status.sh 检查所有Agent的集成状态(支持--agent、--json参数)
scripts/verify_mcp.sh 通过完整协议握手验证MCP端点
scripts/integrate.sh 集成单个或全部Agent(支持--agent/--all、--dry-run、--yes参数)
scripts/unbind.sh 解绑单个或全部Agent(支持--agent/--all、--dry-run、--yes参数)
scripts/unset.sh unbind.sh的别名(向后兼容包装器)
scripts/common.sh 共享辅助函数(日志、确认、备份)——被其他脚本调用所有脚本均具有幂等性,每次修改前会创建备份文件。
.bak.<timestamp>