mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-06-11 01:25:53 -04:00
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:
@@ -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 = .{
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user