abhigyanpatwari/GitNexus · error
response.message (sidecar init error)
Error message
response.message (sidecar init error)
What it means
After spawning the sidecar, spawnAndInit sends an 'init' message with the persisted embedding config and waits for a 'ready' reply. If the sidecar replies with type 'error', the error message from the sidecar process is re-thrown as an Error here. It means the sidecar process itself failed to initialize its embedding runtime or model.
Solutions
- Read the sidecar message — it identifies the init failure (model load, device selection, config validation) and fix that underlying cause.
- Clear or correct the persisted embedding config / forceDevice so init uses defaults (CPU, valid model).
- Verify the model files exist and are complete; re-download or point embeddingConfig at a valid local model path.
- Check GPU drivers/VRAM if a non-CPU device was forced; retry with forceDevice removed.
- Increase the init timeout if the model is large and load legitimately exceeds sidecarInitTimeoutMs().
Example fix
// before: forcing a device that may not exist
persistEmbeddingOptions({ forceDevice: 'gpu', embeddingConfig: cfg });
await ensureEmbeddingSidecar();
// after: let the sidecar pick a valid device
persistEmbeddingOptions({ forceDevice: undefined, embeddingConfig: validatedCfg });
await ensureEmbeddingSidecar(); Defensive patterns
Strategy: try-catch
Validate before calling
// validate persisted options before init const ok = persisted && typeof persisted.embeddingConfig?.model === 'string' && (!persisted.forceDevice || ['cpu', 'gpu'].includes(persisted.forceDevice)); if (!ok) resetPersistedEmbeddingOptions();
Try / catch
try {
await ensureEmbeddingSidecar();
} catch (e) {
// sidecar init error: inspect e.message (model/device/config), reset options, retry once
resetPersistedEmbeddingOptions();
await ensureEmbeddingSidecar();
} Prevention
- Validate model name/path and forceDevice in the persisted config before first init.
- Only force a device you have verified exists (query available devices first).
- Keep sidecar and CLI versions in lockstep.
- Pre-warm the sidecar at startup so init failures surface early, not mid-job.
When it happens
Trigger: ensureEmbeddingSidecar() → spawnAndInit() sends {type:'init', embeddingConfig, forceDevice}; the sidecar responds {type:'error', message} within sidecarInitTimeoutMs(); the message is thrown verbatim.
Common situations: Invalid or unsupported embedding model name/path in the persisted config; forceDevice naming a GPU that does not exist or lacks drivers; model download failure; corrupt model files; out-of-memory during model load.
Related errors
- Failed to load embedding model
- Local embeddings are unavailable after the sidecar aborted
- response.message (sidecar embed error)
- runtimeBlocker (local embedding runtime blocker message)
- analyze --watch does not support
AI-assisted analysis of abhigyanpatwari/GitNexus@ac9a4e9abd (2026-09-15).
Data as JSON: /api/errors/56d0676d95a2dedc.
Report an issue: GitHub.
Appendix: source
Thrown at gitnexus/src/core/embeddings/embedding-sidecar-client.ts:333
const persisted = {
embeddingConfig: options?.embeddingConfig ?? lastInitOptions?.embeddingConfig,
forceDevice: options?.forceDevice ?? lastInitOptions?.forceDevice,
};
child = spawnSidecar();
attachChild(child);
progressSink = options?.onProgress;
try {
const response = await request(
{
type: 'init',
embeddingConfig: persisted.embeddingConfig,
forceDevice: persisted.forceDevice,
},
sidecarInitTimeoutMs(),
);
if (response.type === 'error') throw new Error(response.message);
if (response.type !== 'ready') {
throw new Error(`Unexpected sidecar response: ${response.type}`);
}
ready = true;
device = response.device;
lastInitOptions = persisted;
} catch (err) {
reapEmbeddingSidecar();
throw err;
} finally {
progressSink = undefined;
}
};
const rejectConflictingForceDevice = (forceDevice?: EmbeddingSidecarDevice): void => {
if (forceDevice && forceDevice !== device) {
throw new Error(
`Embedding sidecar already initialized on ${device}; cannot switch to ${forceDevice}`,View on GitHub (pinned to ac9a4e9abd)