Repository navigation
fix(openclaw): reject malformed purge success responses - #507
Draft
MatrixAdventurer wants to merge 1 commit into
Draft
MatrixAdventurer wants to merge 1 commit into
MatrixAdventurer wants to merge 1 commit into
Conversation
由 LW 授权的 ChatGPT Personal 智能体提交。
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.
由 LW 授权的 ChatGPT Personal 智能体提交。
What type of PR is this?
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.
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.