Commit Graph

7297 Commits

Author SHA1 Message Date
Francis Bouvier
3ced107356 agent: improve extract tool description 2026-06-10 21:28:22 +02:00
Adrià Arrufat
b6b704d43e ci: raise cdp bench MAX_VmHWM to 29000
The agent branch grew .text by ~2.8MB (mostly std monomorphization from
the new script/agent modules); none of it executes in serve mode and
anonymous/heap memory is byte-identical to main (716-724KB Private_Dirty
across main, agent-dev, and a build with the agent code compiled out).

The VmHWM delta is file-backed pages of the binary: the kernel maps them
in large readahead/THP chunks around each touched page, so peak RSS
shifts with link layout on every relink. The agent-less test build
measured 4.2MB *below* main while running the identical serve path,
purely from folio/window boundaries moving. At 28000 the gate was
failing on layout noise (28028-28064), not a regression.
2026-06-10 12:01:25 +02:00
Adrià Arrufat
a1d427e518 browser: make console capture opt-in (#2686)
Move console message listener registration out of Session initialization
into an explicit `enableConsoleCapture` method. This avoids buffering
console logs when they are not needed.
2026-06-10 11:12:59 +02:00
Adrià Arrufat
668c5d1628 Merge branch 'main' into agent 2026-06-09 19:07:31 +02:00
Adrià Arrufat
4b3e18fda2 agent: extract save helpers to save.zig (#2684)
* Revert "agent: enhance /save progress and verification feedback"

This reverts commit 54f467d1fa.

* Revert "agent: verify synthesized scripts during /save"

This reverts commit b141da30ca.

* agent: extract save helpers to save.zig

Moves pure helper functions related to the `/save` command (parsing,
validation, file writing, prompt shaping) from `Agent.zig` to a
dedicated `save.zig` module.
2026-06-09 19:06:09 +02:00
Adrià Arrufat
54f467d1fa agent: enhance /save progress and verification feedback
- Add step-by-step progress reporting during script synthesis.
- Introduce yellow warning bullets for superseded verification runs.
- Refactor bullet emission in Terminal to support multiple statuses.
- Fix spinner formatting when tool arguments are empty.
2026-06-09 17:35:31 +02:00
Adrià Arrufat
b141da30ca agent: verify synthesized scripts during /save
Introduces a multi-step synthesis process for `/save` that derives a
logical JSON output schema and uses a dry-run runtime to verify
candidate scripts. The LLM can now run and self-correct its scripts
using a new `run_script` tool before finalizing the save.
2026-06-09 16:53:39 +02:00
katie-lpd
b23c6c27bc Update agent.md 2026-06-09 16:21:56 +02:00
Adrià Arrufat
1a6ee90da7 Merge pull request #2681 from lightpanda-io/katie-lpd-patch-1
Update agent-tutorial.md
2026-06-09 15:55:07 +02:00
katie-lpd
1186e43f06 Update agent.md
Moving tutorial after quickstart for fluidity
2026-06-09 15:53:30 +02:00
katie-lpd
a48dd45163 Update agent.md 2026-06-09 15:49:34 +02:00
Adrià Arrufat
43495dcf50 docs(agent): drop trailing whitespace in tutorial intro 2026-06-09 15:49:29 +02:00
katie-lpd
07727186da Update agent-tutorial.md
Rewrite:

- Section headings now describe tasks ("Log in to Hacker News" vs "Driving the browser by hand").
- Section 3 leads with the five login commands; selector-hunting  workflow moved to optional subsection at the end.
- Trimmed prereqs (dropped fish variant, $-escape edge cases, long LP_ prefix explanation).

Every working command preserved. Load-bearing callouts in section 3 kept (/waitForSelector doing two jobs, CSS-only selectors).
2026-06-09 15:21:23 +02:00
Adrià Arrufat
7bc35257f3 Merge pull request #2678 from lightpanda-io/katie-lpd-patch-1
Update agent.md
2026-06-09 14:32:09 +02:00
Adrià Arrufat
2601ba5d9c docs(agent): restore dropped features and fix markdown nits
The agent.md rewrite dropped documentation for several features that still
exist in the code. Restore them and clean up the markdown:

- Re-add /clear and /reset to the meta-commands table
- Re-add waitForState to the browser-tools list and the /save
  state-mutating command list
- Re-add --system-prompt and --verbosity (with the --task stderr-pipe
  escalation) to the providers section
- Strip trailing whitespace on blank lines; add blank lines before
  headings and between lists and following paragraphs
2026-06-09 14:31:05 +02:00
katie-lpd
cd6e875707 Update agent.md
- **New opening.** Direct framing: "lets you drive a headless browser by talking to it."
- **New "How to think about it" section.** Explains the three-layer stack and the one-sentence pitch ("pay for the LLM once, then replay deterministically").
- **New "The REPL is where you build scripts" section.** Positions the REPL as a sandbox with a full sandbox-to-saved-script example.
- **New tips section.** Practical guidance for prompts that produce useful saved scripts (be specific about extracted data, name the page, check the file).
- **Updated Quick start.**
2026-06-09 13:29:32 +02:00
Pierre Tachoire
02d6c45dad Merge pull request #2677 from lightpanda-io/agent-build-cache-invalidation
ci: fix cache invalidation for agent-build
2026-06-09 11:42:13 +02:00
Karl Seguin
fa4a60680e Merge pull request #2672 from lightpanda-io/element_scroll
Add Element.scroll (and scrollTo and scrollBy)
2026-06-09 17:35:58 +08:00
Pierre Tachoire
a899fbaec0 ci: fix cache invalidation for agent-build 2026-06-09 11:18:23 +02:00
Adrià Arrufat
59fb13892e terminal: hint first slash command on single slash
Triggers a ghost hint with the first matching slash command when the
user inputs a single `/` character.
2026-06-09 10:29:57 +02:00
Adrià Arrufat
cd8192656b agent: update panda logo and alignment 2026-06-09 10:17:02 +02:00
Adrià Arrufat
3baa2726e9 agent: streamline and shorten comments 2026-06-09 09:34:26 +02:00
Pierre Tachoire
a06967d54a Merge pull request #2674 from lightpanda-io/test_performance_fix
test,perf: Fix leaky thread in test runner
2026-06-09 08:47:21 +02:00
Adrià Arrufat
6f54c78042 agent: simplify and clean up code comments 2026-06-09 08:43:40 +02:00
Adrià Arrufat
3615e58700 agent: deduplicate option setting and tool handling
- Consolidate `/verbosity` and `/effort` into `setEnumOption`.
- Add `abortSave` helper to clean up `synthesizeSave` error paths.
- Simplify `handleToolCall` by extracting the tool execution outcome.
- Update outdated comments referencing `message_arena`.
2026-06-09 08:16:07 +02:00
Adrià Arrufat
f2b5f05479 agent: extract conversation, welcome, and settings
Extracts chat history and arena management into `Conversation.zig`,
the startup banner into `welcome.zig`, and model/config resolution
helpers into `settings.zig` to simplify `Agent.zig`.
2026-06-09 07:54:32 +02:00
Adrià Arrufat
ceff290ff9 Merge branch 'main' into agent 2026-06-09 07:24:10 +02:00
Karl Seguin
db260fe029 test,perf: Fix leaky thread in test runner
The TestHTTPServer leaks a thread for every connection that shuts down. This
commit correctly releases it. It also closes a leaking CDP socket.

Full test went from 20s -> 10s for me
2026-06-09 11:42:31 +08:00
Karl Seguin
80df8d2bab Merge pull request #2673 from lightpanda-io/formdata_uaf
webapi, gc: Give FormData its own arena
2026-06-09 11:04:02 +08:00
Karl Seguin
72770cf438 webapi, gc: Give FormData its own arena
Rather than relying on the frame_arena, use a distinct arena for FormData. This
generally results in tighter memory usage, but more importantly it ensures that
if FormData outlives the frame, we don't get a UAF. This can happen if the
FormData is refernced in v8 and finalized late (e.g. after the frame would
appear to still be needed).

Also, in Frame.submitForm use the explicit acquireRef and releaseRef. This
FormData can [in theory] be passed to JS, via the `formdata` event that we fire.
2026-06-09 10:45:55 +08:00
Karl Seguin
1e68d7693b Add Element.scroll (and scrollTo and scrollBy)
Needed by bluesky to render
2026-06-09 08:57:23 +08:00
Karl Seguin
f4774f1ac2 Merge pull request #2668 from lightpanda-io/fix-newsession-init-failure
browser: clear session slot when Session.init fails
2026-06-09 07:09:04 +08:00
Karl Seguin
4784c29287 Merge pull request #2666 from lightpanda-io/crypto
WPT /WebCryptoAPI/
2026-06-09 07:07:12 +08:00
Adrià Arrufat
8e12f6cdf9 agent: exclude version from comptime banner check 2026-06-08 20:08:32 +02:00
Adrià Arrufat
e6ae13717d agent: move up text 2026-06-08 19:52:42 +02:00
Adrià Arrufat
02cf1c582b agent: add colored braille panda logo
Replace the monochrome braille logo with a truecolor ANSI-colored
version. Update logo dimensions and row counting logic, and simplify
the welcome banner printing to stream logo lines directly.
2026-06-08 19:48:05 +02:00
Adrià Arrufat
826fa34cb5 agent: remove schema from slash help
Stop printing the verbose JSON schema for tool parameters when
displaying slash command help.
2026-06-08 19:11:02 +02:00
Adrià Arrufat
378a11d0dd agent: support LLM commands in slash help 2026-06-08 19:08:39 +02:00
Adrià Arrufat
95963e63e8 agent: simplify welcome banner rendering
Statically assert that the banner fits within 80 columns at compile
time. This removes the need to dynamically measure terminal width
and conditionally hide the logo.
2026-06-08 18:50:35 +02:00
Adrià Arrufat
c6b1649b93 repl: update isocline and polish hints 2026-06-08 18:26:27 +02:00
Adrià Arrufat
6a35253368 terminal: remove custom status bar
Updates the isocline dependency to use its native hints for Ctrl-D
and Esc. Removes the custom status bar rendering logic, and prints
the active model and effort level at REPL startup instead.
2026-06-08 18:13:49 +02:00
Adrià Arrufat
70cc8ff5f9 Merge branch 'main' into agent 2026-06-08 17:01:18 +02:00
Adrià Arrufat
a91eaecb1b build: update isocline and remove top bar
Updates the isocline dependency to a newer commit and removes the
redundant top bar rule configuration in Terminal.zig.
2026-06-08 16:55:29 +02:00
Karl Seguin
6d8c4e9ca6 Merge pull request #2670 from lightpanda-io/websocket_double_free
websocket,gc: Don't call cleanup from websocket.deinit
2026-06-08 22:36:42 +08:00
Pierre Tachoire
bf9df04509 Merge pull request #2669 from lightpanda-io/fix-integration-cache
Fix integration cache
2026-06-08 14:24:08 +02:00
Karl Seguin
86cb0b1820 websocket,gc: Don't call cleanup from websocket.deinit
Don't call cleanup from WebSocket.deinit, since cleanup can result in deinit
being called (via rc release). This results in a double free.
2026-06-08 18:23:08 +08:00
Pierre Tachoire
8d98d7aa99 ci: add missing cache key for integration test 2026-06-08 12:05:44 +02:00
Pierre Tachoire
22d1c5ecd1 Merge pull request #2654 from lightpanda-io/form-upload-file
form: encode file inputs as multipart/form-data on submit
2026-06-08 11:47:54 +02:00
Karl Seguin
4fc0ba7dcb Merge pull request #2667 from lightpanda-io/arena_pool_debug_cleanup
Improve ArenaPool release debug reporting
2026-06-08 17:32:52 +08:00
Adrià Arrufat
c087229b8a agent: add welcome banner with logo
Prints a Braille-art Lightpanda logo alongside the welcome text and
command hints if the terminal is wide enough. Otherwise, falls back
to a text-only layout.

Also exposes `Terminal.displayWidth` to assist with layout calculations.
2026-06-08 11:28:16 +02:00