Skip to content

fix(openclaw): preserve exact branch selectors - #349

Merged
loveRhythm1990 merged 1 commit into
matrixorigin:mainfrom
MatrixAdventurer:fix/openclaw-exact-branch-selectors-20261021
Oct 21, 2026
Merged

loveRhythm1990 merged 1 commit into
matrixorigin:mainfrom
MatrixAdventurer:fix/openclaw-exact-branch-selectors-20261021

Conversation

@MatrixAdventurer

Copy link
Copy Markdown
Contributor

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

What type of PR is this?

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

Which issue(s) this PR fixes

Follow-up to the pre-existing defect identified in the review of #346: #346 (comment)

Repository issue/PR searches for OpenClaw branch-selector whitespace and memory_checkout trimming found no existing fix PR; no automatic issue closure.

What this PR does / why we need it

The server preserves branch display names exactly and resolves checkout/delete by exact string equality. The OpenClaw public tool wrappers currently use the general readString() behavior, which trims selectors before forwarding them. A listed branch named " release " is therefore checked out or deleted as "release", potentially targeting a different branch.

  • Add an opt-in preserveWhitespace mode that still rejects empty/whitespace-only values.
  • Use it only for registered memory_checkout and memory_branch_delete selectors.
  • Leave every other string parameter's existing trimming behavior unchanged.
  • Verify exact URL encoding through registered public tools and a native loopback HTTP server.

Scope

2 files, +78/-5, based on upstream main 0695ad61eec9104478f05f5824b75bdbeeca5616.
Head 41046902369709c0999c686fd7cdd73f3136e65e; remote blobs exactly match the locally tested files.
No upstream dev branch exists, so this PR targets main.

Verification

Node 24.19.0 / npm 11.9.0, working directory plugins/openclaw:

  • Byte-identical regression test on unchanged baseline: 4 failed / 4 passed.
  • Fixed focused suite: 8/8 passed.
  • Full npm test: 211/211 passed across 13 files.
  • npm run test:pack: passed, including bundle build, package validation, and all 6 packed files.
  • git diff --check: passed.
  • Independent review agent: Approve; independently repeated baseline red, focused/full green, packaging, lockfile comparison, and diff checks.

The regression covers checkout/delete with surrounding spaces, tab/newline selectors, ordinary controls, and whitespace-only rejection. It traverses the registered OpenClaw tool, client, transport, WHATWG URL handling, and native loopback HTTP server. No live Memoria/MatrixOne integration test is claimed.

Remaining gates

  • Upstream CI is pending.
  • No force-push, merge, deployment, or package publication.

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

Copy link
Copy Markdown
Contributor Author

Current-main integration follow-up: while this PR was being opened, #346 merged as 659a7779c1f3be787c4dba1d67cd12b998dd0b32. I overlaid the exact two published blobs from this PR onto that merged tree and reran validation:

  • Full OpenClaw suite: 223/223 passed across 14 files (the 215 tests from current main plus this PR's 8 cases).
  • npm run test:pack: passed, including build, package validation, and all 6 packed files.
  • git diff --check: passed.

GitHub reports only the intended 2 changed files against current main; no conflict or rebase-only code change is needed. Upstream CI remains authoritative and is pending. No merge or deployment was performed.

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

@aptend aptend left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep review of exact head 4104690, declared base 659a777 and merge-base 0695ad6. Read the complete two-file proposed delta and all review/discussion/inline/thread history. No blocking findings.

Verified both registered public tools preserve the exact nonempty selector through client/transport, encodeURIComponent and native HTTP paths. Server checkout/delete resolve exact branch display names; ordinary strings and all other readString callers retain their existing trimming, required/type checks remain, and auth/cache/error/cleanup behavior is unchanged. This closes the specific tool-layer gap identified separately from #346 without claiming to change unrelated create/merge/diff normalization.

Local exact-head Node22.22.0/npm10.9.4: full npm test passes 211/211 across13 files, including all8 native-HTTP public-tool selector cases; npm run test:pack builds/verifies the package and all6 packed files. diff --check and source status clean.

Also inspected raw CI39538426620/job119020361554: it tests merge46321f97d2ad37dd921d109c61a304522a61c75c (this exact head + current declared base including #346), with identical changed index.ts, Node22.23.3 selector8/full223 across14 files passing and6 packed files verified. That is complementary current-main integration evidence, not a claim that bare-head211 and merged223 are the same run. No live Memoria/MatrixOne service or database test was performed.

Copy link
Copy Markdown
Contributor Author

CI follow-up on exact head 41046902369709c0999c686fd7cdd73f3136e65e: all required workflows have completed successfully.

Independent review remains APPROVED on this exact head. No merge or deployment action was taken.

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

@loveRhythm1990
loveRhythm1990 merged commit b92b82a into matrixorigin:main Oct 21, 2026
5 of 6 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.

4 participants