fix: resolve orphaned subprocesses and Chroma HTTP regressions

- Add subprocess cleanup after SDK query loop completes, using existing
  ProcessRegistry infrastructure (getProcessBySession + ensureProcessExit)
- Replace npx-based Chroma binary spawning with absolute path resolution
  via require.resolve, falling back to npx with explicit cwd (#1120)
- Remove @chroma-core/default-embed client-side dependency; let Chroma
  HTTP server handle embeddings server-side (#1104, #1105, #1110)

Closes #1010, #1089, #1090, #1068, #1120, #1104, #1105, #1110

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alex Newman
2026-02-15 22:04:52 -05:00
parent 685d54f2cb
commit e1ef14dbcc
5 changed files with 163 additions and 132 deletions
+4 -7
View File
@@ -189,14 +189,11 @@ export class ChromaSync {
}
try {
// getOrCreateCollection handles both cases
// Lazy-load DefaultEmbeddingFunction to avoid eagerly pulling in
// @huggingface/transformers → sharp native binaries at bundle startup
const { DefaultEmbeddingFunction } = await import('@chroma-core/default-embed');
const embeddingFunction = new DefaultEmbeddingFunction();
// Let the Chroma HTTP server handle embeddings server-side.
// Removes dependency on @chroma-core/default-embed which requires
// onnxruntime + sharp native binaries that fail on many platforms (#1104, #1105, #1110).
this.collection = await this.chromaClient.getOrCreateCollection({
name: this.collectionName,
embeddingFunction
name: this.collectionName
});
logger.debug('CHROMA_SYNC', 'Collection ready', { collection: this.collectionName });