Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions docs/en/agent-integrations/04-other-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The repo also ships several community/experimental plugins beyond the headline C

Source: [examples/codex-memory-plugin](https://github.com/volcengine/OpenViking/tree/main/examples/codex-memory-plugin)

[Codex](https://github.com/openai/codex) integration with lifecycle hooks and explicit MCP tools. It follows the same install-first shape as the [Claude Code integration](./02-claude-code.md), but uses Codex hook events.
[Codex](https://github.com/openai/codex) integration with lifecycle hooks plus OpenViking's native `/mcp` endpoint for explicit tools. It follows the same install-first shape as the [Claude Code integration](./02-claude-code.md), but uses Codex hook events.

### Install

Expand All @@ -16,7 +16,9 @@ Recommended one-line installer:
bash <(curl -fsSL https://raw.githubusercontent.com/volcengine/OpenViking/main/examples/codex-memory-plugin/setup-helper/install.sh)
```

It installs from a local `openviking-plugins-local` marketplace, enables `openviking-memory@openviking-plugins-local`, sets `features.plugin_hooks = true`, and uses `~/.openviking/ovcli.conf` for the OpenViking connection when present.
It installs from a local `openviking-plugins-local` marketplace, enables `openviking-memory@openviking-plugins-local`, sets `features.plugin_hooks = true`, optionally registers `mcp_servers.openviking` against the OpenViking server's native `/mcp` endpoint, and uses `~/.openviking/ovcli.conf` for the OpenViking connection when present.

Native MCP is recommended but optional. In an interactive shell the installer asks whether to enable it; set `OPENVIKING_CODEX_ENABLE_MCP=0` for a hooks-only install, which removes the installer-managed `mcp_servers.openviking` entry if one exists.

Manual setup:

Expand Down Expand Up @@ -55,6 +57,21 @@ enabled = true
EOF
```

Optional native MCP registration:

```toml
[mcp_servers.openviking]
url = "https://ov.example.com/mcp"
bearer_token_env_var = "OPENVIKING_API_KEY"
startup_timeout_sec = 30
tool_timeout_sec = 120

[mcp_servers.openviking.http_headers]
"X-OpenViking-Account" = "default"
"X-OpenViking-User" = "<your-user>"
"X-OpenViking-Agent" = "codex"
```

For local development, pre-populate Codex's cache so it resolves immediately:

```bash
Expand All @@ -63,7 +80,7 @@ mkdir -p "$INSTALL_DIR"
cp -R "$(pwd)/examples/codex-memory-plugin" "$INSTALL_DIR/0.4.0"
```

`npm install && npm run build` is only required when editing the TypeScript MCP server source; the checked-in plugin already includes `servers/memory-server.js`.
No npm install or build step is required; the plugin scripts are plain Node.js modules and explicit MCP tools come from OpenViking's native `/mcp` endpoint.

### Configure

Expand All @@ -78,15 +95,17 @@ Use `~/.openviking/ovcli.conf`, shared with the `ov` CLI:
}
```

Environment variables win over files. Use `OPENVIKING_CLI_CONFIG_FILE` for an alternate `ovcli.conf`; `OPENVIKING_API_KEY` and `OPENVIKING_BEARER_TOKEN` are equivalent.
Environment variables win over files for hooks. Use `OPENVIKING_CLI_CONFIG_FILE` for an alternate `ovcli.conf`; `OPENVIKING_API_KEY` and `OPENVIKING_BEARER_TOKEN` are equivalent.

Codex's native HTTP MCP transport does not read `ovcli.conf`, so the installer writes a literal `/mcp` URL and header block to `~/.codex/config.toml`. Keep the configured bearer env var, usually `OPENVIKING_API_KEY`, set when starting Codex.

### What it does

- Auto-recall on `UserPromptSubmit`
- Incremental capture on `Stop`
- Commit before compaction on `PreCompact`
- Orphan cleanup on `SessionStart` startup/clear
- Manual MCP tools: `openviking_recall`, `openviking_store`, `openviking_forget`, `openviking_health`
- Native OpenViking MCP tools such as `search`, `read`, `list`, `store`, `add_resource`, `grep`, `glob`, `forget`, and `health`

Full behavior and validation details are in the [plugin README](https://github.com/volcengine/OpenViking/tree/main/examples/codex-memory-plugin).

Expand Down
25 changes: 17 additions & 8 deletions docs/zh/agent-integrations/04-other-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,29 @@

仓库里还附带了几个未在 Claude Code 和 OpenClaw 主集成中介绍的社区/实验性插件。它们在目标 runtime、集成深度和维护状态上各有差异,使用前请先阅读各自的 README。

## Codex 记忆 MCP Server
## Codex 记忆插件

源码:[examples/codex-memory-plugin](https://github.com/volcengine/OpenViking/tree/main/examples/codex-memory-plugin)

面向 [Codex](https://github.com/openai/codex) 的最小化 MCP-only 服务,刻意保持窄边界
面向 [Codex](https://github.com/openai/codex) 的生命周期 hook 集成,并把显式工具接到 OpenViking server 原生 `/mcp`

- 不挂生命周期 hook
- 不跑后台捕获 worker
- 不写 `~/.codex`
- 不留 build 产物
- `UserPromptSubmit` 自动召回并注入相关记忆
- `Stop` 增量追加对话 turn 到同一个 OpenViking session
- `PreCompact` 在 Codex 压缩上下文前提交 session,触发记忆抽取
- `SessionStart(startup|clear)` 用 active-window heuristic 和 idle-TTL sweep 清理 orphan session
- 显式工具不再由插件自带 stdio server 提供,而是统一走 OpenViking server 的 `/mcp`

Codex 拿到的只是几个显式记忆工具:`find`、`remember`,外加几个辅助。
推荐安装:

如果你只需要 Codex 显式调用记忆(不需要自动召回/捕获),这是最简方案。
```bash
bash <(curl -fsSL https://raw.githubusercontent.com/volcengine/OpenViking/main/examples/codex-memory-plugin/setup-helper/install.sh)
```

安装器会启用本地 `openviking-memory@openviking-plugins-local` 插件、打开 `features.plugin_hooks = true`,并可选地在 `~/.codex/config.toml` 写入 `mcp_servers.openviking`,指向 OpenViking server 的原生 `/mcp`。交互式运行时会询问是否启用 MCP;如果只想装 hooks,可设置 `OPENVIKING_CODEX_ENABLE_MCP=0`,已有的安装器管理的 `mcp_servers.openviking` 会被移除。

hook 会读取 `~/.openviking/ovcli.conf`;但 Codex 的 HTTP MCP transport 不读这个文件,所以 MCP URL 和 account/user/agent header 需要落到 Codex config 里。

原生 `/mcp` 暴露的工具包括 `search`、`read`、`list`、`store`、`add_resource`、`grep`、`glob`、`forget`、`health`(具体以 server 版本为准)。

## OpenCode 插件

Expand Down
6 changes: 2 additions & 4 deletions examples/codex-memory-plugin/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@
"codex"
],
"hooks": "./hooks/hooks.json",
"mcpServers": "./.mcp.json",
"interface": {
"displayName": "OpenViking Memory",
"shortDescription": "Long-term semantic memory for Codex",
"longDescription": "Hooks Codex's lifecycle to keep an external semantic memory: recall relevant memories on each UserPromptSubmit; on every Stop (turn end) append the new user/assistant turns to a long-lived OpenViking session keyed by codex session_id; on PreCompact commit that session so OV's extractor produces durable memories before context is summarized; on SessionStart(source=clear) commit any orphaned prior session before /clear discards it. Also exposes explicit MCP tools (openviking_recall, openviking_store, openviking_forget, openviking_health) for manual use.",
"longDescription": "Hooks Codex's lifecycle to keep an external semantic memory: recall relevant memories on each UserPromptSubmit; on every Stop (turn end) append new transcript turns to a long-lived OpenViking session keyed by codex session_id; on PreCompact commit that session so OV's extractor produces durable memories before context is summarized; on SessionStart(source=startup|clear) commit orphaned prior sessions with the active-window heuristic and idle-TTL sweep. The installer also registers OpenViking's native /mcp endpoint for explicit tools such as search, read, store, add_resource, grep, glob, forget, and health.",
"developerName": "OpenViking",
"category": "Productivity",
"capabilities": [
"Memory recall",
"Auto memory capture",
"Manual memory storage",
"Manual memory deletion"
"Native OpenViking MCP tools"
],
"websiteURL": "https://github.com/volcengine/OpenViking"
}
Expand Down
4 changes: 0 additions & 4 deletions examples/codex-memory-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
node_modules/
servers/*.mjs
servers/*.js
!servers/memory-server.js
*.tsbuildinfo
13 changes: 0 additions & 13 deletions examples/codex-memory-plugin/.mcp.json

This file was deleted.

8 changes: 4 additions & 4 deletions examples/codex-memory-plugin/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ arbitrarily-orphaned state files accumulate.

**Known limitation**: if the user never starts another codex on this
machine, no sweep ever runs and the OV session stays open server-side
forever. Accepted. Future work could add an MCP tool
`openviking_commit_pending` so the model can commit explicitly.
forever. Accepted. Future work could add a native server MCP tool to commit
pending Codex sessions explicitly.

## Stop hook — append only, no commit

Expand Down Expand Up @@ -223,8 +223,8 @@ proven first.
## Open questions / future work

- **Phase 2 resume context inject** (above).
- **MCP tool `openviking_commit_pending`**: explicit commit for the model
to call, useful when user knows they're about to exit.
- **Native MCP commit-pending tool**: explicit commit for the model to call,
useful when user knows they're about to exit.
- **Subagent hook events**: kimicode has them, codex doesn't yet.
When codex adds them, we should hook to keep subagent memory threads
separate from main session.
Expand Down
Loading