{"record":{"id":"70f9bc139d168a1b","repo":"thedotmack/claude-mem","slug":"transport-error-during-toolname-reconnecting","errorCode":null,"errorMessage":"Transport error during \"${toolName}\", reconnecting and retrying once","messagePattern":"Transport error during \"(.+?)\", reconnecting and retrying once","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/services/sync/ChromaMcpManager.ts","lineNumber":780,"sourceCode":"    return this.enqueueMutation(() => this.callToolUnqueued(toolName, toolArguments), toolName);\n  }\n\n  private async callToolUnqueued(toolName: string, toolArguments: Record<string, unknown>): Promise<unknown> {\n    const callGeneration = this.connectionGeneration;\n    await this.ensureConnected();\n\n    logger.debug('CHROMA_MCP', `Calling tool: ${toolName}`, {\n      arguments: JSON.stringify(toolArguments).slice(0, 200)\n    });\n\n    let result;\n    try {\n      result = await this.client!.callTool({\n        name: toolName,\n        arguments: toolArguments\n      });\n    } catch (transportError) {\n      logger.warn('CHROMA_MCP', `Transport error during \"${toolName}\", reconnecting and retrying once`, {\n        error: transportError instanceof Error ? transportError.message : String(transportError)\n      });\n\n      if (callGeneration !== this.connectionGeneration) {\n        throw new ChromaMcpConnectionCancelledError('chroma-mcp call cancelled during shutdown');\n      }\n\n      // Tree-kill the dying subprocess before reconnect. Previously this path\n      // just nulled the handle, which on Linux leaks the uv/python/chroma-mcp\n      // descendants every time a transport error happens (#2313).\n      await this.disposeCurrentSubprocess();\n\n      try {\n        if (callGeneration !== this.connectionGeneration) {\n          throw new ChromaMcpConnectionCancelledError('chroma-mcp call cancelled during shutdown');\n        }\n        await this.ensureConnected();\n        result = await this.client!.callTool({","sourceCodeStart":762,"sourceCodeEnd":798,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/8bc631a71a487424b866756e43a6efa4574cc66b/src/services/sync/ChromaMcpManager.ts#L762-L798","documentation":"A chroma MCP tool call failed with a transport-level error (subprocess crash, closed stdio pipe, dropped session). The manager tree-kills the dying subprocess (preventing Linux descendant leaks, #2313), reconnects, and retries the exact call once. A single warn is expected noise; if the retry also fails, that error propagates to the caller.","triggerScenarios":"callTool() in flight when the chroma-mcp process dies — OOM kill, chroma crash, native crash — or the stdio pipe breaking during suspend/resume or protocol version mismatch causing a hard close.","commonSituations":"chroma-mcp children killed by an OS OOM manager; laptops sleeping mid-call; client/server MCP protocol drift after partial upgrades.","solutions":["Treat isolated occurrences as benign — the built-in reconnect-and-retry usually recovers","If recurrent, check dmesg or journalctl for OOM kills of the uv/python children","Keep claude-mem and chroma-mcp versions matched so protocol versions agree","Correlate with connect-time stderrTail warnings to find the underlying crash"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":"import { ChromaMcpConnectionCancelledError } from './errors';\n\nfunction isConnectionCancelled(e: unknown): boolean {\n  return e instanceof ChromaMcpConnectionCancelledError;\n}","tryCatchPattern":"try {\n  result = await manager.callTool(toolName, args);\n} catch (err) {\n  if (isConnectionCancelled(err)) throw err; // shutdown in progress — do not retry\n  // one internal reconnect+retry already happened; treat final failure as degraded\n  enterDegradedMode();\n}","preventionTips":["Watch memory pressure — OOM-killed chroma-mcp children are the top cause of transport errors","Keep client and chroma-mcp versions in lockstep so the MCP protocol does not hard-close","Handle suspend/resume in long-running processes by probing isHealthy() afterwards"],"tags":["chroma","mcp","transport","retry","subprocess-crash"],"backgroundTag":"mcp-transport-error","analyzedSha":"8bc631a71a487424b866756e43a6efa4574cc66b","analyzedAt":"2026-08-20T23:58:13.836Z","contentChangedAt":"2026-08-20T23:58:13.836Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}