Repository navigation
Conversation
Requested by @GodD6366. Register OpenClaw locally and in WSL, maintain its magpie provider/catalog and default primary, and restore only values magpie owns on disconnect. Respect config paths, JSON5 and read-only configs. Keep OpenClaw's official colours in the Agents tab. Verified in a temporary HOME with pinned Go caches: OpenClaw regressions, go vet, macOS build, Linux nogui build and Windows cross-build. The touched GUI and ja/de locale tests pass in Chromium and WebKit (10 tests). TestOpenClawRegistered fails with "OpenClaw is missing from Agents" when the registration is removed, then passes after restoring it. The full nogui Go suite fails only TestPluginHTTP2TakesTheProxy on this machine (Bun 1.3.14, status 0 RangeError). The same failure reproduces on unmodified upstream main f1821f4.
Add the vendor installers for macOS/Linux and Windows so an uninstalled OpenClaw is not filtered out of Install another agent. Listing it does not create or change OpenClaw's configuration.\n\nThe fresh-home regression failed without the installer entry on all three platforms and passes with it; the full agent package and an isolated web API/UI smoke check also pass.
|
Fixed the fresh-machine discovery gap in 9f6ccef: an uninstalled/unconfigured OpenClaw now appears under “Install another agent”, with the official coloured icon and vendor installer command (macOS/Linux shell, Windows PowerShell). Root cause: Verification:
Installation commands are copied from OpenClaw’s official installation guide. No installer was executed and no live agent configuration was changed. The new UI preview run completed successfully and the PR description now includes its screenshots and video. I downloaded and inspected the published media: the installation screenshot and the video at approximately 00:05 visibly show OpenClaw, its red coloured icon and the vendor installation command under “Install another agent”. The sandbox does not install OpenClaw, so the installed-agent connection flow remains outside this recording. |
Merge upstream main at 6d7b574, retaining its Claude sign-in verification commands and the OpenClaw command. Add the two OpenClaw error translations required by upstream Traditional Chinese support. Verified in temporary HOME with pinned Go caches: go vet, macOS build, Linux nogui build, Windows build, all agent tests, and 27 Chromium/WebKit checks across English, Chinese, Traditional Chinese, Japanese and German. Before the translations, the existing zh-TW check failed with the two missing OpenClaw keys. The full nogui Go suite fails only at TestPluginHTTP2TakesTheProxy with the existing Bun status=0 RangeError.
…ne#1088) Merge upstream main at ad3b7fe after its Air reference was inserted where the OpenClaw paragraph lived. Keep both descriptions and move OpenClaw into its own subsection with its verification command, reducing conflicts with new agent entries. On this merged tree, go vet and macOS, Linux nogui and Windows builds pass. Sandboxed TestOpenClaw, TestAir, TestCopilot and TestSealed checks pass in the agent, gateway and provider packages. The GUI assets are unchanged from 6c49756, where 27 Chromium/WebKit checks passed. The previous full Go run failed only at the Bun HTTP/2 proxy test, reproduced on unchanged upstream 6d7b574.
|
Thanks for the PR and the follow-up. Before a full review: this PR adds a new dependency ( |
|
Thanks for flagging the dependency. I checked whether the existing parsers can replace it, and I recommend keeping a JSON5 decoder for this adapter. OpenClaw supports JSON5 beyond comments and trailing commas. Its official minimal configuration already uses unquoted object keys, and its configuration reader uses the I tested the literal minimal configuration from those docs with both parsers in an isolated temporary HOME:
The existing YAML decoder is not equivalent either: in the same comparison it rejects a valid JSON5 escaped single-quoted string and accepts a tagged YAML value that JSON5 rejects. Calling OpenClaw's CLI would change the current config-file-only integration into one requiring an installed executable; evaluating the file as JavaScript would accept executable expressions rather than validate JSON5 data. For the added dependency's scope, A JSON5-capable parser is necessary to handle OpenClaw's documented configuration syntax. This particular library is an implementation choice, but the existing dependencies are not a drop-in replacement. Keeping it avoids limiting the integration to JSONC or introducing a custom parser. This explanation is for the maintainer's dependency review; I am not treating that review as waived. |
e014d44 to
963386a
Compare
|
@yetone 已同步最新 |
|
@yetone 已合入刚拉取的 main 这次冲突在 本轮验证:
之前 JSON5 备份生命周期修复和模型链功能保持不变。新增 JSON5 依赖及 vendorInstall 的两条官方安装地址,仍请维护者确认;本次同步不视作这些事项已获批准。 |
Merge main b030317. Resolve the sole conflict in docs/reference.md by retaining both OpenClaw and the upstream MothX provider-scoped agent entries. Existing OpenClaw behavior is preserved. Verified with isolated HOME and pinned Go caches: OpenClaw/MothX and GUI API tests, complete agentenv tests, scoped nogui vet and repository nogui build. All 55 selected Chromium/WebKit GUI checks passed, including model chains across five languages, web/desktop and narrow/wide layouts, connection, shared picker and translations. JS syntax, gofmt, UTF-8/NUL/conflict and diff checks passed. Full suites, cross-platform runtime and real-vendor requests were not rerun.
Sync upstream ccb2eea into the local OpenClaw branch. The merge has no conflicts and retains OpenClaw integration. This commit is for local build and runtime replacement only.
|
正在复查当前 head |
yetone
left a comment
There was a problem hiding this comment.
感谢持续跟进。本轮在 head 4b13e4d10 合并 origin/main d783df46c 后的树上逐行审了一遍,并跑了构建、vet、全量测试和 GUI 测试。两项之前悬而未决的问题已经可以结案,但还有两个测试红、三处需要改的地方,所以这次先 request changes。
已确认没问题的
github.com/titanous/json5:BSD-3 许可,运行时只依赖标准库,用到的只是一个小的 decoder。上游不怎么维护,已知的 bug #7 在出错时会拒绝解析(fail closed),不会写坏文件。自己写一个窄版 JSON5 解析也不会更安全,所以接受这个依赖。- 两个安装地址:
https://openclaw.ai/install.sh和install.ps1与 openclaw/openclaw 的 README、docs.openclaw.ai/install 一致,是官方地址。 - 真实 OpenClaw 2026.10.4 沙盒试用(Node 24.22.0,沙盒 HOME 加
OPENCLAW_STATE_DIR):- magpie 写出的已连接、带 fallback 链、已断开三种配置都通过了
openclaw config validate --json。 openclaw models list列出了 primary 和 fallback#1。- Disconnect 后 JSON5 原文件逐字节还原。
- magpie 写出的已连接、带 fallback 链、已断开三种配置都通过了
- gofmt、
go vet(darwin、linux、windows)和三平台构建都通过。 - 涉及的 GUI 测试在 chromium 和 webkit 下、所有语言 167/167 通过:openclaw-models、agent-connect*、agent-connected-unfolded、agent-models-picker、claude-picker-*、editor-picker-clicks、picker-rail-current、gui-de、gui-ja、gui-zh-tw。
需要改的
-
TestCoreScriptBudget红(由本 PR 引起)。 核心脚本 1,450,937 字节,超出预算 1,447,000(main 是 1,446,845)。请把 OpenClaw 专用的 GUI 代码挪进插件,或者在internal/gui/core_budget_test.go里提高预算,并在注释里写明原因和新数字。 -
TestReverseProxyIsStillMagpie红(由本 PR 引起)。 origin/main 上单独跑是绿的,本 PR 上 nginx 和 local 两个子测试都失败:proxy_kept_test.go:141: /.config/magpie/stash.json is back on this machine's gateway原因:
openclawWriteChain里的remember(openclawProvider, openclawProviderAt(at.gw()))会把after记进 stash,这时用的是本机网关地址http://127.0.0.1:3591/v1。openclaw.json 本身保住了反向代理地址,但 stash.json 里openclaw.config:.openclaw/openclaw.json这条记录的models.providers.magpie.after.baseUrl又变回了 127.0.0.1。Sync 之后,记录的值和文件里实际写的值不一致,之后的漂移判断和 Disconnect 还原都会以错的值为准。请让记录的after和实际写进文件的 provider 块保持一致(用户放在反向代理后面时也一样)。改完后跑go test -run TestReverseProxyIsStillMagpie ./internal/agent/确认。 -
Via: "shell"不在 app.js 的VIA表里。 GUI 用的是t(VIA[c.via] || c.via),所以界面上会显示一个没翻译的原文 "shell"。请和 claude、opencode、codex 一样用"script"。 -
{Via: "npm", Command: "npm i -g openclaw"}这条安装方式建议去掉。- 它和官方写法
npm install -g openclaw@latest --allow-scripts=openclaw不一样。 - OpenClaw 需要 Node >=24.16 <25 或 >=26.1,而 Node 22 现在很常见,装完也跑不起来。
- 它也绕过了
npmInstall先装好 Node 的流程,以及 Windows 上对 npm.cmd 的处理(PowerShell 会拦 npm.ps1)。
官方安装脚本本身会处理 Node,只留它就够了。如果一定要保留 npm,请照搬官方命令,并走
npmInstall。 - 它和官方写法
-
(次要)
writable()里用的是os.Getenv,应改用at.getenv,否则在 WSL 下读到的是 Windows 这边的环境变量。OPENCLAW_STATE_DIR和OPENCLAW_CONFIG_PATH里的~没有像 OpenClaw 那样展开。
本次运行记录
- 树:
4b13e4d10合并 origin/maind783df46c(干净合并)。 - 构建、格式、vet:
go build(darwin、linux、windows)通过,gofmt -l无输出,go vet三个平台都通过。 - 全量测试:
set -o pipefail; go test -timeout 45m ./...的结果是:internal/gui因上面第 1 条失败。internal/agent和internal/gateway在机器负载约 300 时撞到 45 分钟超时,没有断言失败。之后单独重跑internal/agent,只有上面第 2 条失败。- 其余包全部 ok。
- GUI:上面列出的文件在 chromium 和 webkit 下、en/zh/zh-TW/ja/de 全部通过。
- 真实 OpenClaw:只在沙盒 HOME 里试用,没有动过真实的
~/.openclaw。
请修完 1 到 4 后 push,我会在新的 head 上重新审一遍。
Record the provider actually written after Sync keeps a remote gateway or reverse proxy, so Disconnect can restore the original provider. Expand OpenClaw tilde paths through the shared environment guard and use the place-local reader for read-only flags. Offer only the vendor installer with the translated script label. Raise the core script budget by 5,000 bytes to 1,452,000 for the inline OpenClaw model-chain editor (4,092 added bytes; total 1,450,937); retain the existing app.js budget. Update the agent-wiring reference. The proxy and budget tests failed before the fix. The new proxy/tilde regressions also fail with the original production sources via Go overlay. Targeted tests, proxy/concurrent-edit race tests, all three platform vet/build checks and 58 Chromium/WebKit GUI checks pass in isolated homes. The full Go suite passes agent and gui, but exposes the upstream image cache test's fixed-count assumption (19 refits rather than 20); that separate test-only correction follows. No live app/config was replaced.
The upstream cache test assumes ten images fit in a budget based on the first encoded PNG. The fixtures have different compressed sizes, and Go 1.27.1 retains eleven, so turns two and three legitimately refit nineteen. The assertion failed on every run with -race -count=20. Check each turn refits only the entries absent from the prior cache, while requiring a nonempty partial cache and enforcing the same byte budget. Gateway production code and documented behavior are unchanged. The corrected test passes -race -count=20. With a Go overlay that bypasses cache hits it fails again: thirty refits with eleven entries retained. Gateway vet passes on darwin, linux and windows. The final full-suite result is recorded in PR yetone#1088.
|
正在复查新 head |
|
18:11 认领复查新 head |
Merge yetone/magpie main at 5774c79 for PR yetone#1088. The only conflict was coreScriptBudget: keep upstream's 1,469,000-byte budget unchanged. The merged core is 1,451,460 bytes; app.js is 1,261,359 bytes within its existing 1,269,000-byte budget. Keep upstream's loadBack refresh coalescing and all OpenClaw review fixes. No new production behavior is introduced by the manual resolution. Verified on the exact merged tree, Go 1.27.1, macOS arm64: - go test -tags nogui ./... -count=1 -timeout=45m -p 4: all 64 packages with tests passed; agent 351.754s, gateway 404.356s, GUI 72.254s. - go vet and go build: darwin/arm64, linux/arm64 with nogui, windows/arm64. Go checks used temporary HOME and pinned caches. - Playwright 1.63.0, Chromium: 33 tests passed, none failed/cancelled, across openclaw-models, agent-update-all and window-back-once; model-chain coverage includes all five languages, web/desktop, 420px/1100px. Run sequentially after Go checks. - gofmt -l and git diff --check clean; all 27 PR files are UTF-8 with no NUL bytes relative to the new upstream base. Validation limits: WebKit could not complete on this host. Its same loading/click-stability timeouts reproduce with standalone HTML and a single button, outside magpie, on available bundled runtimes. Aborted those blocked runs. An earlier concurrent Chromium run also hit the existing update test's scroll-position assertion (30 vs 0); the complete isolated Chromium run above passed without source or test changes. Full GUI suite and physical Linux/Windows/WSL were not run; existing macOS SDK/link warnings remain. No live config or installed app changed.
Sync upstream b9d1cd3 after the latest OpenClaw PR branch. Both merges are conflict-free and retain OpenClaw functionality. This commit is for the local build and runtime replacement.
行为变化
在 Agent 页和 CLI 中接入 OpenClaw,支持发现、安装入口、接入/断开,以及主模型与有序备用模型的配置。模型链编辑器保留在本 PR:主模型和备用列表共同决定 OpenClaw 的模型选择,是同一个接入功能的配置入口。
~展开及只读/Nix 标记;损坏配置和$include均拒绝写入。采用官方彩色图标,补齐中、英、繁中、日、德文案。设计及源代码:Agent wiring、
internal/agent/openclaw.go、internal/gui/api.go、internal/gui/assets/app.js。Review 修复与验证
当前 head:
bb5eca3e15cabf72d21fae2e86ab80c17a0777c8,已合入上游5774c790bdd62533179b705a1dba8c19cff5d481。OpenClaw 修复(独立提交
532d2125)及本次合并结果:after现在从实际落盘内容读取,使记录与配置一致。Disconnect 能删除新建的 provider,或恢复用户原有的 provider。script;删除独立 npm 入口,仅提供会准备所需 Node.js 版本的官方安装脚本。at.getenv读取。状态/配置路径中的~按有效 OpenClaw home 展开,OPENCLAW_HOME自身的~按系统 home 展开;共享环境变量校验也接受这些路径。WSL 继续忽略 Windows 的路径与只读标记。本次冲突合并检查
internal/gui/core_budget_test.go,完整保留主线预算;相对新 main,该文件已无差异。合并未另加产品行为。go test -tags nogui ./... -count=1 -timeout=45m -p 4全部通过,64 个有测试的包成功;Agent 351.754 秒、Gateway 404.356 秒、GUI 72.254 秒。go vet和构建全部通过。openclaw-models、agent-update-all、window-back-once。模型链覆盖五种语言、web/desktop、420/1100px;窗口返回刷新覆盖中英文及 window/panel。gofmt -l无输出,git diff --check通过;相对新 main 的 27 个 PR 文件通过 UTF-8/NUL 检查。未运行完整 GUI 套件及物理 Linux/Windows/WSL 验收,未改变本地运行中的应用或真实配置。上一轮 Review 修复检查(b08e48fe)
go test -tags nogui ./... -count=1 -timeout=45m -p 4全部通过(Go 1.27.1;Agent 393 秒、Gateway 400 秒、GUI 63 秒)。go vet与构建通过:macOS/arm64、Linux/arm64 nogui、Windows/arm64。-race检查通过。gofmt -l无输出,git diff --check通过;相对当时 main 11173c8 的 28 个改动文件均通过 UTF-8/NUL 检查。全量检查发现的上游测试问题
main
11173c8a的TestCodexFittedImagesPastTheBudget假设按第一张 PNG 的体积设置预算会恰好保留 10 张,但图片压缩体积不同,本机实际保留 11 张,后续两轮重制 19 张。原断言在-race -count=20下每次都失败。独立提交
b08e48fe只修正该测试:按上一轮实际保留数量检查重制数量,同时要求非空的部分缓存且不超过字节预算,Gateway 运行逻辑不变。修正后 20 次-race通过;overlay 故意绕过缓存命中时仍失败(重制 30 张,保留 11 张),确认复用保证没有被放宽。修改后的测试也通过三平台 vet。所有 Go 检查均使用临时 HOME,固定 GOPATH/GOMODCACHE/GOCACHE。本轮未替换运行中的本地 Magpie,未执行安装脚本,未重跑完整 GUI 套件、真实供应商模型请求或物理 Linux/Windows/WSL 验收。macOS 有现有 SDK/链接警告。
维护者已确认
最新 review 已接受
github.com/titanous/json5 v1.0.0和两个官方安装地址。该 review 还记录了 OpenClaw 2026.10.4 沙盒验证:连接、fallback 链与断开配置通过官方校验,JSON5 原文逐字节还原。🎬 界面预览
CI 用这个 PR 的代码构建并真实运行 magpie(沙盒环境,配置了真实的 DeepSeek key),按改动自动操作、截图和录屏 ·
b7d5012· 运行记录改动(按代码):Agent 页新增 OpenClaw:未安装时出现在「安装其他 Agent」里,提供官方安装脚本与官方彩色图标;接入后在该 Agent 的面板中新增「配置模型」——主模型加可排序、可清空的降级模型链,内联选择并即时保存。
Note
沙盒里看不到:沙盒没有安装 OpenClaw,也没有 ~/.openclaw/openclaw.json,因此看不到 OpenClaw 的 Agent 行与接入后的「配置模型」编辑器(主模型/降级模型选择弹窗、上移、移除、添加、校验与写入失败提示)——这些需要真实接入 OpenClaw 才会渲染;这里只能看到未安装时的安装入口。
OpenClaw 的安装入口
展开前的「安装其他 Agent」
展开后的「安装其他 Agent」列表