Add browser telemetry reads and debugging guidance#119
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
1b23fd3 to
7f98f1a
Compare
|
I know this is wip but fly by initial reactions from opus Overall looking good + nothing blocking. One field escapes the compaction. It strips Worth a think: the empty-result logic is doing a lot. Three statuses ( Worth a think: standalone tool vs. an action on |
98eb0a9 to
033119e
Compare
- Default since to the epoch instead of fetching created_at: the archive cannot predate the session, so the reads are equivalent and the common path saves a browser lookup. - Fetch the browser only for the terminal-empty capture-state hint, catch only 404 (deleted/unknown session), and let other errors propagate like sibling actions. - Drop the response status field: it collided with the list status param and duplicated items/has_more plus the note. - Reword the filtered-empty disabled hint to steer toward adjusting the filter rather than enabling capture and retrying. - Fix the debug prompt: a session with capture off has an empty telemetry config in GET responses, not a null field. - Document why compact single-line JSON is used over the pretty-printed response helpers.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 909eed3. Configure here.
Returning the un-awaited promise from the get_telemetry case let API failures (e.g. 404 for an unknown session) escape the surrounding try/catch as unhandled rejections instead of resolving to a tool error response. Caught by exercising the handler against production.
b864d28 to
94477c7
Compare

summary
get_browser_telemetryfor archived browser telemetry: works for active and deleted sessions, including events captured before telemetry was disabledsince/until), ascending/descending reads, and opaque offset pagination;since+order=descis rejected up front with a clear errorbody,headers,post_data, and screenshotpng, plus any data field over 8 KiB; report every removal inomitted_fieldsand keepseq, rawts(µs), readabletime,source, andtruncatedstatusparam): empty filtered pages with more data tell the caller to continue; terminal empty reads say whether anything is archived; current capture state is appended to the notemanage_browserstelemetry category descriptions (default bundle gotcha, per-category definitions)debug-browser-sessionprompt: telemetry-first heuristics instead of a fixed script, the opt-in/archive-vs-config gotcha, and the shared event catalog (defined once insrc/lib/mcp/telemetry.ts, reused verbatim)The required SDK update and pagination migrations landed in #122; this branch is rebased onto
main.live verification (production)
Exercised the actual tool handlers end-to-end against production: created a browser with console/network/page telemetry via
manage_browsers, drove a navigation, an intentional console error, and a failing page load, then verified: full-session default reads,omitted_fieldscompaction, a category filter isolating the plantedconsole_error(51.8KB → 1KB),order=desc, filter misses,since+descrejection, current-disabled hints, never-enabled sessions, and post-deletion reads.verification
bun install --frozen-lockfilebunx tsc --noEmitpackages/api/cmd/api/api/telemetry.go,browsers.go)The repository does not have an automated test suite.
Note
Medium Risk
Expands a high-traffic MCP tool with new query semantics and SDK telemetry calls; behavior is read-only for telemetry but affects agent debugging workflows and token-sized responses.
Overview
Adds
manage_browsersactionget_telemetryso agents can read archived browser telemetry for active or deleted sessions. Queries support category filters,since/until,asc/desc, and opaquenext_offsetpaging;sincewithorder=descis rejected with a clear error. Default unfiltered ascending reads use the Unix epoch instead of the API’s five-minutesincedefault so the first page starts at session creation. Responses compact event payloads (always dropbody,headers,post_data,png; cap other fields at 8 KiB) and return compact JSON withnotehints on empty pages (including whether capture is currently disabled).Introduces shared
src/lib/mcp/telemetry.ts(telemetryEventCategories,TELEMETRY_EVENT_CATALOG) reused in tool schemas and thedebug-browser-sessionprompt, which is reworked to be telemetry-first (opt-in capture vs archive, paging heuristics). README documents telemetry onmanage_browsers; create/update telemetry param descriptions clarify the default lightweight bundle vs debug categories.Reviewed by Cursor Bugbot for commit 94477c7. Bugbot is set up for automated code reviews on this repo. Configure here.