Skip to content

chore(deps): migrate @xenova/transformers to @huggingface/transformers v4 - #1096

Merged
rohitg00 merged 3 commits into
rohitg00:mainfrom
aqeelat:chore/migrate-xenova-to-hf-transformers
Jul 29, 2026
Merged

chore(deps): migrate @xenova/transformers to @huggingface/transformers v4#1096
rohitg00 merged 3 commits into
rohitg00:mainfrom
aqeelat:chore/migrate-xenova-to-hf-transformers

Conversation

@aqeelat

@aqeelat aqeelat commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

@xenova/transformers@2.17.2 is deprecated and silently broken on Node 22+ (see #479). This swaps to @huggingface/transformers@^4.2.0 — the same project, renamed, with an actively maintained ONNX runtime backend and Node 22/24 support. Drop-in for our usage: pipeline, RawImage.fromBlob, tolist, and text-classification output shape are all unchanged.

Closes #1095. Fixes #479.

Changes

  • package.json: replace @xenova/transformers + direct onnxruntime-{node,web} optional deps with a single @huggingface/transformers@^4.2.0. The onnxruntime packages are now bundled as HF v4's hard deps; sharp, @huggingface/jinja, and @huggingface/tokenizers come along transitively.
  • src/xenova.d.ts (deleted): removed entirely — @huggingface/transformers@4.2.0 ships its own TypeScript declarations (incl. RawImage), so the ambient shim is no longer needed.
  • src/providers/embedding/{local,clip}.ts, src/state/reranker.ts: swap import specifier + install error strings. Drop the as unknown as TransformersModule cast in clip.ts. Import errors are now only rewritten to the install hint when err.code === "ERR_MODULE_NOT_FOUND"; all other failures propagate unchanged instead of being masked by a blanket catch. The CLIP hint is now embedding-agnostic (the loader serves both text and image paths).
  • tsdown.config.ts: update neverBundle list.
  • __mocks__/@huggingface/transformers.ts (new): manual mock fixture that throws a Node-shaped ERR_MODULE_NOT_FOUND at module top-level. Vitest's vi.mock factory throws get wrapped (original lands on .cause), so a factory can't simulate a direct missing-module rejection. The manual mock bypasses the factory wrapper and lets the test exercise the real err.code path — production code checks err.code only, with no test-framework coupling.
  • test/{reranker,clip-embedding-provider,local-embedding-provider}.test.ts: use the manual mock for the "package unavailable" case; afterEach restores module state in the doMock-based describe blocks so mocks can't leak between tests.
  • test/local-embedding-smoke.test.ts (new): non-mocked smoke test that loads the real Xenova/all-MiniLM-L6-v2, embeds a string, and asserts 384 finite dims. Guarded by RUN_HF_SMOKE=1; skipped by default so CI doesn't download the model. This is the piece that catches a v4 output-shape change the mocked tests can't.
  • .github/workflows/ci.yml: expand Node matrix [20, 22][20, 22, 24, 26] across ubuntu/macos to cover every active LTS line plus current, proving the @xenova/transformers v2.17.2 fails on Node.js 22+ with "blob:nodedata:" worker URL error — semantic embedding silently disabled #479 Node 22/24 fix.
  • 16 docs: install commands + prose mentions across README.md, 11 READMEs/ translations, SECURITY.md, 2 benchmark docs, and the benchmark script.

Model IDs (Xenova/all-MiniLM-L6-v2, Xenova/clip-vit-base-patch32, Xenova/ms-marco-MiniLM-L-6-v2) deliberately kept — HF Hub repo names, still valid under v3/v4.

Verification

  • npm install — clean
  • npm test1424 passing, 1 skipped (the new smoke test)
  • RUN_HF_SMOKE=1 npx vitest run test/local-embedding-smoke.test.ts — real v4 model load, 384 finite dims (downloads ~80MB once)
  • npm run build — clean
  • Pre-existing tsc --noEmit errors are baseline (cli.ts, slots.ts, api.ts) — none touch migrated files

engines.node stays >=20.0.0 — the migration fixes Node 22/24 support rather than requiring it, so the floor remains honest. Node 20 is still in maintenance LTS and tested in CI.

Open question for maintainer

You asked for this to be reflected in the mintlify docs too, but I can't find them in this repo (docs/ has only benchmarks/recipes; website/ is a Next.js app with no .mdx/mint.json). Which repo/branch holds the mintlify docs?

License check

Package License
@huggingface/transformers 4.2.0 (new) Apache-2.0
@xenova/transformers 2.17.2 (removed) Apache-2.0
onnxruntime-node 1.14.0 → 1.24.3 MIT
onnxruntime-web 1.14.0 → 1.26.0-dev MIT
sharp 0.34.5 (new transitive) Apache-2.0
@huggingface/jinja (new transitive) MIT
@huggingface/tokenizers (new transitive) Apache-2.0

All permissive, all compatible with this repo's Apache-2.0. No NOTICE files required.

Follow-ups (deliberately out of scope)

Relates

Summary by CodeRabbit

  • New Features

    • Local embeddings, CLIP image embeddings, and reranking now use the Hugging Face Transformers package.
    • Local embeddings use the Xenova/all-MiniLM-L6-v2 model, providing 384-dimensional vectors.
  • Documentation

    • Updated setup instructions and embedding guidance across all localized READMEs.
    • Refreshed benchmarking and security documentation with the new package references.
  • Tests

    • Added coverage for local embeddings, CLIP embeddings, reranking, missing-package handling, and optional smoke testing.
    • Expanded CI coverage across additional Node.js versions.

@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

@aqeelat is attempting to deploy a commit to the rohitg00's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR migrates embedding and reranking integrations from @xenova/transformers to @huggingface/transformers, updates dependency and build configuration, adds provider validation tests and a gated smoke test, expands CI Node.js versions, and synchronizes documentation and benchmark guidance.

Changes

Transformers package migration

Layer / File(s) Summary
Runtime dependency and type wiring
package.json, src/providers/embedding/*.ts
Optional dependencies, dynamic imports, installation errors, CLIP typings, image handling, dtype options, and embedding conversions now target @huggingface/transformers.
Reranker pipeline integration
src/state/reranker.ts
Reranking loads the Hugging Face pipeline with the q8 dtype option.
Build configuration and provider validation
tsdown.config.ts, __mocks__/*, test/*, .github/workflows/ci.yml
Build exclusions, dependency mocks, provider and reranker tests, a gated real-model smoke test, and Node.js 24/26 CI coverage validate the migration.
Documentation and benchmark guidance
README.md, READMEs/README.*.md, SECURITY.md, benchmark/*
Installation commands, local model guidance, security examples, and benchmark messages now reference @huggingface/transformers.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: rohitg00

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main dependency migration from @xenova/transformers to @huggingface/transformers.
Linked Issues check ✅ Passed The PR matches the linked issues by migrating local embeddings to @huggingface/transformers and preserving the existing APIs and model usage.
Out of Scope Changes check ✅ Passed No clearly unrelated code changes stand out; the CI and smoke-test additions support the migration and Node.js 22+ fix.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/huggingface.d.ts (1)

1-6: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid broad any/unknown declarations for the optional package.

@huggingface/transformers 4.2.0 ships TypeScript declarations, including a typed RawImage.fromBlob(): Promise<RawImage>. This ambient shim widens the APIs to any and unknown, allowing invalid pipeline options and image handling to compile. Keep only a narrow fallback interface if omitted optional dependencies must still type-check. (npmjs.com)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/huggingface.d.ts` around lines 1 - 6, Update the ambient module
declaration for `@huggingface/transformers` to avoid broad any and unknown types,
relying on the package’s shipped declarations when available and retaining only
a narrow fallback interface if needed for absent optional dependencies. Preserve
typed pipeline options and make RawImage.fromBlob return the declared RawImage
type.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Line 1267: Update the README description for EMBEDDING_PROVIDER=local to
identify Xenova/all-MiniLM-L6-v2 as the default on-device model instead of
BGE-small, keeping the existing local-embedding behavior and configuration
guidance unchanged.

In `@test/reranker.test.ts`:
- Around line 3-10: Add a second reranker test case with a successful mock of
the `@huggingface/transformers` pipeline, alongside the existing
unavailable-module test. Exercise rerank and assert the mocked pipeline is
invoked or produces a changed ranking, so the test verifies the intended module
is loaded and used.

---

Nitpick comments:
In `@src/huggingface.d.ts`:
- Around line 1-6: Update the ambient module declaration for
`@huggingface/transformers` to avoid broad any and unknown types, relying on the
package’s shipped declarations when available and retaining only a narrow
fallback interface if needed for absent optional dependencies. Preserve typed
pipeline options and make RawImage.fromBlob return the declared RawImage type.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 15cb4830-5d34-4022-87d3-edd1a031e265

📥 Commits

Reviewing files that changed from the base of the PR and between a8e7d19 and ee991ca.

📒 Files selected for processing (24)
  • README.md
  • READMEs/README.de-DE.md
  • READMEs/README.es-ES.md
  • READMEs/README.fr-FR.md
  • READMEs/README.hi-IN.md
  • READMEs/README.ja-JP.md
  • READMEs/README.ko-KR.md
  • READMEs/README.pt-BR.md
  • READMEs/README.ru-RU.md
  • READMEs/README.tr-TR.md
  • READMEs/README.zh-CN.md
  • READMEs/README.zh-TW.md
  • SECURITY.md
  • benchmark/LONGMEMEVAL.md
  • benchmark/REAL-EMBEDDINGS.md
  • benchmark/real-embeddings-eval.ts
  • package.json
  • src/huggingface.d.ts
  • src/providers/embedding/clip.ts
  • src/providers/embedding/local.ts
  • src/state/reranker.ts
  • src/xenova.d.ts
  • test/reranker.test.ts
  • tsdown.config.ts
💤 Files with no reviewable changes (1)
  • src/xenova.d.ts

Comment thread README.md Outdated
Comment thread test/reranker.test.ts

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/reranker.test.ts`:
- Around line 106-107: Make the mock cleanup around the reranker tests
exception-safe by moving vi.doUnmock("`@huggingface/transformers`") into an
afterEach hook or a try/finally block. Keep vi.resetModules() as module-cache
cleanup, and ensure the unmock always runs even when a test assertion fails.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 056f358f-378b-4d83-b869-d6f9298d82ea

📥 Commits

Reviewing files that changed from the base of the PR and between ee991ca and b58a76d.

📒 Files selected for processing (4)
  • README.md
  • src/providers/embedding/clip.ts
  • src/state/reranker.ts
  • test/reranker.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/state/reranker.ts
  • src/providers/embedding/clip.ts

Comment thread test/reranker.test.ts Outdated
@aqeelat
aqeelat marked this pull request as draft July 21, 2026 21:20
…s v4

@xenova/transformers@2.x is deprecated and silently broken on Node 22+
(see rohitg00#479). The project was renamed to @huggingface/transformers; same
Apache-2.0 license, same code. v4 ships onnxruntime-node/web and sharp
as hard deps, so they're dropped from our optionalDependencies.

Pipeline / RawImage.fromBlob / tolist / text-classification output
shape all unchanged. Three behavior-preserving adjustments needed:

- All 4 pipeline call sites pass { dtype: "q8" }. v4's default on Node
  is fp32 (DEFAULT_DEVICE_DTYPE = "fp32"); v2 defaulted to quantized=true.
  Without explicit dtype, all 4 sites silently regress (~3.5x larger
  download, slower inference). dtype "q8" maps to model_quantized.onnx
  per v4's DEFAULT_DTYPE_SUFFIX_MAPPING; file exists in all 3 Xenova
  models. This was the regression that prompted the test additions below.
- src/providers/embedding/local.ts: split import try/catch from
  pipeline() call so model-load errors (network, missing q8 variant,
  disk) propagate with their actual message, not masked as
  "Install @huggingface/transformers...".
- src/providers/embedding/{local,clip}.ts: type module from
  typeof import("@huggingface/transformers") so PretrainedModelOptions
  flows through; drop hand-rolled aliases and @ts-ignore. Cast at
  assignment sites (pipeline return union isn't structurally assignable
  to our narrow FeatureExtractor / ClipPipeline shapes).

Tests added where coverage was zero (would have caught the dtype
regression):

- test/local-embedding-provider.test.ts (3 tests): unavailable-path
  install hint; pipeline called with dtype:q8 + extractor options +
  mapped Float32Array result; embedBatch shape.
- test/clip-embedding-provider.test.ts (5 tests): unavailable-path;
  text pipeline dtype:q8 + result; embedBatch; embedImage with data:
  URL decode; custom model ID propagation.
- test/reranker.test.ts: positive-path using vi.doMock + resetModules.

Other:
- src/huggingface.d.ts deleted (package ships its own types).
- src/xenova.d.ts removed.
- src/providers/embedding/clip.ts: inline single-use DIMENSIONS constant.
- tsdown.config.ts: trim neverBundle list and comment.
- README.md L1267: BGE-small -> Xenova/all-MiniLM-L6-v2 (was always wrong).
- 16 docs: install commands + prose mentions across main README, 11
  translations, SECURITY.md, 2 benchmark docs, benchmark script.
- Model IDs (Xenova/all-MiniLM-L6-v2, Xenova/clip-vit-base-patch32,
  Xenova/ms-marco-MiniLM-L-6-v2) kept — HF Hub repo names, still valid.

Closes rohitg00#1095. Fixes rohitg00#479.

Verified: 1424/1424 tests pass, build clean, tsc clean on migrated files.
@aqeelat
aqeelat force-pushed the chore/migrate-xenova-to-hf-transformers branch from 8207bed to 826b8bf Compare July 22, 2026 19:59
@aqeelat
aqeelat marked this pull request as ready for review July 22, 2026 20:03

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/providers/embedding/clip.ts`:
- Around line 59-65: Update loadTransformers() to catch errors, replace only
missing-module ERR_MODULE_NOT_FOUND failures with an embedding-agnostic
`@huggingface/transformers` installation hint, and rethrow all other errors
unchanged. Also update the provider.embed("hello") expectation in the CLIP
embedding provider test to avoid asserting the image-specific message.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: db31cfcc-2707-47cd-bda0-5af3b848b9fc

📥 Commits

Reviewing files that changed from the base of the PR and between 8207bed and 826b8bf.

📒 Files selected for processing (25)
  • README.md
  • READMEs/README.de-DE.md
  • READMEs/README.es-ES.md
  • READMEs/README.fr-FR.md
  • READMEs/README.hi-IN.md
  • READMEs/README.ja-JP.md
  • READMEs/README.ko-KR.md
  • READMEs/README.pt-BR.md
  • READMEs/README.ru-RU.md
  • READMEs/README.tr-TR.md
  • READMEs/README.zh-CN.md
  • READMEs/README.zh-TW.md
  • SECURITY.md
  • benchmark/LONGMEMEVAL.md
  • benchmark/REAL-EMBEDDINGS.md
  • benchmark/real-embeddings-eval.ts
  • package.json
  • src/providers/embedding/clip.ts
  • src/providers/embedding/local.ts
  • src/state/reranker.ts
  • src/xenova.d.ts
  • test/clip-embedding-provider.test.ts
  • test/local-embedding-provider.test.ts
  • test/reranker.test.ts
  • tsdown.config.ts
💤 Files with no reviewable changes (1)
  • src/xenova.d.ts
🚧 Files skipped from review as they are similar to previous changes (18)
  • benchmark/REAL-EMBEDDINGS.md
  • READMEs/README.tr-TR.md
  • READMEs/README.ru-RU.md
  • SECURITY.md
  • src/state/reranker.ts
  • tsdown.config.ts
  • READMEs/README.zh-CN.md
  • test/reranker.test.ts
  • benchmark/LONGMEMEVAL.md
  • READMEs/README.ko-KR.md
  • READMEs/README.zh-TW.md
  • READMEs/README.es-ES.md
  • READMEs/README.hi-IN.md
  • READMEs/README.pt-BR.md
  • READMEs/README.de-DE.md
  • README.md
  • src/providers/embedding/local.ts
  • READMEs/README.fr-FR.md

Comment thread src/providers/embedding/clip.ts

@rohitg00 rohitg00 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks @aqeelat for the PR

This is the right migration and it's carefully done. @xenova/transformers is the deprecated name for the same project, @huggingface/transformers is the maintained successor (xenova plus the HF team, same repo, Apache-2.0), and Node 22 support is exactly what #479 needs. The license table and keeping the Xenova/* model IDs are both correct.

Two things before it goes in:

  1. The migrated tests mock @huggingface/transformers, so the green suite proves the import swap is consistent but not that v4 actually runs. Since this swaps the embedding/rerank/clip backend, could you add one non-mocked smoke that loads Xenova/all-MiniLM-L6-v2, embeds a string, and asserts 384 dims plus finite values? Guarding it behind an env flag (or it.skip by default) is fine so CI doesn't download the model on every run. That's the piece that would catch a v4 output-shape change, which the mocked tests can't.

  2. The description says it renames src/xenova.d.ts to src/huggingface.d.ts, but the file is still src/xenova.d.ts modified in place. Ambient module declarations match on the module name, not the filename, so the rename is safe. Please rename the file so the name isn't stale, or drop the "rename" line from the description.

P.S: Everything needs to be documented in mintlify docs too.

One note, no action needed: onnxruntime-web comes in transitively as 1.26.0-dev. The Node runtime path uses onnxruntime-node, so the web prerelease shouldn't matter, just flagging it.

On CI: the test matrix hasn't built here because first-time contributor PRs need a maintainer to approve the workflow run. We'll trigger it. Once it's green on ubuntu and macOS across Node 20 and 22, and the two items above land, this is good to merge.

aqeelat added 2 commits July 28, 2026 16:12
…atrix

Review follow-ups for rohitg00#1096:
- env-guarded non-mocked smoke test (RUN_HF_SMOKE=1) loading real
  Xenova/all-MiniLM-L6-v2, asserts 384 finite dims; skipped by default
- selective ERR_MODULE_NOT_FOUND handling in local/clip providers so real
  init errors propagate (checks err.code and err.cause.code to handle
  vitest mock-factory wrapping)
- CLIP install hint made embedding-agnostic (loader serves text + image)
- afterEach mock cleanup in doMock-based provider/reranker tests
- CI Node matrix: [20, 22] -> [20, 22, 24, 26] across ubuntu/macos
…g-module tests

The .cause branch in the ERR_MODULE_NOT_FOUND check existed only to
accommodate vitest's mock-factory wrapping, not a real Node loader
behavior. Replace it with a manual mock fixture (__mocks__/@huggingface/
transformers.ts) that throws a Node-shaped error at module top-level,
bypassing vitest's factory wrapper so the import rejects with err.code
set directly.

Production code now checks only err.code === 'ERR_MODULE_NOT_FOUND',
matching real Node behavior. Tests verify the same public contract
without coupling production code to the test framework.
@aqeelat

aqeelat commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@rohitg00 Both blocking items are in the last two commits (b1ea326, 35d3e83), description updated. Ready for re-review.

1. Non-mocked smoke testtest/local-embedding-smoke.test.ts, guarded by RUN_HF_SMOKE=1 so CI doesn't download the model by default. Loads the real Xenova/all-MiniLM-L6-v2, embeds a string, asserts 384 dims + finite values. Ran it locally on Node 24: green in ~6s.

2. xenova.d.ts — corrected the description. The file isn't renamed, it's deleted. @huggingface/transformers@4.2.0 ships its own types (incl. RawImage), so the ambient shim isn't needed — no huggingface.d.ts replacement.

3. Mintlify docs — I can't locate them in this repo (docs/ has only benchmarks/recipes; website/ is a Next.js app, no .mdx/mint.json). Which repo/branch should I update?

Also addressed the CodeRabbit items while in here: the blanket import-catch in local.ts/clip.ts now only rewrites ERR_MODULE_NOT_FOUND to the install hint (real init errors propagate unchanged), and the doMock-based test describes got afterEach cleanup. engines.node stays >=20.0.0 — the migration fixes Node 22/24 support rather than requiring it.

CI matrix expanded to [20, 22, 24, 26] across ubuntu/macos. Your "green on Node 20 and 22" gate stays the bar; 24 (active LTS) and 26 (current) are forward coverage for the #479 fix.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Line 55: Update the CI test step that runs npm test to set RUN_HF_SMOKE=1,
enabling test/local-embedding-smoke.test.ts while preserving the existing test
command and exclusions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 37c04c40-632b-45a2-8612-237de10f30b9

📥 Commits

Reviewing files that changed from the base of the PR and between 826b8bf and 35d3e83.

📒 Files selected for processing (8)
  • .github/workflows/ci.yml
  • __mocks__/@huggingface/transformers.ts
  • src/providers/embedding/clip.ts
  • src/providers/embedding/local.ts
  • test/clip-embedding-provider.test.ts
  • test/local-embedding-provider.test.ts
  • test/local-embedding-smoke.test.ts
  • test/reranker.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • test/local-embedding-provider.test.ts
  • src/providers/embedding/local.ts
  • test/reranker.test.ts
  • test/clip-embedding-provider.test.ts

Comment thread .github/workflows/ci.yml
# rework before Windows can be added back. Tracked as follow-up.
os: [ubuntu-latest, macos-latest]
node-version: [20, 22]
node-version: [20, 22, 24, 26]

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail
jq -r '.scripts.test // "<missing test script>"' package.json
rg -n 'RUN_HF_SMOKE' package.json .github/workflows/ci.yml

Repository: rohitg00/agentmemory

Length of output: 204


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo 'package test script:'
jq -r '.scripts.test // "<missing test script>"' package.json

echo
echo 'Workflow snippets around test invocation and env variables:'
sed -n '1,120p' .github/workflows/ci.yml

echo
echo 'RUN_HF_SMOKE occurrences:'
rg -n 'RUN_HF_SMOKE|HF|smoke|local-embedding' package.json .github/workflows/ci.yml test -S || true

Repository: rohitg00/agentmemory

Length of output: 2787


Enable the local embedding smoke test in CI.

The CI test step runs npm test, package scripts.test is vitest run --exclude test/integration.test.ts, and only test/local-embedding-smoke.test.ts gates on RUN_HF_SMOKE=1. Add RUN_HF_SMOKE to this step if the real-model embedding load should be part of CI.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml at line 55, Update the CI test step that runs npm
test to set RUN_HF_SMOKE=1, enabling test/local-embedding-smoke.test.ts while
preserving the existing test command and exclusions.

@rohitg00 rohitg00 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks @aqeelat for your contributions!

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

Labels

None yet

Projects

None yet

2 participants