Skip to content

fix: avoid forced exit after embedding analyze#1787

Open
aro-has00 wants to merge 2 commits into
abhigyanpatwari:mainfrom
aro-has00:codex/fix-analyze-embedding-shutdown
Open

fix: avoid forced exit after embedding analyze#1787
aro-has00 wants to merge 2 commits into
abhigyanpatwari:mainfrom
aro-has00:codex/fix-analyze-embedding-shutdown

Conversation

@aro-has00
Copy link
Copy Markdown

Summary

  • let successful embedding-enabled analyze runs unwind naturally instead of forcing process.exit(0)
  • keep the existing forced-exit behavior for successful non-embedding analyzes
  • add unit coverage for embedding analyze shutdown classification

Why

On macOS arm64 / Node 20, local embedding runs initialize transformers.js / ONNX Runtime successfully, write metadata and embeddings, then abort during process.exit(0) with:

libc++abi: terminating due to uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument

A minimal probe showed natural Node exit after local embedding is clean, while process.exit(0) after embedder initialization reproduces the abort. This matches the post-success crash reported in #151.

Validation

  • npm test -- analyze-embeddings-limit.test.ts
  • npx tsc --noEmit
  • patched source CLI on disposable repo with --embeddings --skip-agents-md: EXIT_CODE=0, EMBEDDINGS=1
  • patched source CLI on disposable repo without --embeddings: EXIT_CODE=0

@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

@aro-has00 is attempting to deploy a commit to the NexusCore Team on Vercel.

A member of the Team first needs to authorize it.

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