Skip to content

[AIG-922] Fix on-prem Docker build: optional @xenova import no longer breaks tsc (TS2307) - #56

Merged
blackms merged 1 commit into
mainfrom
pm-agent/AIG-922-fix-docker-xenova
Jun 8, 2026
Merged

[AIG-922] Fix on-prem Docker build: optional @xenova import no longer breaks tsc (TS2307)#56
blackms merged 1 commit into
mainfrom
pm-agent/AIG-922-fix-docker-xenova

Conversation

@blackms

@blackms blackms commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the coverage job on main (flaky-red, pre-existing): the on-prem docker build (tests/integration/docker-helm.test.ts, AIG-647) failed because @xenova/transformers — an optionalDependency (vector-WASM, AIG-653) with heavy native deps — fails to install in the slim image, so tsc hit TS2307 Cannot find module on the literal dynamic import at src/memory/embedding/wasm/model-loader.ts:54.

Change (1 file, 1 import)

Hold the specifier in a variable so tsc does not statically resolve the optional module:

const specifier = '@xenova/transformers';
const mod = (await import(specifier)) as unknown as TransformersLibrary;

Runtime behaviour is unchanged — Node resolves the specifier at runtime and the surrounding try/catch already returns null when the dep is absent.

Why this is not a regression from the recent merges

The coverage job is main-only (if: push && ref==main) and was already intermittently red before this session (e.g. main runs de30879/1aa93ea green, 19f44b3/7d9ec93 red). docker-helm.test.ts (AIG-647) and the @xenova import (AIG-653) pre-date AIG-852/854/855/866/867.

Validation note

No PR job reproduces the "@xenova absent" condition (PR Build runs on ubuntu where the optional dep installs). The fix is validated by the post-merge coverage run on main (which runs the real docker build).

Closes AIG-922.

…c/Docker build doesn't fail when absent
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@blackms, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 6 minutes and 44 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7496e3d6-6e2b-4de8-a462-2448b8b2b0b0

📥 Commits

Reviewing files that changed from the base of the PR and between 790612d and e6d651e.

📒 Files selected for processing (1)
  • src/memory/embedding/wasm/model-loader.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pm-agent/AIG-922-fix-docker-xenova

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 and usage tips.

@blackms
blackms merged commit dda4ae3 into main Jun 8, 2026
7 checks passed
@blackms
blackms deleted the pm-agent/AIG-922-fix-docker-xenova branch June 8, 2026 07:56
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