将release v2.0.0版本迁移到linux版本上 - #67
Open
TriDefender wants to merge 19 commits into
Open
Conversation
- index.ts: remove process.env.ANTHROPIC_API_KEY, read from plugin config - index.ts: remove process.env.OPENCLAW_PROVIDER, use hardcoded default - bump version to 1.5.8
完成了adoresever#57 和 adoresever#48 添加了图谱修改工具和硬编码的claude模型名称
# Initial Commit for refactoring 将记忆后端更改为Neo4J,与windows侧 v2.0.0 相同
#1 `extractTurnKnowledge` now calls `markExtracted` on empty extraction → no more redundant reprocessing by later compact adoresever#2 Added `isTurnExtracted()` guard at top of `extractTurnKnowledge` → if compact already marked the turn, the async per-turn extraction skips the redundant LLM call adoresever#3 Restored normalizeMessageContent() on both assemble() return paths — wraps string/null content into [{type:"text"}], patches malformed blocks adoresever#4 Restored prompt param on `assemble()` + fresh `recaller.recall(cleanPrompt(prompt))` with cache fallback adoresever#5 Restored `sliceLastTurn()` — last turn verbatim, prev turns text-only (strips tool_use/tool_result), truncates >6000-char tool_results Also removed dead code and redundant calls
Fixed errors of tools not being declared
增加了由Graph-Memory 1.x.x版本迁移到2.0.0版本的迁移手册和脚本,基于真实经验而编写(不包含Neo4j环境安装组件)
Contributor
Author
|
@adoresever 麻烦看一下,有问题随时联系我 |
Contributor
Author
|
目前该版本已经进入我的实际使用环境,暂时没有出现失忆,或跨版本数据不兼容等现象。 下一步可能参考其他相似工具添加时间敏感的参数,做到指定日期范围检索或设定知识过期归档。 目前缺陷
|
adoresever
requested changes
Aug 1, 2026
adoresever
left a comment
Owner
There was a problem hiding this comment.
这是桌面/Neo4j 2.0 产品线的大规模迁移,不应直接替换当前插件主线或以现有 dev 当作稳定桌面分支。当前变更删除了大量 SQLite/plugin 回归测试,Neo4j 集成测试也不能作为默认 CI 的完整保护;安装流程还依赖 sudo、WSL 和外部下载。请先整理为独立的 desktop-2.0 分支/发布线,保留插件测试资产,并提供可在 CI 运行的 Neo4j 集成测试、迁移回滚、无 sudo 安装路径和版本边界说明。满足这些条件后再按桌面版本评审。
Contributor
Author
|
@adoresever 这玩意就是直接逆向你windows安装包做的,你有没有相关的源码啊 |
# graph-memory-pro 发布线说明
## 发布线划分
| 发布线 | 分支 | 存储 | 状态 | 目标用户 |
| --- | --- | --- | --- | --- |
| **v1.x mainline** | `main` / `dev` | SQLite + FTS5 | 维护中 | Windows 桌面 / 无 Neo4j 环境 |
| **v2.0 desktop-2.0** | `2.0` | Neo4j 5 + APOC + GDS | 新增 | Linux 工作站 / 服务器 |
v2.0 是 Windows v2.0.0 桌面包的 Linux 对应版本。**不应直接合并到 `dev`** —— `dev` 保留 v1.x SQLite 主线,v2.0 作为并行发布线演进。
合并后建议在仓库维护层面:
- `dev` 继续作为 v1.x 主线,保留所有 SQLite 回归测试
- 从 v2.0 起,新分支命名遵循 `2.x`、`2.x-next` 等
- 跨发布线的 cherry-pick 需显式标注(PR 标题加 `[2.0]` / `[1.x]`)
## 版本号约定
`package.json` 的 `version` 字段:
```
v1.x 主线: 1.x.y
v2.0 发布线: 2.0.z # 当前 2.0.0
未来 v2.x: 2.x.y
```
OpenClaw 插件 ID:
- v1.x: `graph-memory`
- v2.0: `graph-memory-pro`
二者可在同一 OpenClaw 实例共存(不同的 `plugins.entries` key),通过 `slots.contextEngine` 切换激活。
## 测试资产边界
| 测试套件 | v1.x 主线 | v2.0 发布线 |
| --- | --- | --- |
| SQLite 回归(store/migration/graph/recall/embed/llm-guard/assemble) | ✅ 必须保留 | 不适用(已迁移到 Neo4j) |
| 纯逻辑单元(normalize-name / clean-prompt / slice-last-turn 等) | ✅ 共享 | ✅ 共享 |
| Neo4j 集成(store/graph/assemble/recall) | 不适用 | ✅ 新增,CI 跑 |
**v2.0 删除 SQLite 测试的合理性**:存储层从 SQLite 完全迁移到 Neo4j(`AGENTS.md` 反模式清单禁止重新引入 SQLite)。原测试已由等价的 Neo4j 集成测试替换(见 `test/integration.*.test.ts`)。
**v2.0 不应删除 v1.x 的 SQLite 测试文件**:本发布线的 PR 不应触碰 `dev` 分支的 SQLite 测试。如果 v2.0 与 v1.x 在某点合并,v1.x 的 SQLite 测试应原样保留。
## CI 集成
`.github/workflows/ci.yml` 定义 4 个 job:
1. **typecheck** — `tsc --noEmit`
2. **unit-tests** — 不需 Neo4j,所有 PR 强制跑
3. **integration-tests** — Docker Neo4j 5.24.2 + APOC + GDS service container,跑 `NEO4J_INTEGRATION=1` 启用的集成测试
4. **shellcheck** — `bash -n` 语法检查 setup 脚本
集成测试 job 在 PR 改动 `src/store/`、`src/graph/`、`test/integration.*.test.ts` 时必须通过,否则阻塞合并。
## Neo4j 自启动方案(无 sudo)
`setup-graph-memory-pro.sh` 内嵌三级降级的无 sudo 自启动配置(Step 3.5):
1. **systemd --user unit**(首选)— `~/.config/systemd/user/graph-memory-pro-neo4j.service`
- 提供 `systemctl --user {start|stop|status}` 管理接口
- 尝试 `loginctl enable-linger`(无需 sudo 的 polkit 配置下成功;否则仅登录后启动)
2. **cron @reboot**(兜底)— 用户级 crontab
- 系统启动时 cron 守护进程自动拉起
- 用 marker `# gmp-neo4j-autostart` 标记,幂等去重
- 不依赖 linger,最兼容
3. **shell rc hook**(最低保障)— `~/.bashrc` / `~/.zshrc`
- 仅在 systemd 与 cron 均不可用时降级
- 用 `pgrep` 幂等,避免重复启动
`--skip-autostart` 跳过此 step。`--uninstall` 自动清理所有上述条目。
### 唯一需要 sudo 的步骤
- 安装 Java 17(Neo4j 运行依赖)—— 文档提供无 sudo 替代:`sdkman!`
- 安装 jq(配置写入)—— 文档提供无 sudo 替代:静态二进制到 `~/.local/bin`
- `loginctl enable-linger`(可选,让 systemd --user 开机即起)—— 不做也能用(cron 兜底)
`--assume-deps` 跳过所有依赖检查,适合预配置环境。
## WSL 使用边界
| 场景 | WSL 必需 | 说明 |
| --- | --- | --- |
| 纯 Linux 全新安装 | ❌ | `bash setup-graph-memory-pro.sh` 即可 |
| Windows → Linux 迁移 | ✅ | 用 `migrate/install-wsl.sh` 一键迁移(访问 Windows 侧的旧 SQLite) |
| Linux 上的 Windows v2.0 用户 | ❌ | 直接用 `setup-graph-memory-pro.sh`,无需 WSL |
`migrate/install-wsl.sh` 与 `migrate/Migrate.md` 仅用于 Windows → Linux 的 v1.x → v2.0 数据迁移路径,**不是常规安装流程**。
## 回滚
`migrate/rollback.py` 提供 v2.0 → v1.x 的回滚:
- 还原 `openclaw.json`(从 `.backup.*`)
- 禁用 `graph-memory-pro`,启用 `graph-memory`
- 校验旧 SQLite DB 可读
Neo4j 数据**不删除**(保留以备再次迁移)。如需彻底清理见 rollback 输出说明。
Contributor
Author
|
@adoresever CI问题解决了,请求重新review,另外麻烦看下怎么pr到独立的分支 |
Owner
|
明天早上看一下,linux2.0的版本吗?
…On Sun, Aug 2, 2026 at 9:18 AM TriDefender ***@***.***> wrote:
@TriDefender <https://github.com/TriDefender> requested your review on:
adoresever/graph-memory#67
<#67> 将release
v2.0.0版本迁移到linux版本上.
—
Reply to this email directly, view it on GitHub
<#67?email_source=notifications&email_token=BIAPQFZVMQL5FAKIJU47ZLL5H45SJA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTEOBYGQ4DGNZQGE2DNJTSMVQXG33OWBZGK5TJMV3V64TFOF2WK43UMVSKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#event-28848370146>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BIAPQFZAO6WW4EMWEXHLFAT5H45SJAVCNFSNUABGKJSXA33TNF2G64TZHMYTCNZYGMYTEMZZGU5US43TOVSTWNJQGM2DCOJUGI4TPILWAI>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/BIAPQFZFOEJDOW5K6KN4E2L5H45SJA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTEOBYGQ4DGNZQGE2DNJTSMVQXG33OWBZGK5TJMV3V64TFOF2WK43UMVSKKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/BIAPQF3NPDUF43HALHYFYC35H45SJA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTEOBYGQ4DGNZQGE2DNJTSMVQXG33OWBZGK5TJMV3V64TFOF2WK43UMVSKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because your review was requested.Message ID:
***@***.***>
|
Accepted PR 66 adoresever#66
Contributor
Author
对,是的,刚才顺手merge了 #66 的内容到新的版本内 |
Contributor
Author
|
@adoresever 哥们麻烦看一下 |
Owner
src/engine/llm.ts:142 硬编码了 max_tokens: 2000,这个是把reasoning tokens算入其中的,而且模型动不动雷霆长思考导致全部报错
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
经过对安装包的逆向分析,将release 2.0版本迁移到了linux系统上并提供了一键安装和跨版本数据库迁移脚本。
本次同时修复了之前的部分硬编码模型名称 ( #48 ), 添加了oauth授权登录 ( #56 )和 支持了对记忆节点的patch式更新 ( #57 )