Conversation
There was a problem hiding this comment.
Performed full review of 90a8b85...f8f7f6e
5 files reviewed | 0 comments | Review on Mesa | Edit Reviewer Settings
archandatta
added a commit
that referenced
this pull request
Jun 2, 2026
Adds browser telemetry to the CLI: - `kernel browsers create --telemetry=all|off|<list>` - `kernel browsers update <id> --telemetry=all|off|<list>` (partial — unspecified categories retain state) - `kernel browsers telemetry stream <id>` with `--categories`, `--types`, `--seq` (Last-Event-ID resume), `-o json` (NDJSON) Full test matrix → https://gist.github.com/archandatta/f27eb3ea93d58e932b9fd9a7b7b9090f ## Essential run steps to validate Build: ```bash go build -o /tmp/kernel ./cmd/kernel export KERNEL_API_KEY=<your key> ``` **1. Config (create / update / get):** ```bash # create with all categories enabled ID=$(/tmp/kernel browsers create --telemetry=all -o json | jq -r .session_id) # verify on the session /tmp/kernel browsers get $ID -o json | jq .telemetry # partial update — only network is changed, others retain state /tmp/kernel browsers update $ID --telemetry=network=off /tmp/kernel browsers get $ID -o json | jq .telemetry # disable everything /tmp/kernel browsers update $ID --telemetry=off ``` **2. Live stream (text + JSON):** ```bash # in terminal A — start streaming /tmp/kernel browsers update $ID --telemetry=all /tmp/kernel browsers telemetry stream $ID # in terminal B — drive traffic via CDP (use any Playwright/CDP client) to https://kernel.sh # events appear in terminal A: 15:04:05<TAB>[network]<TAB>network_response ``` **3. Filters:** ```bash /tmp/kernel browsers telemetry stream $ID --categories=network /tmp/kernel browsers telemetry stream $ID --categories=system # monitor_* events /tmp/kernel browsers telemetry stream $ID --types=network_response /tmp/kernel browsers telemetry stream $ID -o json # NDJSON envelopes ``` **4. Resume from sequence:** ```bash # pull a seq from JSON output, then resume /tmp/kernel browsers telemetry stream $ID --seq=1 # earliest replay (resumes after seq 1; event #1 itself is not replayable) /tmp/kernel browsers telemetry stream $ID --seq=574 # from a specific event ``` **5. Validation paths (all should error cleanly):** ```bash /tmp/kernel browsers create --telemetry=garbage # invalid assignment /tmp/kernel browsers create --telemetry=foo=on # unknown category /tmp/kernel browsers create --telemetry=network=yes # invalid value /tmp/kernel browsers telemetry stream $ID --seq=-50 # negative seq rejected /tmp/kernel browsers telemetry stream $ID --output=yaml # unsupported output ``` Cleanup: ```bash /tmp/kernel browsers delete $ID ``` ## Tests - 14 unit tests under `cmd/browsers_telemetry_test.go` (`go test ./cmd/...`) - Full end-to-end matrix run against prod API → see linked gist <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > CLI-only feature wiring to existing browser APIs; no auth or core infra changes, with broad unit test coverage for parsing and streaming behavior. > > **Overview** > Adds **browser telemetry** to the Kernel CLI: configure it on session **create** and **update**, and **stream** live events from a running session. > > **Configuration** — New `--telemetry` on `browsers create` and `browsers update` accepts `all`, `off`, or per-category lists (`network=on,page=off`). Per-category updates only send named categories so the API can merge; `all`/`off` set the global `Enabled` flag. `browsers update` now allows telemetry-only updates (no proxy/profile/viewport required). > > **Streaming** — New `browsers telemetry stream <id>` uses the SDK SSE client, resolves the session ID, supports `--categories`, `--types`, `--seq` (Last-Event-ID resume), human-readable lines or `-o json` NDJSON via new `PrintCompactJSONLine`. Client-side filtering and category inference (wire `category` or type-prefix, with `monitor_*` → `system`). > > **Docs & tests** — README documents flags and telemetry section; unit tests cover param wire shapes, stream validation, filters, and create/update telemetry mapping. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 0e33313. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
Added standardized issue templates and a GitHub Actions workflow for CLI tests, while cleaning up old GoReleaser configuration and removing a deprecated
index.tsfile.Why we made these changes
To improve contributor experience with structured issue reporting, automate CLI testing for better code quality, and simplify the codebase by removing obsolete files and configurations.
What changed?
.github/ISSUE_TEMPLATE/bug_report.mdfor standardized bug submissions..github/ISSUE_TEMPLATE/feature_request.mdfor standardized feature requests..github/workflows/test.yamlto run CLI tests automatically on pushes and pull requests.monorepoand commented-out sections from.goreleaser.yaml.index.tsfile, deprecating its former CLI responsibilities.Description generated by Mesa. Update settings