Skip to content

feat(memory-lancedb): support reindex and drop-index command - #68116

Closed
zhangyue19921010 wants to merge 10 commits into
openclaw:mainfrom
zhangyue19921010:mem-lancedb-reindex
Closed

zhangyue19921010 wants to merge 10 commits into
openclaw:mainfrom
zhangyue19921010:mem-lancedb-reindex

Conversation

@zhangyue19921010

Copy link
Copy Markdown
Contributor

Summary

  • Problem: ltm reindex rebuilt the LanceDB vector index but did not wait for index creation to finish before reporting success.
  • Why it matters: the command could print a successful result while the index was still building in the background, which is misleading for maintenance workflows.
  • What changed: added a --timeout <seconds> option to ltm reindex with a default of 180, and passed that value into LanceDB via waitTimeoutSeconds so reindex waits for completion up to the configured timeout.
  • What did NOT change (scope boundary): this PR does not change memory capture/recall behavior, embedding generation, search scoring, or drop-index cleanup semantics.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Security Impact (required)

  • New permissions/capabilities? (Yes/No) No
  • Secrets/tokens handling changed? (Yes/No) No
  • New/changed network calls? (Yes/No) No
  • Command/tool execution surface changed? (Yes/No) No
  • Data access scope changed? (Yes/No) No
  • If any Yes, explain risk + mitigation: the CLI surface for ltm reindex now accepts a timeout parameter, but it only affects waiting behavior for an existing maintenance command and does not expand data access or privilege boundaries.

@openclaw-barnacle openclaw-barnacle Bot added extensions: memory-lancedb Extension: memory-lancedb size: S labels Apr 17, 2026
@greptile-apps

greptile-apps Bot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds ltm reindex --timeout <seconds> (default 180) and ltm drop-index CLI commands to the memory-lancedb plugin. The reindex method now passes waitTimeoutSeconds to LanceDB's createIndex so the command blocks until the index is actually built rather than returning immediately. The dropIndexes implementation serially drops all table indexes with a deterministic sorted order.

Confidence Score: 5/5

Safe to merge; the only finding is a minor input-validation gap on an optional CLI flag with a sensible default.

All findings are P2 (style/robustness). Core logic — waitTimeoutSeconds wiring, empty-table guard, replace: true, and sequential index dropping — is correct. No data-integrity, security, or runtime-breakage risks were identified.

No files require special attention.

Prompt To Fix All With AI
This is a comment left during a code review.
Path: extensions/memory-lancedb/index.ts
Line: 539

Comment:
**Unvalidated `--timeout` value passes `NaN` to LanceDB**

`Number.parseInt("abc", 10)` returns `NaN`, which is then forwarded directly to `waitTimeoutSeconds`. LanceDB receives a `NaN` timeout, and its behavior in that case is undefined — it may skip the wait silently or throw a cryptic internal error. A user who accidentally types `--timeout foo` would get no clear feedback.

```suggestion
            const timeoutSeconds = Number.parseInt(String(opts.timeout), 10);
            if (!Number.isFinite(timeoutSeconds) || timeoutSeconds <= 0) {
              console.error(`Invalid timeout value: ${opts.timeout}. Must be a positive integer.`);
              process.exit(1);
            }
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "feat(memory-lancedb): support reindex an..." | Re-trigger Greptile

Comment thread extensions/memory-lancedb/index.ts Resolved

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

Copy link
Copy Markdown
Contributor

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: 2912d2b2ba

ℹ️ 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 extensions/memory-lancedb/index.ts Resolved
@clawsweeper

clawsweeper Bot commented Apr 27, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Keep open: current main still does not provide the requested LanceDB reindex/drop-index maintenance commands, and this PR is focused, but it is not merge-ready because the new timeout flag bypasses the current strict CLI integer parser and the branch still lacks real LanceDB behavior proof.

Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

So I’m closing this here because the remaining work is already tracked in the canonical issue.

Review details

Best possible solution:

Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

Do we have a high-confidence way to reproduce the issue?

Yes for the review finding by source inspection: the new timeout flag uses Number.parseInt, while current ltm integer options use the shared strict positive-integer parser. The requested command addition itself is a feature, not a current-main bug reproduction.

Is this the best way to solve the issue?

No, not as submitted. The plugin CLI is the right owner boundary and LanceDB v0.30.0 supports the needed APIs, but the PR should reuse strict parsing, document the commands, and provide real behavior proof.

Security review:

Security review cleared: No concrete security or supply-chain concern was found; the diff is plugin-local CLI/index maintenance and does not change dependencies, secrets, workflows, package resolution, or permissions.

AGENTS.md: found and applied where relevant.

What I checked:

  • stale F-rated PR: PR was opened 2026-04-17T12:53:09Z, is older than 60 days, and the latest review rated it F.
  • proof blocker: real behavior proof is missing and proof tier is F, so this branch is not merge-ready without contributor follow-up.
  • no human follow-up: live comments and timeline hydrated by apply contain no non-automation activity after the ClawSweeper review.

Likely related people:

  • steipete: Centralized memory-lancedb CLI integer parsing and recently hardened related LanceDB memory timeout behavior that the new timeout flag should follow. (role: recent area contributor; confidence: high; commits: ba2620a9afa9, 87eae7f811da, 61c538e2fc22; files: extensions/memory-lancedb/index.ts, extensions/memory-lancedb/index.test.ts)
  • zhangyue19921010: Authored merged memory-lancedb ltm list work before this PR, so they have recent history on the same plugin CLI surface beyond this proposal. (role: recent adjacent CLI contributor; confidence: medium; commits: 1e20babcf7eb; files: extensions/memory-lancedb/index.ts)
  • ngutman: Authored the merged LanceDB runtime bootstrap path used by the proposed index maintenance calls. (role: adjacent runtime contributor; confidence: medium; commits: b98f3634c47e; files: extensions/memory-lancedb/index.ts, extensions/memory-lancedb/lancedb-runtime.ts, extensions/memory-lancedb/index.test.ts)
  • ddupg: Authored merged cloud storage support that changed the LanceDB connection and storage boundary adjacent to index maintenance. (role: adjacent storage contributor; confidence: medium; commits: df918c4de530; files: extensions/memory-lancedb/index.ts, extensions/memory-lancedb/config.ts, extensions/memory-lancedb/index.test.ts)
  • radek-paclt: Introduced the original LanceDB-backed vector memory plugin and ltm CLI surface that this PR extends. (role: introduced behavior; confidence: low; commits: ebfeb7a6bf53; files: extensions/memory/index.ts, extensions/memory/index.test.ts)

Codex review notes: model internal, reasoning high; reviewed against 4e6933c84f18.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 19, 2026
@clawsweeper clawsweeper Bot added the P2 Normal backlog priority with limited blast radius. label May 19, 2026
@clawsweeper

clawsweeper Bot commented May 19, 2026 •

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@RomneyDa

Copy link
Copy Markdown
Member

Heads up: this PR needs to be updated against current main before the new required Dependency Guard check can pass.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jun 13, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Jul 3, 2026
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed stale Marked as stale due to inactivity labels Jul 3, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: feat(memory-lancedb): support reindex and drop-index command This is item 1/1 in the current shard. Shard 14/22.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #clawtributors on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: memory-lancedb Extension: memory-lancedb merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S stale Marked as stale due to inactivity status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants