Artifacts browser
Page navigation, agent operations, per-thread sessions, and browser restrictions.
Artifacts is an embedded browser for HTTP(S) pages. It runs in the desktop app as an Electron
WebContentsView. Each thread has its own page and in-memory browser session. The pi_browser tool operates that same page.Requirements#
The native browser requires the desktop application. It is not available in
dev:web or a web-only backend.Start your project's server before opening its address. For a worktree, install the project's dependencies and start the server from that worktree. Use a separate port if another checkout is already serving the application.
Open a page#
- Select a thread.
- Open Artifacts from the side-panel controls.
- Enter an HTTP(S) URL and choose Go.
For local development, use the address printed by the server, for example
http://localhost:3000. Back, forward, and reload controls apply to the selected page.Drag the panel separator to resize the viewport. Expand fills the available workspace; Shrink restores the docked view. These layout changes retain the page session.
Agent operations#
pi_browser supports:- Navigation, back/forward, reload, and closing the page.
- Accessibility snapshots with references to page elements.
- Clicking, filling inputs, key presses, and scrolling.
- Element inspection and computed-style queries.
- Viewport, full-page, and selected-element screenshots.
- Console messages and runtime errors.
- JavaScript evaluation in the project page.
For example:
Open localhost:3000 in Artifacts. Go to Settings and submit the empty form. Check the validation messages, capture the page, and report console errors.
Element references belong to the latest accessibility snapshot. After navigation, the agent needs a new snapshot. Screenshots and inspection results also carry document/thread identity; navigation or a thread switch can cancel an in-progress capture.
JavaScript evaluation runs in the project page without Node.js or pi-kit's application bridge. Screenshot interpretation requires a model that accepts image input.
Page lifetime#
Closing the panel retains the page. Close page releases it. Sessions are in memory and last for the desktop window's lifetime; they are not persistent browser profiles.
Up to eight pages are retained. An idle hidden page can be evicted when the limit is reached. Unsaved page state may be lost on eviction or app shutdown.
Restrictions#
Only HTTP(S) destinations are supported. Internal pi-kit renderer/backend origins and non-web schemes such as
file: are blocked, including redirects. Pages have no Node integration or pi-kit preload. Permission requests and downloads are denied. Popups navigate the existing page.Page text, DOM data, and console output are treated as untrusted input to the agent. Browser isolation does not restrict commands run by the coding agent outside the page.
Attach page context#
Inspect, Screenshot, and Console can add context to the current chat draft. They do not send a message. See Screenshots, inspection, and logs for capture scopes and attachment controls.