{"record":{"id":"73384a1c3b0987c6","repo":"garrytan/gstack","slug":"sidecar-spawn-failed","errorCode":null,"errorMessage":"sidecar-spawn-failed","messagePattern":"sidecar-spawn-failed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"browse/src/security-sidecar-client.ts","lineNumber":193,"sourceCode":"  // Probe via findSecuritySidecar without spawning. If the resolver returns\n  // null (no node on PATH, no entry on disk), we're permanently unavailable\n  // until a setup re-run.\n  const location = findSecuritySidecar();\n  if (!location) return { available: false, reason: \"no-node-or-entry\" };\n  return { available: true };\n}\n\nexport async function scanWithSidecar(text: string, opts?: { timeoutMs?: number }): Promise<{ verdict: unknown }> {\n  const s = getState();\n  if (s.brokenCircuit) {\n    throw new Error(\"sidecar-circuit-broken\");\n  }\n  if (Buffer.byteLength(text, \"utf-8\") > REQUEST_CAP_BYTES) {\n    throw new Error(\"payload-too-large\");\n  }\n  if (!s.child) {\n    if (!spawnSidecar()) {\n      throw new Error(\"sidecar-spawn-failed\");\n    }\n  }\n  const id = String(s.nextId++);\n  const timeoutMs = opts?.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n\n  return new Promise((resolve, reject) => {\n    const timer = setTimeout(() => {\n      s.pending.delete(id);\n      recordFailure();\n      reject(new Error(\"sidecar-timeout\"));\n    }, timeoutMs);\n\n    s.pending.set(id, {\n      resolve: (response: unknown) => {\n        const r = response as { verdict?: unknown };\n        resolve({ verdict: r.verdict });\n      },\n      reject,","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/security-sidecar-client.ts#L175-L211","documentation":"Error \"sidecar-spawn-failed\" thrown in garrytan/gstack.","triggerScenarios":"Thrown at browse/src/security-sidecar-client.ts:193 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}