diff --git a/src/agent/Agent.zig b/src/agent/Agent.zig index a9205bdb..4d7405b1 100644 --- a/src/agent/Agent.zig +++ b/src/agent/Agent.zig @@ -277,6 +277,14 @@ pub fn init(allocator: std.mem.Allocator, app: *App, opts: Config.Agent) !*Agent self.ai_client = if (llm) |l| try initAiClient(allocator, l, opts.base_url) else null; errdefer if (self.ai_client) |c| deinitAiClient(allocator, c); + // An LLM driver reasons about visibility/computed styles, so fetch external + // stylesheets by default. Pure replay and --no-llm keep the cheap fast path. + // The --enable-external-stylesheets flag is already folded into the session + // default, so this only ever turns the feature on. + if (self.ai_client != null) { + self.session.load_external_stylesheets = true; + } + if (will_repl) { self.terminal.attachCompleter(); self.terminal.completion_source = .{ diff --git a/src/help.zon b/src/help.zon index dd620050..44a1bd10 100644 --- a/src/help.zon +++ b/src/help.zon @@ -255,7 +255,7 @@ \\ Fetch external resources so their rules \\ contribute to computed styles (and therefore to visibility checks like \\ display, visibility, opacity, pointer-events). - \\ Defaults to false. + \\ Defaults to false, except in agent mode with an LLM, where it is on. \\ --block-private-networks \\ Block HTTP requests to private/internal IP addresses after DNS \\ resolution.