Skip to content

Add get_browser_telemetry tool for reading archived session telemetry#119

Draft
yummybomb wants to merge 2 commits into
mainfrom
hypeship/mcp-browser-telemetry
Draft

Add get_browser_telemetry tool for reading archived session telemetry#119
yummybomb wants to merge 2 commits into
mainfrom
hypeship/mcp-browser-telemetry

Conversation

@yummybomb

@yummybomb yummybomb commented Jul 7, 2026

Copy link
Copy Markdown

Summary

  • New get_browser_telemetry tool — reads archived telemetry events for a browser session via browsers.telemetry.events. Works for active and deleted sessions. Supports categories filtering, since/until windows, order (asc/desc), and opaque offset paging via next_offset/has_more.
    • Events are compacted for agent context windows: {seq, time, category, type, data, truncated}, with bulky payload fields (body, headers, post_data) dropped and surfaced in omitted_fields.
    • The read window defaults to the session's creation time rather than the API's 5m since default, so reads of older sessions don't silently come back empty.
    • Empty results are disambiguated using the session's telemetry config: telemetry_not_enabled (with recreate-and-reproduce guidance) vs no_events.
    • Multi-category filters are applied client-side: the SDK comma-joins array query params while the API binds category as repeated params, so a multi-value filter sent through the SDK would match nothing. Single categories pass through; semantics are identical because the server filters within the page.
  • manage_browsers telemetry param descriptions now state that telemetry is off unless requested and that the default category bundle (control/connection/system/captcha) omits the debug-critical console/network/page categories.
  • debug-browser-session prompt gains a telemetry section: the opt-in gotcha, the read flow (scan for console_error, network_loading_failed, non-2xx responses, captcha_*), the event catalog, and a note that events survive session deletion. Existing CLI guidance unchanged.
  • @onkernel/sdk bumped ^0.60.0^0.74.0 (required for browsers.telemetry.events). The new SDK returns paginated pages from browserPools.list, extensions.list, and proxies.list, so those call sites were migrated to getPaginatedItems() with real has_more/next_offset values, and those tools' list actions gained limit/offset params so callers can follow next_offset. The browser-pools resource (fixed URI, no params) iterates all pages.

Test plan

  • tsc --noEmit passes
  • prettier --check passes on changed files
  • next build — compiles and typechecks, but page-data collection requires OAuth env vars (KERNEL_CLI_PROD_CLIENT_ID) not available locally
  • Exercise end-to-end against staging: create a browser with console/network/page telemetry enabled, generate events, read via get_browser_telemetry, delete the session, read again (also validates the archive write path)

No test suite exists in this repo, so the changes were not covered by automated tests.

🤖 Generated with Claude Code

- New get_browser_telemetry tool reads archived telemetry events for a
  session (active or deleted) with category filtering, windowing, and
  offset paging. Events are compacted (bulky payload fields dropped) and
  empty results are disambiguated: telemetry_not_enabled vs no_events.
- Defaults the read window to the session's creation time instead of the
  API's 5m default.
- Expand telemetry param descriptions on manage_browsers to call out that
  the default category bundle omits console/network/page.
- Add a telemetry section to the debug-browser-session prompt with the
  event catalog and enable-before-reproduce guidance.
- Bump @onkernel/sdk to ^0.74.0 for browsers.telemetry.events; migrate
  browser pool, extension, and proxy list calls to the paginated response
  shape the new SDK returns.
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mcp Ready Ready Preview, Comment Jul 7, 2026 9:42pm

@socket-security

socket-security Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​onkernel/​sdk@​0.60.0 ⏵ 0.74.082 +5100100 +199100

View full report

… lists

The SDK comma-joins array query params while the API binds category as
repeated params, so a multi-category filter matched nothing; send single
categories through and filter multi-category requests client-side (the
server filters within the page, so semantics are identical). Also wire
limit/offset params into the browser pool, extension, and proxy list
actions so callers can actually follow the has_more/next_offset the
0.74 SDK migration surfaced, and page the browser-pools resource fully.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant