Skip to content

Commit aa3212f

Browse files
Antigravity Agentclaude
andcommitted
fix(cloud): compile errors in Golden Chain pipeline — format strings, signed division, sleep API
- Fix format string arg order in cloudMergePR (GREEN/pr_num/RESET) - Fix signed i64 division: use @divTrunc/@mod instead of / and % - Fix std.time.sleep → std.Thread.sleep (Zig 0.15 API) - Fix bare print() calls missing .{} args - Fix format string arg count mismatches in agents table header Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5082b01 commit aa3212f

1 file changed

Lines changed: 14 additions & 18 deletions

File tree

src/tri/tri_cloud.zig

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,8 @@ fn cloudAgents(_: Allocator) !void {
481481
var stuck_count: u32 = 0;
482482

483483
// Header
484-
print(" {s}# {s}Status{s} {s}Detail{s} {s}Elapsed{s} {s}Health{s}\n", .{ BOLD, RESET, BOLD, RESET, BOLD, RESET, BOLD, RESET, BOLD, RESET });
485-
print(" {s}──── {s}────────{s} {s}────────────────────────────────{s} {s}───────{s} {s}──────{s}\n", .{ GRAY, RESET, GRAY, RESET, GRAY, RESET, GRAY, RESET, GRAY, RESET, GRAY });
484+
print(" {s}#{s} {s}Status{s} {s}Detail{s} {s}Elapsed{s} {s}Health{s}\n", .{ BOLD, RESET, BOLD, RESET, BOLD, RESET, BOLD, RESET, BOLD, RESET });
485+
print(" {s}──── ──────── ──────────────────────────────── ─────── ──────{s}\n", .{ GRAY, RESET });
486486

487487
for (0..issue_count) |i| {
488488
const st = statuses[i][0..stat_lens[i]];
@@ -522,24 +522,20 @@ fn cloudAgents(_: Allocator) !void {
522522
if (is_stuck) stuck_count += 1;
523523

524524
// Health indicator
525-
const health = if (is_stuck)
526-
"{s}⚠ STUCK{s}"
527-
else if (elapsed > 300) // >5 min
528-
"{s}🟡 SLOW{s}"
529-
else
530-
"{s}🟢 OK{s}";
525+
const health_text: []const u8 = if (is_stuck) "⚠ STUCK" else if (elapsed > 300) "🟡 SLOW" else "🟢 OK";
526+
const health_color = if (is_stuck) YELLOW else if (elapsed > 300) YELLOW else GREEN;
531527

532528
// Format elapsed time
533529
var elapsed_buf: [32]u8 = undefined;
534530
const elapsed_str = if (elapsed < 60)
535531
std.fmt.bufPrint(&elapsed_buf, "{d}s", .{elapsed}) catch "?"
536532
else if (elapsed < 3600)
537-
std.fmt.bufPrint(&elapsed_buf, "{d}m{d}s", .{ elapsed / 60, elapsed % 60 }) catch "?"
533+
std.fmt.bufPrint(&elapsed_buf, "{d}m{d}s", .{ @divTrunc(elapsed, 60), @mod(elapsed, 60) }) catch "?"
538534
else
539-
std.fmt.bufPrint(&elapsed_buf, "{d}h{d}m", .{ elapsed / 3600, (elapsed % 3600) / 60 }) catch "?";
535+
std.fmt.bufPrint(&elapsed_buf, "{d}h{d}m", .{ @divTrunc(elapsed, 3600), @divTrunc(@mod(elapsed, 3600), 60) }) catch "?";
540536

541-
print(" #{d:<4} {s} {s}{s:<12}{s} {s:<32} {s}{s:<7} {s}\n", .{
542-
issues[i], emoji, color, st, RESET, dt, GRAY, elapsed_str, RESET, health, RESET,
537+
print(" #{d:<4} {s} {s}{s:<12}{s} {s:<32} {s}{s:<7}{s} {s}{s}{s}\n", .{
538+
issues[i], emoji, color, st, RESET, dt, GRAY, elapsed_str, RESET, health_color, health_text, RESET,
543539
});
544540
count += 1;
545541
}
@@ -548,11 +544,11 @@ fn cloudAgents(_: Allocator) !void {
548544
print(" {s}No active agents{s}\n", .{ GRAY, RESET });
549545
} else {
550546
print("{s}─────────────────────────────────────────────────{s}\n", .{ GRAY, RESET });
551-
print(" {s}{d} agent(s)", .{ GRAY, count, RESET });
547+
print(" {s}{d} agent(s){s}", .{ GRAY, count, RESET });
552548
if (stuck_count > 0) {
553549
print(" {s}{d} stuck (>10min){s}", .{ YELLOW, stuck_count, RESET });
554550
}
555-
print("\n");
551+
print("\n", .{});
556552
}
557553
print("{s}═════════════════════════════════════════════════{s}\n", .{ GOLDEN, RESET });
558554
}
@@ -878,7 +874,7 @@ fn cloudPipeline(allocator: Allocator, args: []const []const u8) !void {
878874
print(" {s}✓ Respawned (retry {d}){s}\n", .{ GREEN, retry_count, RESET });
879875
last_status_update = std.time.timestamp();
880876
// Wait for new agent to start
881-
std.time.sleep(5 * std.time.ns_per_s);
877+
std.Thread.sleep(5 * std.time.ns_per_s);
882878
continue;
883879
}
884880

@@ -909,7 +905,7 @@ fn cloudPipeline(allocator: Allocator, args: []const []const u8) !void {
909905
}
910906

911907
// Wait before next check
912-
std.time.sleep(10 * std.time.ns_per_s);
908+
std.Thread.sleep(10 * std.time.ns_per_s);
913909
}
914910

915911
// Step 6: Cleanup
@@ -1008,7 +1004,7 @@ fn cloudVerifyPR(allocator: Allocator, issue_num: u32) !bool {
10081004
}
10091005

10101006
// Run zig build
1011-
print(" Building (zig build)...\n");
1007+
print(" Building (zig build)...\n", .{});
10121008
const build_result = try std.process.Child.run(.{
10131009
.allocator = allocator,
10141010
.argv = &.{ "zig", "build" },
@@ -1073,7 +1069,7 @@ fn cloudMergePR(allocator: Allocator, issue_num: u32) !void {
10731069
return error.MergeFailed;
10741070
}
10751071

1076-
print(" {s}✓ PR #{d} merged{s}\n", .{ GREEN, RESET, pr_num });
1072+
print(" {s}✓ PR #{d} merged{s}\n", .{ GREEN, pr_num, RESET });
10771073
}
10781074

10791075
fn getStatusEmoji(status: []const u8) []const u8 {

0 commit comments

Comments
 (0)