Skip to content

fix(backup): resolve backup dir from openclaw.json home field#732

Closed
jlin53882 wants to merge 8 commits intoCortexReach:masterfrom
jlin53882:pr730
Closed

fix(backup): resolve backup dir from openclaw.json home field#732
jlin53882 wants to merge 8 commits intoCortexReach:masterfrom
jlin53882:pr730

Conversation

@jlin53882
Copy link
Copy Markdown
Contributor

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


jlin53882 and others added 8 commits April 30, 2026 23:57
… 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
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment thread package-lock.json
"node_modules/@lancedb/lancedb-darwin-x64": {
"optional": true
},
"node_modules/@lancedb/lancedb-linux-arm64-gnu": {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread cli.ts
Comment on lines +746 to +748
if (!ok || hits.length === 0 || hits[0].entry.text !== e.text) {
pendingEntries.push(e);
} else {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@jlin53882
Copy link
Copy Markdown
Contributor Author

Closed — superseded by #734 (includes backup fix)

@jlin53882 jlin53882 closed this May 1, 2026
jlin53882 added a commit to jlin53882/memory-lancedb-pro that referenced this pull request May 6, 2026
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>
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.

1 participant