code-graph-context 2.12.5 → 2.12.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -432,7 +432,6 @@ export const CORE_TYPESCRIPT_SCHEMA = {
432
432
  labels: ['Enum', 'TypeScript'],
433
433
  primaryLabel: 'Enum',
434
434
  indexed: ['name', 'isExported'],
435
- skipEmbedding: true,
436
435
  },
437
436
  },
438
437
  [CoreNodeType.FUNCTION_DECLARATION]: {
@@ -493,7 +492,6 @@ export const CORE_TYPESCRIPT_SCHEMA = {
493
492
  labels: ['Variable', 'TypeScript'],
494
493
  primaryLabel: 'Variable',
495
494
  indexed: ['name'],
496
- skipEmbedding: true,
497
495
  },
498
496
  },
499
497
  [CoreNodeType.TYPE_ALIAS]: {
@@ -514,7 +512,6 @@ export const CORE_TYPESCRIPT_SCHEMA = {
514
512
  labels: ['TypeAlias', 'TypeScript'],
515
513
  primaryLabel: 'TypeAlias',
516
514
  indexed: ['name'],
517
- skipEmbedding: true,
518
515
  },
519
516
  },
520
517
  [CoreNodeType.CONSTRUCTOR_DECLARATION]: {
@@ -28,15 +28,23 @@ export class LocalEmbeddingsService {
28
28
  const totalBatches = Math.ceil(texts.length / safeBatchSize);
29
29
  for (let i = 0; i < texts.length; i += safeBatchSize) {
30
30
  const batch = texts.slice(i, i + safeBatchSize);
31
- const batchIndex = Math.floor(i / batchSize) + 1;
31
+ const batchIndex = Math.floor(i / safeBatchSize) + 1;
32
+ console.error(`[embedding] Batch ${batchIndex}/${totalBatches} (${batch.length} texts)`);
32
33
  await debugLog('Embedding batch progress', {
33
34
  provider: 'local',
34
35
  batchIndex,
35
36
  totalBatches,
36
37
  batchSize: batch.length,
37
38
  });
38
- const batchResults = await sidecar.embed(batch);
39
- results.push(...batchResults);
39
+ try {
40
+ const batchResults = await sidecar.embed(batch);
41
+ results.push(...batchResults);
42
+ }
43
+ catch (error) {
44
+ const msg = error instanceof Error ? error.message : String(error);
45
+ console.error(`[embedding] Batch ${batchIndex}/${totalBatches} FAILED: ${msg}`);
46
+ throw error;
47
+ }
40
48
  }
41
49
  return results;
42
50
  }
@@ -132,11 +132,16 @@ export class GraphGeneratorHandler {
132
132
  // Batch embed all texts that need it
133
133
  if (nodesNeedingEmbedding.length > 0) {
134
134
  const texts = nodesNeedingEmbedding.map((n) => n.text);
135
+ const totalBatches = Math.ceil(texts.length / EMBEDDING_BATCH_CONFIG.maxBatchSize);
136
+ console.error(`[embedding] Starting ${texts.length} texts in ${totalBatches} batches (batch_size=${EMBEDDING_BATCH_CONFIG.maxBatchSize})`);
135
137
  try {
136
138
  const embeddings = await this.embeddingsService.embedTextsInBatches(texts, EMBEDDING_BATCH_CONFIG.maxBatchSize);
137
139
  // Map embeddings back to their nodes
140
+ let embeddedCount = 0;
138
141
  nodesNeedingEmbedding.forEach((item, i) => {
139
142
  const embedding = embeddings[i];
143
+ if (embedding)
144
+ embeddedCount++;
140
145
  nodeResults[item.index] = {
141
146
  ...item.node,
142
147
  labels: embedding ? [...item.node.labels, GraphGeneratorHandler.EMBEDDED_LABEL] : item.node.labels,
@@ -146,15 +151,17 @@ export class GraphGeneratorHandler {
146
151
  },
147
152
  };
148
153
  });
154
+ console.error(`[embedding] Done: ${embeddedCount}/${texts.length} nodes embedded`);
149
155
  await debugLog('Batch embedding completed', {
150
156
  totalNodes: nodes.length,
151
- nodesEmbedded: nodesNeedingEmbedding.length,
152
- batchesUsed: Math.ceil(texts.length / EMBEDDING_BATCH_CONFIG.maxBatchSize),
157
+ nodesEmbedded: embeddedCount,
158
+ batchesUsed: totalBatches,
153
159
  });
154
160
  }
155
161
  catch (error) {
156
- // DON'T silently continue - propagate the error so user knows what's wrong
157
- await debugLog('Embedding failed', { error: error instanceof Error ? error.message : String(error) });
162
+ const msg = error instanceof Error ? error.message : String(error);
163
+ console.error(`[embedding] FAILED: ${msg}`);
164
+ await debugLog('Embedding failed', { error: msg });
158
165
  throw error;
159
166
  }
160
167
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-graph-context",
3
- "version": "2.12.5",
3
+ "version": "2.12.7",
4
4
  "description": "MCP server that builds code graphs to provide rich context to LLMs",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/drewdrewH/code-graph-context#readme",