Commit Graph

8347 Commits

Author SHA1 Message Date
Halil Durak
cbaef301d9 Config: fix crash related to absolute paths
BoringSSL is fine with that still.
2026-07-22 18:29:31 +03:00
Halil Durak
6f828cb92e createX509Store: track hashed directories separately 2026-07-22 18:29:30 +03:00
Halil Durak
1429202de3 update createX509Store in all call sites 2026-07-22 18:29:30 +03:00
Halil Durak
03cfdbe567 Config: dupe received dir from arg iterator 2026-07-22 18:29:30 +03:00
Halil Durak
71536de386 createX509Store: report if no certificates loaded
Unifies how we report empty stores by checking directly on `X509_STORE`.
2026-07-22 18:29:30 +03:00
Halil Durak
2a53b1e243 createX509Store: skip custom CA loading if none given 2026-07-22 18:29:29 +03:00
Halil Durak
1c97bc42a4 crypto: more bindings
* bind `X509_STORE_get0_objects`,
* bind `sk_num`,
* bind `sk_X509_OBJECT_num`,
* add `getCertCount` helper.
2026-07-22 18:29:29 +03:00
Halil Durak
d6ce3738a5 remove --disable-root-certificates flag 2026-07-22 18:29:29 +03:00
Halil Durak
1b15985e7f Config: drop local in hashed dir check 2026-07-22 18:29:29 +03:00
Halil Durak
fdb90a8def help.zon: obey alphabetical order 2026-07-22 18:29:28 +03:00
Halil Durak
bf916e71af Config: remove unnecessary import 2026-07-22 18:29:28 +03:00
Halil Durak
3c4d098315 Network: prefer Config.isHashedDirectory for consistency 2026-07-22 18:29:28 +03:00
Halil Durak
11570202f3 Config: ensure passed --ca-path paths contain hashed certs 2026-07-22 18:29:28 +03:00
Halil Durak
b7f61e5766 Network: support custom CA install 2026-07-22 18:29:27 +03:00
Adrià Arrufat
e1202b7660 script: route console output through an optional sink
Since the Zig 0.16 merge, console.log and completion echoes from the
agent runtime tests reach the real stdout (0.15 silently swallowed
them), polluting the bench.json that CI captures from 'zig build test'
and breaking the perf-fmt job's JSON decoding.

Add Runtime.console_sink: when set, console lines write there instead
of stdout/stderr. The three printing tests now capture their output
and assert it, covering console argument joining and the top-level
return echo.
2026-07-22 17:00:40 +02:00
Karl Seguin
12fa469214 Merge pull request #3023 from lightpanda-io/zig-16-merge-fix-2
zig: use posix shim for shutdown
2026-07-22 22:34:41 +08:00
Karl Seguin
abdd9f0037 zig: use posix shim for shutdown 2026-07-22 22:34:16 +08:00
Adrià Arrufat
bae9388f1c Merge branch 'main' into brave-search 2026-07-22 16:27:35 +02:00
Karl Seguin
c0c8d4dc70 Merge pull request #3018 from lightpanda-io/improve-dead-peer-detection
cdp: Improve dead-peer detection
2026-07-22 22:01:10 +08:00
Karl Seguin
2e55ace296 Merge pull request #3021 from lightpanda-io/zig-16-merge-fix
zig, minor: fix zig 0.16 merge
2026-07-22 21:59:31 +08:00
Karl Seguin
fbecab3910 zig, minor: fix zig 0.16 merge 2026-07-22 21:48:55 +08:00
Karl Seguin
e979a317ad Merge pull request #3007 from lightpanda-io/zig-0.16
zig: Zig 0.16
2026-07-22 21:43:39 +08:00
raj921
1e31e45bcf cdp: preserve node IDs across child frame navigation 2026-07-22 17:15:25 +05:30
Adrià Arrufat
99262190da feat(tools): add Brave search + /searchEngine metacommand
Add Brave as a second API-backed web search engine: the search tool's
auto mode tries Brave then Tavily (keyed on BRAVE_API_KEY/TAVILY_API_KEY)
before the DuckDuckGo scrape. A new /searchEngine REPL metacommand pins
the engine explicitly (auto|tavily|brave|duckduckgo) — an explicit
engine surfaces its failures instead of silently degrading — and is
persisted to .lp-agent.zon like the other REPL settings.

