code-graph-context 2.10.1 → 2.10.2
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.
|
@@ -174,6 +174,13 @@ export class EmbeddingSidecar {
|
|
|
174
174
|
});
|
|
175
175
|
if (!res.ok) {
|
|
176
176
|
const detail = await res.text();
|
|
177
|
+
const isOOM = detail.toLowerCase().includes('out of memory');
|
|
178
|
+
if (res.status === 500 && isOOM) {
|
|
179
|
+
// OOM leaves GPU memory in a corrupted state — kill the sidecar
|
|
180
|
+
// so the next request spawns a fresh process with clean memory
|
|
181
|
+
console.error('[embedding-sidecar] OOM detected, restarting sidecar to reclaim GPU memory');
|
|
182
|
+
await this.stop();
|
|
183
|
+
}
|
|
177
184
|
throw new Error(`Sidecar embed failed (${res.status}): ${detail}`);
|
|
178
185
|
}
|
|
179
186
|
const data = (await res.json());
|
|
@@ -183,6 +190,9 @@ export class EmbeddingSidecar {
|
|
|
183
190
|
}
|
|
184
191
|
catch (err) {
|
|
185
192
|
if (err instanceof Error && err.name === 'AbortError') {
|
|
193
|
+
// Timeout likely means the sidecar is stuck — kill it
|
|
194
|
+
console.error('[embedding-sidecar] Request timed out, restarting sidecar');
|
|
195
|
+
await this.stop();
|
|
186
196
|
throw new Error(`Embedding request timed out after ${this.config.requestTimeoutMs}ms`);
|
|
187
197
|
}
|
|
188
198
|
throw err;
|
package/package.json
CHANGED