Skip to content

fix(openclaw): skip unused historical snapshot counts - #355

Merged
loveRhythm1990 merged 1 commit into
matrixorigin:mainfrom
MatrixAdventurer:fix/openclaw-snapshot-counts-20261022
Oct 22, 2026
Merged

loveRhythm1990 merged 1 commit into
matrixorigin:mainfrom
MatrixAdventurer:fix/openclaw-snapshot-counts-20261022

Conversation

@MatrixAdventurer

@MatrixAdventurer MatrixAdventurer commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

由 LW 授权的 ChatGPT Personal 智能体提交。

What type of PR is this?

  • fix (bug fix)
  • perf (performance improvement)
  • test (regression coverage)

Which issue(s) this PR fixes

Related to #354 and the performance suggestion on merged #352. No automatic issue closure requested.

What this PR does / why we need it

Automatic OpenClaw snapshot discovery needs names and timestamps, but its requests default to historical memory-count resolution on the server. Each uncached snapshot may trigger a historical COUNT and cache write whose result the plugin discards. With the default page budget this can touch up to 400 snapshots per scan.

Pass the existing resolve_memory_counts=false on every automatic page. Keep explicit transport limit/offset requests unchanged. The formatter/client and stats do not expose per-snapshot memory counts, so the public output stays unchanged. This is verified unnecessary database work, not a measured production latency improvement.

Verification

  • Base main c3bb4b5; no dev exists, so main is used as explicitly authorized.
  • Published head 2a613d0; full tree 5563356d9e8e31c320876ebb12139f9e0afff5ca equals tested local commit 6659385bc0b067fdd9c722e2ceed1a0b50fc416e.
  • RED: npm test -- openclaw/tests/snapshot-pagination.test.ts against unchanged transport: 1 failed / 4 passed; all six automatic requests omitted the flag.
  • GREEN: npm test: 234/234 tests across 15 files; npm run test:pack: build and verification passed, 6 packed files. Repeated full suite and packaging on Node24.19.0 and Node22.23.3.
  • Real native loopback HTTP regression asserts three discovery and three stats pages request false, while explicit page selection retains the absent parameter. Independent review agent Approve and independent regression 5/5; remote head independently fetched and full-tree equality confirmed.
  • git diff --check passed. Complete scope: 2 files, +8/-2. Generated dist is build-only and excluded by the repository; no dependencies, schema, server or workflow changes.
  • Upstream OpenClaw CI 39639072851 SUCCESS; PR Title Check SUCCESS. Rust/MatrixOne CI 39639072838 SUCCESS, including 252 unit tests and DB Tests with restore/cleanup regressions.
  • Local Rust/MatrixOne gates were not executed; actual upstream required CI has now completed successfully. PR is ready for review; XuPeng-SH assignment and review request were read back.
  • Authenticated login, own fork upstream relationship and push permission verified. Only MatrixAdventurer/memoria:fix/openclaw-snapshot-counts-20261022 created/updated, using the GitHub connector and expected-SHA lease; no default branch written. Branch/commit publication and read-only verification performed by the signed execution subject. Issue [Bug]: OpenClaw snapshot discovery backfills historical counts it discards #354 assigned to actual login XuPeng-SH; PR is assigned to XuPeng-SH and the review request was read back after required gates succeeded.

由 LW 授权的 ChatGPT Personal 智能体提交。

Avoid historical count backfills during metadata-only automatic discovery. Preserve explicit page requests and verify every automatic page over real HTTP.

Related to matrixorigin#354.

由 LW 授权的 ChatGPT Personal 智能体提交。

Copy link
Copy Markdown
Contributor Author

由 LW 授权的 ChatGPT Personal 智能体提交。

固定发布与独立复审证据:review agent 独立 fetch 远程 2a613d0,完整 tree 5563356d9e8e31c320876ebb12139f9e0afff5ca 与已实测本地 6659385bc0b067fdd9c722e2ceed1a0b50fc416e 全树 diff 为空,parent 与指定基线一致,确认署名、diff --check 并明确 Approve。两文件 +8/-2,无后续代码修订。

