Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
1b1f03f
Add browser telemetry reader
yummybomb Jul 14, 2026
289f6c9
Keep source and raw ts in events, validate since+desc, fix empty notes
yummybomb Jul 15, 2026
4f576bb
Make telemetry debug guidance heuristic instead of prescriptive
yummybomb Jul 15, 2026
3899c1b
Resolve telemetry ordering contradiction in debug prompt
yummybomb Jul 15, 2026
48f6984
Clarify paging and narrowing guidance in telemetry debug prompt
yummybomb Jul 15, 2026
58e4534
Let runtime notes carry empty-result guidance in tool description
yummybomb Jul 15, 2026
c644a4f
Tighten get_browser_telemetry description
yummybomb Jul 15, 2026
dab4749
Reserve telemetry_currently_disabled status for full-session reads
yummybomb Jul 15, 2026
a1360c2
Make empty-archive note category guidance hypothesis-driven
yummybomb Jul 15, 2026
ecea401
Align interaction telemetry description with sibling categories
yummybomb Jul 15, 2026
188c7e8
Detect disabled telemetry from empty category config
yummybomb Jul 15, 2026
9d2d271
Skip since default on until-only reads; document get_browser_telemetr…
yummybomb Jul 15, 2026
033119e
Harden telemetry response handling
yummybomb Jul 16, 2026
ffbcd4d
Fold telemetry reads into browser management
yummybomb Jul 16, 2026
30e8a70
Remove telemetry unit tests
yummybomb Jul 16, 2026
909eed3
Address telemetry review findings
yummybomb Jul 16, 2026
94477c7
Await telemetry reads so API errors reach the action error handler
yummybomb Jul 16, 2026
9ec8489
Trim explanatory comments to one-liners
yummybomb Jul 16, 2026
f4cc8d3
Restore rationale comments on epoch default and compact JSON response
yummybomb Jul 16, 2026
9b1bca3
Treat an explicit pre-creation since as a full-session read
yummybomb Jul 16, 2026
260708e
Nudge long ascending telemetry reads toward order=desc
yummybomb Jul 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ Self-hosted deployments can hide sensitive tool families by setting `KERNEL_MCP_

### manage\_\* tools

- `manage_browsers` - Create, list, get, and delete browser sessions. Supports headless/stealth modes, profiles, proxies, viewports, extensions, and SSH tunneling.
- `manage_browsers` - Create, update, list, get, and delete browser sessions, and read archived telemetry for active or deleted sessions. Supports headless/stealth modes, profiles, proxies, viewports, extensions, and SSH tunneling.
- `manage_profiles` - Setup (with guided live browser session), search/list with pagination, get, and delete browser profiles for persisting cookies and logins.
- `manage_projects` - Create, list, get, update, and delete organization projects. Inspect and update per-project resource limits.
- `manage_api_keys` - Create, list, get, update, and delete org-wide or project-scoped API keys. Create returns the plaintext key once.
Expand Down
27 changes: 21 additions & 6 deletions src/lib/mcp/prompts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";
import { TELEMETRY_EVENT_CATALOG } from "@/lib/mcp/telemetry";

export function registerKernelPrompts(server: McpServer) {
// MCP Prompt explaining Kernel concepts
Expand Down Expand Up @@ -128,7 +129,19 @@ kernel browsers process --help
kernel browsers playwright --help
\`\`\`

**MCP Exception:** The \`computer_action\` MCP tool with action "screenshot" is useful since it returns images directly to the agent.
**MCP Exceptions:** The \`computer_action\` MCP tool with action "screenshot" is useful since it returns images directly to the agent, and \`manage_browsers\` with action "get_telemetry" reads structured telemetry events (see below).

---

## Telemetry Events (structured signal — works even after the session is deleted)

When telemetry was captured, it's usually the fastest way to pinpoint a failure — read it before reaching for screenshots or logs. If the session has been deleted, it's the only signal still available: every CLI command in this guide needs a live session.

Start broad: call \`manage_browsers\` with action "get_telemetry", session_id "${session_id}", and no filters. That starts at session creation and returns the first page (up to 100 events); page with \`next_offset\` as \`offset\` while \`has_more\` is true, preserving \`categories\`, \`until\`, and \`order\`. An empty unfiltered read is definitive: nothing was archived. Narrow when the output is too large to scan or you already know where to look: \`categories\` to isolate a signal you've spotted, \`order\` "desc" when the end of the session matters most, \`since\`/\`until\` to bracket a known failing step. Correlate event timestamps with the failing automation step.

**Gotcha: telemetry is opt-in and only covers activity that happened while capture was on.** Archived events survive telemetry being disabled and the session being deleted, so the archive — not the current config — is the ground truth: \`manage_browsers\` action "get" showing no enabled \`telemetry\` categories means capture is off now, not that nothing was recorded. The default bundle (control/connection/system/captcha) also omits the debug-critical categories. To capture new evidence on an active browser, use \`manage_browsers\` action "update" to enable \`telemetry_console\`, \`telemetry_network\`, and \`telemetry_page\`, then reproduce the issue; recreate the browser only if the session has ended.

${TELEMETRY_EVENT_CATALOG}

---

Expand Down Expand Up @@ -224,6 +237,7 @@ These are **normal** and don't indicate problems:
## Debugging Checklist

- [ ] Session exists and is active
- [ ] Telemetry events reviewed (if any were captured)
- [ ] Screenshot shows expected content (or reveals error)
- [ ] Current URL is as expected
- [ ] Supervisor logs show all services running
Expand All @@ -237,11 +251,12 @@ These are **normal** and don't indicate problems:

Based on your issue "${issue_description}", start with:

1. **Get browser info** to confirm session is active
2. **Take screenshot** to see current state
3. **Check page URL** to see if on error page
4. **Test network** if seeing connection errors
5. **Review logs** for specific error patterns`;
1. **Read telemetry events** — works whether or not the session still exists; if the archive is empty and the session is active, enable the debug categories and reproduce
2. **Get browser info** to confirm the session is active before using the CLI commands
3. **Take screenshot** to see current state
4. **Check page URL** to see if on error page
5. **Test network** if seeing connection errors
6. **Review logs** for specific error patterns`;

return {
messages: [
Expand Down
14 changes: 14 additions & 0 deletions src/lib/mcp/telemetry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export const telemetryEventCategories = [
"console",
"network",
"page",
"interaction",
"control",
"connection",
"system",
"screenshot",
"captcha",
"monitor",
] as const;

export const TELEMETRY_EVENT_CATALOG = `Event categories: console (console output and uncaught exceptions), network (request/response metadata), page (navigation and lifecycle), interaction (clicks, keys, scrolls), control (agent-driven API calls), connection (CDP/live-view attach/detach), system (VM health), screenshot (periodic monitor screenshots), captcha (captcha detection and solve outcomes), monitor (telemetry collector health; captured automatically with any CDP category). High-signal event types: console_error, network_loading_failed, network_response with non-2xx status, captcha_solve_result, system_oom_kill, service_crashed, monitor_disconnected (telemetry gap — treat following events as incomplete).`;
Loading
Loading