fix(backup): resolve backup dir from openclaw.json home field#732
fix(backup): resolve backup dir from openclaw.json home field#732jlin53882 wants to merge 8 commits intoCortexReach:masterfrom
Conversation
…+ bulkStore + parallel dedup
… James workspace data - Fix parseArgs converts --dedup=false to string 'false' (truthy) bug - Rewrite all import-markdown tests against real cli.ts behavior - Add batch pipeline, bulkStore failure, scope inference, return fields tests - Use real bullet content from James's workspace (all > minTextLength=5) - Remove non-existent directory-filter behavior tests - 19 tests pass, 0 fail
Before: skipped: skippedShort (excludes dedup hits from count) After: skipped: skipped (includes both short + dedup skips) Dry-run console output was correct; only the return value was wrong.
- CLI: add --no-dedup negation flag; dedup now defaults to enabled - Tests: add dedup: false explicitly to all non-dedup tests so behavior is intentional and not dependent on mock return values - P3 comment: correct misleading 'parseArgs' reference to clarify the != 'false' guard exists for the test helper path (Commander.js rejects --dedup=false as unknown option)
…leanup, remove source:cli - Phase 1a: move foundFiles++ inside try block (only count successfully read files) - Phase 1b: remove duplicate foundFiles++ in error branch (Phase 1a already counted) - Phase 2a: remove skipped++ from dedup hit (skipped is Phase 1b short entries only; dedup tracked via skippedDedup) - Remove unused source:'cli' from retrieve() call
Backup path was derived from resolvedDbPath/../backups, which crashed with ERR_INVALID_ARG_TYPE when dbPath was unset (undefined). Now reads openclaw.json directly to resolve openclawHome, respecting the config's 'home' field, with fallback to OPENCLAW_HOME/~/.openclaw/. This also fixes the path=undefined root cause and co-locates the backup directory next to openclaw.json regardless of dbPath config. Fixes: backup TypeError when path is undefined
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d691237a91
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "node_modules/@lancedb/lancedb-darwin-x64": { | ||
| "optional": true | ||
| }, | ||
| "node_modules/@lancedb/lancedb-linux-arm64-gnu": { |
There was a problem hiding this comment.
Restore darwin-x64 LanceDB optional package in lockfile
This lockfile update removes the @lancedb/lancedb-darwin-x64 optional dependency entry, which is the native binary package used on Intel macOS. With npm ci, missing platform-specific optional entries are not reconstructed from transitive metadata, so Intel mac builds can install without the required binary and then fail when @lancedb/lancedb loads at runtime.
Useful? React with 👍 / 👎.
| if (!ok || hits.length === 0 || hits[0].entry.text !== e.text) { | ||
| pendingEntries.push(e); | ||
| } else { |
There was a problem hiding this comment.
Deduplicate repeated lines within the same import run
In the new two-phase pipeline, dedup checks happen before any writes and only query existing store state, so duplicate bullets that appear multiple times in the same input batch all get queued and imported. With --dedup enabled, importing a file containing the same memory line twice now creates duplicates instead of skipping later occurrences.
Useful? React with 👍 / 👎.
|
Closed — superseded by #734 (includes backup fix) |
Cherry-pick from PR CortexReach#732: - Add resolveOpenclawHomeFromConfig() to read openclaw.json field - Update runBackup() to use openclawHome/backups instead of resolvedDbPath/../backups (robust when dbPath is unset) Co-authored-by: jlin53882 <jlin53882@users.noreply.github.com>
Backup path was derived from resolvedDbPath/../backups, which crashed with ERR_INVALID_ARG_TYPE when dbPath was unset (undefined).
Now reads openclaw.json directly to resolve openclawHome, respecting the config's 'home' field, with fallback to OPENCLAW_HOME/~/.openclaw/. This also fixes the path=undefined root cause.
Fixes: backup TypeError when path is undefined