已实际完成 Node24.19.0 和 Node22.23.3 两套环境的插件全量234/234和打包6文件验证;独立review另执行真实HTTP回归5/5。修复前同一回归1 failed/4 passed,6个自动请求均缺少计数禁用参数。固定本地及远程提交、创建/更新本人fork独立分支、只读核验均由以上署名主体执行。Issue #354 的 XuPeng-SH assignee 已在创建响应读回;PR暂保留draft,等待完整规定CI结果后再指派并请求该负责人审阅。

Copy link
Copy Markdown
Contributor Author

由 LW 授权的 ChatGPT Personal 智能体提交。

固定head 2a613d0 的 CI 续接证据:OpenClaw #39639072851 与 PR Title Check SUCCESS;Rust/MatrixOne #39639072838 中 Check & Clippy SUCCESS,Unit Tests SUCCESS。已读取单测原始日志,116+22+45+69 = 252 passed,0 failed。DB Tests job119358340694 仍在 All tests 步骤,后续恢复/清理回归尚未执行,不能声称完整CI通过。无新review、inline thread或requested changes;未改代码、未重跑CI,继续保留draft,完整门禁通过后再执行负责人审阅交付。只读核验执行主体同上署名。

@MatrixAdventurer

Copy link
Copy Markdown
Contributor Author

由 LW 授权的 MOI 智能体提交。

完整 CI 与交付续接证据(固定 head 2a613d0,本轮无代码修改、未重跑 CI):

  • 继上一条记录(17:12:50Z,DB Tests 运行中)之后,本轮回访确认完整规定 CI 已全部完成且无失败:Rust/MatrixOne workflow run 39639072838 中 Check & Clippy、Unit Tests(252 passed)与 DB Tests(job 119358340694,含此前未完成的恢复/清理回归步骤)均 SUCCESS(DB Tests 完成于 17:18:21Z);OpenClaw workflow run 39639072851 与 PR Title Check 维持 SUCCESS;Mergify Merge Queue 状态为 neutral/completed。当前无失败、运行中或缺失的必需检查。
  • 自 17:12Z 以来无新增 review、inline thread 或 requested changes,无需修改。
  • 全部门禁满足后已执行负责人交付:18:03:40Z 向 XuPeng-SH 发出 review 请求(工具返回成功);18:04:38Z 将 PR 从 draft 标记为 ready(API 读回 isDraft=false);18:05:13Z 将 PR assign 给 XuPeng-SH(API 读回 assignees 含 XuPeng-SH)。Issue [Bug]: OpenClaw snapshot discovery backfills historical counts it discards #354 此前已 assign 并读回由 XuPeng-SH 负责。
  • 此前全部证据保持有效:RED/GREEN 回归(修复前同一回归 1 failed/4 passed,修复后 234/234 与打包 6 文件,双 Node 版本)、真实 HTTP 回归 5/5、独立 review agent 明确 Approve、两文件 +8/-2、diff --check 通过。本地测试不能替代完整 CI,本轮以上游实际 run 结果为准。
  • 不自动合并、不自动关闭 Issue,等待负责人审阅。分支与提交仅在本人 fork(MatrixAdventurer/memoria:fix/openclaw-snapshot-counts-20261022),未写上游任何默认分支。以上只读核验与写操作均由署名主体通过 GitHub 连接器执行。

@loveRhythm1990

Copy link
Copy Markdown
Collaborator

LGTM. Reviewed both changed files at 2a613d0be81932a1b5fee791ef53e0df4a9abafa and traced the client/server call paths.

The issue is real: snapshot listing defaults to resolving missing historical memory counts, while OpenClaw snapshot discovery and stats().snapshotCount only consume snapshot metadata and the number of snapshots. Passing resolve_memory_counts=false on every automatically fetched page skips that unused work without changing pagination or the displayed results. Explicit limit/offset requests retain their existing behavior.

Validation:

  • All 234 OpenClaw tests passed locally; package build and verification passed (6 packed files).
  • With the base implementation restored, the new regression assertion fails as expected because all six discovery/stats requests omit the flag.
  • Verified the server accepts the flag and bypasses historical count resolution when it is false. Rust unit/DB tests and OpenClaw CI passed on this head; database tests were not rerun locally.

No correctness or regression issues found. This confirms removal of unnecessary work; no latency benchmark was performed.

@loveRhythm1990
loveRhythm1990 merged commit e2aa907 into matrixorigin:main Oct 22, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants