{"record":{"id":"5114b469c909f532","repo":"thedotmack/claude-mem","slug":"failed-to-spawn-sdk-subprocess-for-session-sessi","errorCode":null,"errorMessage":"Failed to spawn SDK subprocess for session ${sessionDbId}","messagePattern":"Failed to spawn SDK subprocess for session (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/supervisor/process-registry.ts","lineNumber":819,"sourceCode":"      }\n    }\n\n    let result: ReturnType<typeof spawnSdkProcess>;\n    try {\n      result = spawnSdkProcess(sessionDbId, {\n        ...spawnOptions,\n        extraArgs: [...(spawnOptions.extraArgs ?? []), ...extraArgs],\n      });\n    } finally {\n      // The waitForSlot() reservation is consumed here: on success the\n      // process is now a registry record (registered inside spawnSdkProcess)\n      // and takes over the slot accounting; on failure the slot goes back to\n      // the pool. Both statements above are synchronous, so no other caller\n      // can observe the reservation and the record at the same time.\n      slotReservation?.release();\n    }\n    if (!result) {\n      throw new Error(`Failed to spawn SDK subprocess for session ${sessionDbId}`);\n    }\n\n    return result.process;\n  };\n}\n","sourceCodeStart":801,"sourceCodeEnd":825,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d768ba364302d12b76e69e4f021f0bb1d2d50ed6/src/supervisor/process-registry.ts#L801-L825","documentation":"Error \"Failed to spawn SDK subprocess for session ${sessionDbId}\" thrown in thedotmack/claude-mem.","triggerScenarios":"Fires when spawning the Claude SDK subprocess for a session fails: the Claude CLI binary is missing or too old, CLAUDE_CODE_PATH points at a bad binary, the spawn hits OS limits (EMFILE/ENOMEM), or the subprocess exits immediately. Guard at src/supervisor/process-registry.ts:819 surfaces the failure instead of leaving the session silently unprocessed.","commonSituations":"See trigger scenarios.","solutions":["Check the spawn error above this one (SDK executable path, permissions, resource limits) and fix the underlying cause.","Verify the Claude executable resolves correctly and the session's memorySessionId is valid before retrying."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d768ba364302d12b76e69e4f021f0bb1d2d50ed6","analyzedAt":"2026-08-12T23:52:55.241Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}