From 7289281784a54876c52d9be79d2bbdacf55c9581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Arrufat?= Date: Wed, 23 Sep 2026 11:00:36 +0200 Subject: [PATCH] agent: record the --url navigation for a REPL /save too It was recorded only for a one-shot --save, so a REPL session opened with --url saved a script that started on a blank page. --- src/agent/Agent.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/agent/Agent.zig b/src/agent/Agent.zig index 90c751893..7339b6031 100644 --- a/src/agent/Agent.zig +++ b/src/agent/Agent.zig @@ -516,7 +516,7 @@ const TurnInput = struct { /// Returns true on success. pub fn run(self: *Agent) bool { if (self.start_url) |url| { - if (!self.gotoStart(url, self.one_shot_save != null)) return false; + if (!self.gotoStart(url)) return false; } if (self.one_shot_task) |task| { const saving = self.one_shot_save != null; @@ -541,8 +541,8 @@ pub fn run(self: *Agent) bool { } /// Opens `--url` through the tool layer, so a bad URL fails like any other -/// tool call. -fn gotoStart(self: *Agent, url: [:0]const u8, record: bool) bool { +/// tool call and `/save` replays the opening navigation. +fn gotoStart(self: *Agent, url: [:0]const u8) bool { var arena: std.heap.ArenaAllocator = .init(self.allocator); defer arena.deinit(); const a = arena.allocator(); @@ -559,7 +559,7 @@ fn gotoStart(self: *Agent, url: [:0]const u8, record: bool) bool { self.terminal.printError("could not open {s}: {s}", .{ url, result.text }); return false; } - if (record) self.recordSaveCommand(Command.fromToolCall(.goto, args)); + self.recordSaveCommand(Command.fromToolCall(.goto, args)); return true; }