Lightpanda: the headless browser designed for AI and automation
agent: record slash commands that address a node by id
Adrià Arrufat1df5838bdb63
diff --git a/src/agent/Agent.zig b/src/agent/Agent.zigindex 7339b6031..4596c8fd0 100644--- a/src/agent/Agent.zig+++ b/src/agent/Agent.zig@@ -713,7 +713,8 @@ fn runRepl(self: *Agent) void {self.terminal.endTool();self.printCommandResult(tc, result);if (!result.is_error) {- self.recordSaveCommand(navigationGoto(aa, tc.tool, tc.args) orelse cmd);+ const replayable = Command.fromToolCall(tc.tool, withSelector(aa, tc.args, result.selector));+ self.recordSaveCommand(navigationGoto(aa, tc.tool, tc.args) orelse replayable);}self.recordSlashToolCall(command_text, tc.name(), tc.args, result) catch |err| {self.terminal.printWarning("LLM conversation out of sync (/{s}: {s}); next prompt may not see this action", .{ tc.name(), @errorName(err) });@@ -1506,7 +1507,7 @@ fn printSlashHelp(self: *Agent, arena: std.mem.Allocator, target: []const u8) vofn runCommand(self: *Agent, arena: std.mem.Allocator, tc: Command.ToolCall) browser_tools.ToolResult {// The terminal can't show an image, but the conversation can.- return browser_tools.call(arena, self.ts.session, &self.ts.registry, tc.name(), tc.args, .{ .inline_image = self.ai_client != null }) catch |err| .{+ return browser_tools.call(arena, self.ts.session, &self.ts.registry, tc.name(), tc.args, .{ .inline_image = self.ai_client != null, .record = true }) catch |err| .{.text = switch (err) {error.OutOfMemory => "out of memory",error.FrameNotLoaded => "no page loaded — run /goto <url> first",