Task
In src/tri-api/mcp_client.zig around lines 53-68, the connectServer() function creates a Child process but if spawn fails, child.deinit() is never called — process resources leak.
Current Code
var child = std.process.Child.init(command, self.allocator);
child.stdin_behavior = .Pipe;
child.stdout_behavior = .Pipe;
child.stderr_behavior = .Ignore;
child.spawn() catch |err| {
std.debug.print("[mcp] Failed to spawn {s}: {s}\n", .{ name, @errorName(err) });
return 0; // ← child never deinited
};
Fix
Add child.deinit() before the early return in the error path:
child.spawn() catch |err| {
std.debug.print("[mcp] Failed to spawn {s}: {s}\n", .{ name, @errorName(err) });
child.deinit();
return 0;
};
File
src/tri-api/mcp_client.zig — around lines 53-68
Acceptance
zig build compiles without errors
zig fmt passes
child.deinit() called before early return in spawn error path
Task
In
src/tri-api/mcp_client.zigaround lines 53-68, theconnectServer()function creates a Child process but if spawn fails,child.deinit()is never called — process resources leak.Current Code
Fix
Add
child.deinit()before the early return in the error path:File
src/tri-api/mcp_client.zig— around lines 53-68Acceptance
zig buildcompiles without errorszig fmtpasseschild.deinit()called before early return in spawn error path