From 0035d31fc99a6b0df20d51eb1d27f686cb214ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Arrufat?= Date: Wed, 29 Jul 2026 09:12:16 +0200 Subject: [PATCH] codex: use std.json.fmt for poll body --- src/agent/auth/codex.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/agent/auth/codex.zig b/src/agent/auth/codex.zig index d2eb67a58..b25882341 100644 --- a/src/agent/auth/codex.zig +++ b/src/agent/auth/codex.zig @@ -148,7 +148,10 @@ fn deviceLogin(allocator: std.mem.Allocator, interrupt: ?*zenai.http.Interrupt) .{ verify_url, dc.user_code }, ); - const poll_body = try std.fmt.allocPrint(a, "{{\"device_auth_id\":\"{s}\",\"user_code\":\"{s}\"}}", .{ dc.device_auth_id, dc.user_code }); + const poll_body = try std.fmt.allocPrint(a, "{f}", .{std.json.fmt( + .{ .device_auth_id = dc.device_auth_id, .user_code = dc.user_code }, + .{}, + )}); const dt: DeviceToken = while (true) { // The REPL's Ctrl-C only fires the interrupt (it never kills the // process), so the wait must poll it.