Bumps zenai to pick up the zenai.search.brave client.
2026-07-22 13:44:51 +02:00
Karl Seguin
29e31377ed cdp: Improve dead-peer detection
1 - On linux, set TCP_USER_TIMEOUT to 10 seconds. This closes the gap where
    TCP_KEEPALIVE doesn't trigger if there are un-ack'd writes

2 - shutdown the socket on cases where we know the peer is gone. This would
    unblock a worker blocked on a send()
2026-07-22 18:37:37 +08:00
Karl Seguin
32280e6864 Merge pull request #3010 from staylor/fix/issue-3009
Interrupt nested script waits during teardown
2026-07-22 16:59:34 +08:00
Karl Seguin
0cb9c3aebb dedupe check and centralize it in HttpClient's tickSync 2026-07-22 16:41:33 +08:00
Karl Seguin
5b12c42df2 cdp: Sanitize non-UTF 8 values
Builds on https://github.com/lightpanda-io/browser/pull/2972 in order to fix
https://github.com/lightpanda-io/browser/issues/2992

I couldn't think of a generic way to fix this. Created a SafeString which
wraps a `[]const u8` with a custom jsonStringify function. This is now applied
to both header names and values.

The existing latin1 to utf8 conversion is now extracted into string.js and used
in Frame for the filename. This was moved to Frame because the same issue
could cause issues trying to save the file.
2026-07-22 14:59:33 +08:00
Karl Seguin
0871b6a8da disable Zig 0.16 signal_stack_size
Make sure jemallocator is disabled in Release builds (we only use it in Debug
builds to collect metrics. Supposedly something changed in our 0.16 build that
causes it to be initialized even though it isn't used. Not sure, for this, I'm
just doing what Claude tell me, but disabling something in Release that I know
we aren't using sounds ok).
2026-07-22 13:26:06 +08:00
Karl Seguin
92537df123 Raise memory limit regression to 29MB
We've been climbing the last couple weeks, and Zig 0.16 appears to have added
~400KB. I'll try to go hunt it, but I don't want this to delay the merge.

(Pierre agrees)
2026-07-22 13:26:06 +08:00
Karl Seguin
802862120f update zenai dep (zig 0.16) 2026-07-22 13:26:06 +08:00
Karl Seguin
df7bde233d Fix linux build
Try to fix CI (this is what claude came up with, I have no idea why CI is
failing).
2026-07-22 13:26:06 +08:00
Karl Seguin
8e42d63c1c zig: Zig 0.16
Built against https://github.com/lightpanda-io/zig-v8-fork/tree/zig-0.16 but
it doesn't require a new v8 build.

Built against https://github.com/lightpanda-io/boringssl-zig/tree/zig-0.16
since the current fork we point to isn't updated.

A global std.Io instance, lp.io. Way easier this way and requires 0 changes to
our libcurl integration / event loop.

Network code uses a new layer that does what Zig 0.15's posix package used to
do. Again, quicker migration that way. But, as long as we have the global IO,
and given the half-baked nature of networking in std.Io 0.16, this just makes
sense. Things can be migrated as needed.

The std.time.* -> std.Io.Timestamp/Clock/Duration resulted in _a lot_ of
changes. ArrayList = .{} -> ArrayList -> .empty also resulted in a lot of
changes, but that's obviously superficial. As is the trimLeft/trimRight ->
trimStart/trimEnd rename.

Locking adopt the `Uncancelable` variants, e.g. mutex.lockUncancelable() to
preserve the error-free signature (and, because cancellation would be something
we'd have to put more thought into).

std.json.ObjectMap is now unmanaged, so the allocator had to be passed along.
However, there's still a deprecated managed variant of MemoryPool, so I switched
to it (we can do a small follow up PR to move to the unmanaged after).

I tried use_llvm = false, but it locks my computer, consuming RAM until MacOS
gives me a popup I've never seen before, begging me to start killing processes.

Agent and the networking stuff saw the most significant changes.
2026-07-22 13:26:03 +08:00
Karl Seguin
8a3ef296c0 Merge pull request #3011 from lightpanda-io/rc-overflow
overflow: Make RC a u32
2026-07-22 13:19:59 +08:00
Karl Seguin
a100c49cee overflow: Make RC a u32
Remove the RC(T) generic, make the counter always a u32. We've now seen two
u8 overflow cases. Time to eliminate them all.
2026-07-22 09:39:54 +08:00
Scott Taylor
a12032cd0e Interrupt nested script waits during teardown
Assisted-By: devx/8bea7794-aef3-4ef5-a06d-fd1f1f3aafd0
2026-07-21 18:07:15 -04:00
Karl Seguin
90db5d7f69 Merge pull request #3005 from lightpanda-io/reduce-gc-hint-frequency
perf, v8: reduce gc hint frequency
2026-07-21 18:44:19 +08:00
Karl Seguin
ea13c57dcd Merge pull request #3006 from lightpanda-io/wpt-adjust
wpt: adjust concurrency
2026-07-21 18:00:31 +08:00
Pierre Tachoire
fd35c0d01a wpt: adjust concurrency 2026-07-21 11:38:27 +02:00
Pierre Tachoire
ea2008334f Merge pull request #2990 from staylor/scott/http-cache-interception
Add per-CDP control for Network.setCacheDisabled
2026-07-21 10:06:54 +02:00
Karl Seguin
69b3424b9c Revert "experiment: On session teardown, use less aggressive v8 GC hint"
This reverts commit aa4323f72b.
2026-07-21 10:34:01 +08:00
Karl Seguin
aa4323f72b experiment: On session teardown, use less aggressive v8 GC hint
critical -> moderate
2026-07-21 10:06:42 +08:00
Karl Seguin
eca8baf8ed v8, perf: Reduce v8 GC hint frequency.
We currently send a memoryPressureNotification every second during a run. This
can put too much pressure on v8, manifesting as high CPU usage particularly on
complex pages. This commit changes it to every 5 seconds.

Also, remove unused lowMemoryNotification.v8, perf: Reduce v8 GC hint frequency.
2026-07-21 08:58:42 +08:00
Scott Taylor
c7850a4012 Add per-CDP cache disable configuration
Assisted-By: devx/2fa2960e-76f4-4b6e-b6e6-1419f108f12b
2026-07-20 14:02:55 -04:00
Pierre Tachoire
cd9492f29c Merge pull request #3003 from lightpanda-io/script-error-window-reportError
webapi: On script error, trigger window.reportError
2026-07-20 17:53:06 +02:00
Pierre Tachoire
a5ee29d99d Merge pull request #2985 from Totara-thib/plumber-ci
ci: add plumber to watch workflow security
2026-07-20 17:27:22 +02:00
Karl Seguin
6c5bde28df webapi: On script error, trigger window.reportError
Besides this being correct, it should improve WPT stalls by triggering the
window.onerror which the WPT harness hooks into to stop tests.
2026-07-20 21:50:50 +08:00
Thibaud-Vdb
e25ea46cd8 chore(readme): remove plumber badge
Co-authored-by: Pierre Tachoire <pierre@tch.re>
2026-07-20 15:33:28 +02:00
Thibaud-Vdb
1d553ff5ee ci: add plumber to watch workflow security
Runs on pushes to main and on pull requests. The config starts from
the generated defaults and is scoped to this repo: the few controls
that are off carry a note explaining why and what would let them
come back on.

Reports are uploaded to code scanning, except on PRs from forks
where the token cannot write security events. Each run on main also
publishes the score through OIDC, which feeds the live badge added
to the README next to the existing ones.
2026-07-20 15:12:58 +02:00
Pierre Tachoire
32479b1299 Merge pull request #2984 from Totara-thib/pin-actions
ci: pin github actions to commit shas
2026-07-20 15:12:03 +02:00