szn

Bug 166 — main.zig — Output write to stdout ignores errors and partial writes

166. main.zig — Output write to stdout ignores errors and partial writes

File: src/main.zig:453 Severity: HIGH Status: ✅ FIXED — added writeAll helper with EINTR/partial-write retry loop; all c.write calls in runInteractiveClient switched to it.

.output => {
    _ = c.write(stdout_fd, data.ptr, data.len);
},

No error check, no partial write retry. When opencode generates large output, the socket read can return a big chunk, and writing it to stdout may only partially succeed. Data is silently lost, causing garbled display.

Fix: Add retry loop with EINTR and partial write handling. Also fix the stdin_data write to server_fd (line 449) which similarly ignores errors.