Skip to content

Observe — Read Browser State

The observe tool reads the current browser state. It’s your AI’s eyes into the browser — errors, network traffic, WebSocket messages, performance metrics, visual state, and more.

Always call observe() before interact() or generate() to give the AI context about the current page.

Need one runnable call + response shape + failure fix for every mode? See Observe Executable Examples.

observe({what: "errors"}) // Console errors
observe({what: "error_bundles"}) // Errors with full context
observe({what: "logs", min_level: "warn"}) // Console output
observe({what: "network_bodies", url: "/api", status_min: 400}) // Failed API calls
observe({what: "websocket_events", last_n: 10}) // WebSocket messages
observe({what: "screenshot"}) // Page screenshot
observe({what: "vitals"}) // Web Vitals (LCP, CLS, INP)
observe({what: "recordings"}) // Recording metadata
observe({what: "log_diff_report", original_id: "rec-1", replay_id: "rec-2"}) // Compare recordings

These parameters work across multiple modes:

ParameterTypeDescription
whatstring (required)Which mode to use (see sections below)
limitnumberMaximum entries to return
last_nnumberReturn only the last N items
urlstringFilter by URL substring
after_cursorstringBackward pagination — entries older than cursor
before_cursorstringForward pagination — entries newer than cursor
since_cursorstringAll entries newer than cursor (inclusive, no limit)
restart_on_evictionbooleanAuto-restart if cursor expired from buffer overflow
summarybooleanReturn compact summary (~60-70% smaller). Works with errors, logs, network_waterfall, network_bodies, websocket_events, actions, error_bundles, timeline, history, transients
scopestringFilter scope: current_page (default) or all — applies to errors, logs

Console errors with deduplication. The starting point for any debugging session.

observe({what: "errors"})

Returns deduplicated errors with stack traces, source locations, and occurrence counts.

Pre-assembled debugging context per error. Each bundle includes the error plus the network requests, user actions, and console logs that happened near it.

observe({what: "error_bundles", window_seconds: 5})
ParameterTypeDefaultDescription
window_secondsnumber3How far back to look for related context (max 10)

This is the most powerful debugging mode — it gives the AI a complete incident report instead of a bare stack trace.

All console output (log, warn, error, info, debug) with level filtering.

observe({what: "logs", min_level: "warn", limit: 50})
ParameterTypeDescription
min_levelstringMinimum level threshold: debug < log < info < warn < error
sourcestringExact source filter
include_extension_logsbooleanInclude extension debug logs alongside console output
extension_limitnumberMax extension logs when include_extension_logs: true
include_internalbooleanInclude daemon lifecycle/transport diagnostics
limitnumberMaximum entries to return

Internal Gasoline extension debug logs. Not browser console output — use logs for that. Only useful for troubleshooting the Gasoline extension itself.

observe({what: "extension_logs"})

Resource timing data for all network requests (XHR, fetch, scripts, stylesheets, images). Shows URL, method, status, duration, and size.

observe({what: "network_waterfall", limit: 30})
observe({what: "network_waterfall", url: "/api"})
ParameterTypeDescription
limitnumberMaximum entries
urlstringFilter by URL substring

Full request and response payloads for fetch() calls. Filtered by URL, method, or status code.

observe({what: "network_bodies", url: "/api/users", status_min: 400})
observe({what: "network_bodies", method: "POST", limit: 5})
ParameterTypeDescription
urlstringFilter by URL substring
methodstringFilter by HTTP method (GET, POST, etc.)
status_minnumberMinimum status code (e.g., 400 for errors only)
status_maxnumberMaximum status code
body_pathstringExtract JSON value using dot-path (e.g., data.items[0].id)
limitnumberMaximum entries

Buffer: 100 recent requests, 8 MB total memory. Auth headers are always stripped.


Captured WebSocket messages and lifecycle events (open, close, error).

observe({what: "websocket_events", last_n: 20})
observe({what: "websocket_events", connection_id: "ws-3", direction: "incoming"})
ParameterTypeDescription
connection_idstringFilter by specific WebSocket connection
directionstringincoming or outgoing
last_nnumberReturn only the last N events
limitnumberMaximum entries

Buffer: 500 events max, 4 MB limit. High-frequency streams are adaptively sampled.

Live connection health — active connections, message rates, duration.

observe({what: "websocket_status"})

Returns connection ID, URL, state (open/closed), duration, and message rates per direction.


Current URL and page title.

observe({what: "page"})

All browser tabs with their URLs and titles.

observe({what: "tabs"})

