Skip to content

fix(auto-recall): thread AbortSignal + BM25-only mode + fix post-timeout rejection#746

Closed
jlin53882 wants to merge 0 commit into
CortexReach:masterfrom
jlin53882:james/handle-pr668-pr708
Closed

fix(auto-recall): thread AbortSignal + BM25-only mode + fix post-timeout rejection#746
jlin53882 wants to merge 0 commit into
CortexReach:masterfrom
jlin53882:james/handle-pr668-pr708

Conversation

@jlin53882
Copy link
Copy Markdown
Contributor

Summary

Consolidates two closed/in-conflict PRs into a single reviewable branch:

Commits

  1. dc7ec59 fix(auto-recall): thread AbortSignal to cancel embedding on timeout
  2. 9f4c86c fix(auto-recall): narrow abort classification to our controller
  3. 3dc8644 fix: restore cli compat and unblock auto-recall latency
  4. b0d03ec fix(auto-recall): consume post-timeout rejection to avoid unhandled rejection

Maintainer feedback addressed

From Issue Status
PR #668 review Post-timeout rejection needs explicit handling Fixed in b0d03ec

Rebased onto latest origin/master (47b635d) — no conflicts.

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


P0 Badge Restore catch/finally for retrieve try block

The retrieve() method now opens a try block but never follows it with catch or finally, so TypeScript parsing fails (TS1472) and the plugin cannot load at all. This is a hard runtime blocker for any environment that imports src/retriever.ts.

ℹ️ 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 src/retriever.ts Outdated
Comment on lines +623 to +624
results = await this.hybridRetrieval(
query, safeLimit, scopeFilter, category, trace, signal,
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 Pass AbortSignal in the correct retrieval argument slot

This call passes signal as the 6th positional argument, but hybridRetrieval expects source and diagnostics before signal, so the abort signal never reaches embedder.embedQuery(...). In vector/hybrid paths that provide a signal, cancellation will not work and timeouts can still block while remote embedding requests run to completion.

Useful? React with 👍 / 👎.

Comment thread index.ts Outdated
Comment on lines +1813 to +1814
const target = join(params.workspaceDir, params2.relPath);
if (!target.startsWith(params.workspaceDir)) throw new Error(`memory-lancedb-pro: invalid relPath ${params2.relPath}`);
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 Normalize memory_get paths before workspace boundary check

The boundary check uses join(workspaceDir, relPath) plus startsWith(workspaceDir), which can be bypassed with paths like ../workspaceDir2/... that still share the same prefix string. In compat readFile, this allows reading files outside the configured workspace when relPath is user-controlled.

Useful? React with 👍 / 👎.

@jlin53882 jlin53882 force-pushed the james/handle-pr668-pr708 branch 3 times, most recently from 96f7a61 to be0f81e Compare May 7, 2026 03:15
@rwmjhb
Copy link
Copy Markdown
Collaborator

rwmjhb commented May 9, 2026

Please rebase this branch on current master before continuing review.

The branch is behind current master and currently carries packaging failures plus a mixed diff across import-markdown, auto-recall, and retriever behavior. Rebase first, then split or narrow the PR so the remaining diff is reviewable.

@jlin53882 jlin53882 force-pushed the james/handle-pr668-pr708 branch 2 times, most recently from 75403c8 to dcc8663 Compare May 9, 2026 15:38
@jlin53882 jlin53882 closed this May 9, 2026
@jlin53882 jlin53882 force-pushed the james/handle-pr668-pr708 branch from dcc8663 to 2226403 Compare May 9, 2026 15:41
@jlin53882
Copy link
Copy Markdown
Contributor Author

@rwmjhb 此PR #746 由 PR #779 取代此PR

@jlin53882
Copy link
Copy Markdown
Contributor Author

Thanks for the work on this! I've taken the core signal-threading concept and combined it with a cleaner fallback design (James's approach) in a new PR: #783

What changed vs this PR:

  • Embedding API timeout → AbortSignal properly threaded to embedQuery(query, signal) (not just returning undefined)
  • BM25 fallback: if embed fails, falls back to BM25 instead of returning nothing (James's design — doesn't change the default behavior)
  • Removed the "always use BM25 for auto-recall" approach from PR fix: restore CLI compat and unblock auto-recall latency #708 (it was a quality regression)

This PR #746 had good intent but the implementation had some TS errors. The new PR #783 is a clean rebuild.

@jlin53882
Copy link
Copy Markdown
Contributor Author

Thanks for the work on this! I've taken the core signal-threading concept and combined it with a cleaner fallback design (James's approach) in a new PR: #784

What changed vs this PR:

  • Embedding API timeout → AbortSignal properly threaded to embedQuery(query, signal) (not just returning undefined)
  • BM25 fallback: if embed fails, falls back to BM25 instead of returning nothing (James's design — doesn't change the default behavior)
  • Removed the "always use BM25 for auto-recall" approach from PR fix: restore CLI compat and unblock auto-recall latency #708 (it was a quality regression)

This PR #746 had good intent but the implementation had some TS errors. The new PR #784 is a clean rebuild.

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.

2 participants