agent: load external stylesheets by default with LLM

Enables `load_external_stylesheets` when an LLM client is active,
as LLM drivers reason about visibility and computed styles.
Updates the help documentation to reflect this change.
This commit is contained in:
Adrià Arrufat
2026-05-30 22:16:18 +02:00
parent c9c962ec74
commit 26cf182b38
2 changed files with 9 additions and 1 deletions

View File

@@ -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 = .{

View File

@@ -255,7 +255,7 @@
\\ Fetch external <link rel=stylesheet> 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.