Captures a screenshot of the current viewport. The AI receives the image and can reason about visual state — broken layouts, stuck spinners, hidden elements.

observe({what: "screenshot"})
observe({what: "screenshot", selector: ".error-panel", format: "png"})
observe({what: "screenshot", full_page: true})
ParameterTypeDefaultDescription
formatstringpngImage format: png or jpeg
qualitynumberJPEG quality 1-100 (only for jpeg)
full_pagebooleanfalseCapture the full scrollable page
selectorstringCapture a specific element by CSS selector
wait_for_stablebooleanfalseWait for layout to stabilize before capture

Current state of AI Web Pilot — whether browser control is enabled or disabled.

observe({what: "pilot"})

Recorded user interactions — clicks, typing, navigation, scrolling. Each action includes a timestamp, the element targeted, and the selector used.

observe({what: "actions", last_n: 10})
observe({what: "actions", limit: 50})

Useful for understanding what the user did before an error occurred, or for generating reproduction scripts.


Core Web Vitals: LCP (Largest Contentful Paint), CLS (Cumulative Layout Shift), INP (Interaction to Next Paint), FCP (First Contentful Paint).

observe({what: "vitals"})

Each metric includes the value, the rating (good/needs-improvement/poor), and thresholds.


List recorded browser session videos.

observe({what: "saved_videos"})

Recording metadata — lists all recordings with their IDs, timestamps, and duration.

observe({what: "recordings"})

Actions captured during a specific recording session.

observe({what: "recording_actions"})

Results from a recording playback session.

observe({what: "playback_results"})

Compare error states between two recordings. Useful for verifying that a bug fix actually resolved the issue.

observe({what: "log_diff_report", original_id: "rec-abc", replay_id: "rec-xyz"})
ParameterTypeDescription
original_idstringOriginal recording ID (baseline)
replay_idstringReplay recording ID (comparison)

Merged chronological view of all events — errors, network requests, user actions, console logs — interleaved by timestamp.

observe({what: "timeline"})
observe({what: "timeline", include: ["errors", "network"]})
ParameterTypeDescription
includearrayCategories to include (e.g., errors, network, actions, logs)

Retrieve the result of a previously-issued async command by correlation ID.

observe({what: "command_result", correlation_id: "abc123"})
ParameterTypeDescription
correlation_idstringThe ID returned when the async command was issued

List commands that are still waiting for execution by the extension.

observe({what: "pending_commands"})

List commands that failed during execution.

observe({what: "failed_commands"})

Read localStorage, sessionStorage, or cookies for the current page.

observe({what: "storage", storage_type: "local"})
observe({what: "storage", storage_type: "cookies"})
observe({what: "storage", storage_type: "session", key: "auth_token"})
ParameterTypeDescription
storage_typestringlocal, session, or cookies
keystringRead a specific key (omit for all)

Read IndexedDB databases and object stores.

observe({what: "indexeddb"})
observe({what: "indexeddb", database: "myDB", store: "users"})
ParameterTypeDescription
databasestringDatabase name
storestringObject store name

Navigation history from recorded user actions.

observe({what: "history"})

Groups and summarizes repeated log patterns. Useful for noisy applications where the same log message appears hundreds of times.

observe({what: "summarized_logs"})
observe({what: "summarized_logs", min_group_size: 5})
ParameterTypeDefaultDescription
min_group_sizenumber2Minimum occurrences to form a group

Inventory of interactive elements on the page — forms, buttons, links, inputs.

observe({what: "page_inventory"})
observe({what: "page_inventory", visible_only: true})
ParameterTypeDescription
visible_onlybooleanOnly return visible elements

Capture transient UI elements — toasts, alerts, snackbars, and notifications that appear briefly and disappear. Gasoline intercepts these before they vanish.

observe({what: "transients"})
observe({what: "transients", last_n: 5})
ParameterTypeDescription
classificationstringFilter by type: alert, toast, snackbar, notification, tooltip, banner, flash

Read queued push notifications and alert events emitted by streaming workflows.

observe({what: "inbox"})
observe({what: "inbox", limit: 20})

All buffer-backed modes support cursor-based pagination. The response includes a metadata object with cursor values:

{
"data": [...],
"metadata": {
"cursor": "1707325200:42",
"has_more": true
}
}

Pass the cursor back on the next request:

// Get next page (older entries)
observe({what: "logs", after_cursor: "1707325200:42"})
// Get new entries since last check
observe({what: "errors", since_cursor: "1707325200:42"})

If the cursor expires (buffer overflowed since last read), set restart_on_eviction: true to automatically restart from the oldest available entry instead of erroring.