fix(backup): guard resolvedDbPath + drop redundant api.resolvePath (Issue #682)#750
Open
samson1357924 wants to merge 1 commit intoCortexReach:masterfrom
Open
Conversation
…ssue CortexReach#682, PR CortexReach#743) Applies PR CortexReach#743 root-cause fix on top of local defensive check: 1. runBackup(): removed redundant api.resolvePath() wrapper since resolvedDbPath is already absolute — fixes TypeError in OpenClaw 2026.4.x 2. createAdmissionRejectionAuditWriter(): guard with startsWith('/') to only resolve() relative paths 3. Added defensive guard if resolvedDbPath is still undefined 4. Added regression test (PR CortexReach#743, 11 cases) Also includes contracts.tools fix from PR CortexReach#749.
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.
問題描述
Issue #682:backup failed: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
根本原因(PR #743 分析)
OpenClaw 2026.4.x API 變更: 對已經是絕對路徑的輸入,現在會返回 (不再重複處理)。
兩處受影響程式碼:
修復方案(雙層保護)
根因修復(PR fix(backup+admission): drop redundant api.resolvePath on already-absolute paths (Issue #682, supersedes PR #695) #743):移除多餘的 包裝
防禦性檢查(本地額外增加):
變更檔案
驗證
2026-05-05T15:16:42.626Z warn plugins {"subsystem":"plugins"} memory-lancedb-pro: backup failed: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined