Skip to content

fix(openclaw): reject malformed purge success responses - #507

Draft
MatrixAdventurer wants to merge 1 commit into
matrixorigin:mainfrom
MatrixAdventurer:fix/openclaw-purge-response-1118
Draft

MatrixAdventurer wants to merge 1 commit into
matrixorigin:mainfrom
MatrixAdventurer:fix/openclaw-purge-response-1118

Conversation

@MatrixAdventurer

Copy link
Copy Markdown
Contributor

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

What type of PR is this?

  • fix (bug fix)
  • test (regression coverage)

Which issue(s) this PR fixes

Newly reproduced response-validation defect. Searched existing purge/response PRs; #340 fixes input selectors, not this response issue. No automatic Issue closure requested.

What this PR does / why we need it

When memory_purge receives an empty or malformed successful HTTP response, the OpenClaw transport previously fabricated "Purged 0 memory(ies)." Missing count, string count, or a gateway page looked like a successful operation; negative/fractional numbers were also reported.

Require a nonnegative safe-integer purged count, matching the REST usize contract, before rendering success. Valid zero remains supported. Invalid responses throw; no mutation retry is added.

Validation

Base: 3a58488.
Head: e5366f4.
Tested/reviewed tree: a5ced3dff2a0f92c15c98780b2f09ba45f69fbf2; matches staged local tree exactly.
Scope: 2 files, +22/-1; generated dist is untracked build output, no generated source change required.

  • Baseline OpenClaw suite: 359 passed; package verification passed.
  • RED: new malformed-response cases against original production code: 7 failed, 72 passed.
  • GREEN final: npm test => 368 passed (19 files), including additional empty-body case and valid zero.
  • npm run test:pack => build, package validation and 6 packed-file checks passed.
  • git diff --check passed.
  • Independent review: Approve; final independent focused run 80 passed; verified API PurgeResponse.purged usize contract.
  • HTTP responses are mocked; no live server/database fault injection claimed. Repository-wide Rust/DB and hosted Node 22 gates remain for remote CI; keep draft pending those checks.

Authenticated user MatrixAdventurer, own-fork push permission and parent matrixorigin/memoria verified. Upstream has no dev; main uses the user's explicit fallback authorization. This signed record attributes read-only checks, branch creation, and requested XuPeng-SH assignment/review to this agent. No merge/deployment requested.

由 LW 授权的 ChatGPT Personal 智能体提交。
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.

2 participants