Skip to content

Commit 17abf86

Browse files
hyperpolymathclaude
andcommitted
fix(gitlab-mcp): add missing cap definition in gitlab_api_mcp_request
Pre-existing bug: const cap was never derived from out_cap in the first request function (it was present in the GraphQL and mirror functions but missing from the main request function). Surfaced by Zig 0.15's stricter identifier resolution. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent fba0013 commit 17abf86

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

cartridges/gitlab-api-mcp/ffi/gitlab_api_mcp_ffi.zig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ pub export fn gitlab_api_mcp_request(
329329
break :blk body[0..blen];
330330
} else null;
331331

332+
const cap: usize = std.math.cast(usize, out_cap) orelse return -4;
333+
332334
// Fetch the request (Zig 0.15 API — replaces open/send/wait)
333335
var aw: std.Io.Writer.Allocating = .init(allocator);
334336
defer aw.deinit();
@@ -349,7 +351,7 @@ pub export fn gitlab_api_mcp_request(
349351
return -3;
350352
}
351353

352-
// Handle server errors
354+
// Copy response body into caller's buffer
353355
const response_bytes = aw.writer.buffered();
354356
const bytes_read = @min(response_bytes.len, cap);
355357
@memcpy(out_buf[0..bytes_read], response_bytes[0..bytes_read]);

0 commit comments

Comments
 (0)